I have a strange question about order of operation in the body of the main in an EFS.
If I have something like:
main {
do action A;
do action B;
myMA_FAST = study5.getValue(MAStudy.MA);
myMA_SLOW = study6.getValue(MAStudy.MA);
myTICK = "$TICK,1";
myTICK_O = open(0, 1, myTICK)*1;
myTICK_H = high(0, 1, myTICK)*1;
myTICK_L = low(0, 1, myTICK)*1;
myTICK_C = close(0, 1, myTICK)*1;
}
The situation is that action A and B use values of myMA_FAST, myMA_SLOW, and various myTICK variables. The reason I get the values from the end is so that in the backtest portion, when I am looking at the current bar, I am making decisions based only on the data from the previous bar.
The funny thing, is that the values for myMA_FAST and myMA_SLOW in action A and action B are from the previous bar when evaluated, but the value for the myTICK variables are actually for the current bar even though technically the call was not made yet. Am I missing something?
I know this is a simple concept, but I just thought that perhaps I am missing something fundamental in how these calls are made.
Thanks as always . . .
Thomas.
If I have something like:
main {
do action A;
do action B;
myMA_FAST = study5.getValue(MAStudy.MA);
myMA_SLOW = study6.getValue(MAStudy.MA);
myTICK = "$TICK,1";
myTICK_O = open(0, 1, myTICK)*1;
myTICK_H = high(0, 1, myTICK)*1;
myTICK_L = low(0, 1, myTICK)*1;
myTICK_C = close(0, 1, myTICK)*1;
}
The situation is that action A and B use values of myMA_FAST, myMA_SLOW, and various myTICK variables. The reason I get the values from the end is so that in the backtest portion, when I am looking at the current bar, I am making decisions based only on the data from the previous bar.
The funny thing, is that the values for myMA_FAST and myMA_SLOW in action A and action B are from the previous bar when evaluated, but the value for the myTICK variables are actually for the current bar even though technically the call was not made yet. Am I missing something?
I know this is a simple concept, but I just thought that perhaps I am missing something fundamental in how these calls are made.
Thanks as always . . .
Thomas.
Comment