here is a stupid and rather basic question about PowerLanguage. I have a signal with a local variable whose previous values I refer to using the square brackets [...].
Code: Select all
{Example signal code}
variables:
v1(123.45);
v1 = close[0];
print ("CurrentBar = " + NumToStr (CurrentBar,0) +
", close[10] = " + NumToStr (close[10],2) +
", v1[10] = " + NumToStr (v1[10],2));
When I try this in MC 8.8 I get the initial value (here: 123.45) whenever CurrentBar is between 1 and 10. This is irrepsective of MaxBarsBack which only determines how many bars are skipped before my signals starts and which makes sure that close[10] yields the correct values right from the beginning at CurrentBar=1. When I point the mouse at v1 in the editor, it tells me that the variable is of the type NumericSeries.
Thank you very much for your help.
HPF