PureBytes Links
Trading Reference Links
|
Hello EL wizards,
I have two questions about how TS behaves with regard to variables at the
end of a ?? minutes per bar chart.
For example, if I had an indicator on a 5 minute bar chart and it contained
the following code, what would be the value of X *for the last bar after 5
minutes*?
Assume the following: (a) X = 0 before entering the last bar. (b) There are
100 ticks that happen during the last bar.
**CODE**
var: X(0);
X=X+1;
**END CODE**
In other words, if the 5 minute bar chart is ticking along and the clock
turns 11:55 (and thus starting a new bar), what is the value of X above
after 12:00 rolls along if 100 ticks occured between 11:55 and 12:00?
Second question:
How do you write your EL code to detect that the last bar is being
calculated again? Hence, as in the above scenario, how do you detect that
the current calculation is the first tick (after 11:55) as opposed to any
other tick of that bar?
Thanks!
DC
|