I wrote an indicator that needs to know the first tick of a new bar. How do I do that?
The question aside, I actually tried a very simple
if (H=L) then { first tick of new bar }
but was surprized to find that this does not trigger when the market is ticking fast! (Of course if I could get the print function to work I might be more sure
How to detect the first tick of a new bar?
cael,
you can use the reserved word Barstatus for your purpose.
Barstatus returns 0 for the first tick, 1 for a normal-tick, and 2 for bar-close.
This should do it.
Chris
you can use the reserved word Barstatus for your purpose.
Barstatus returns 0 for the first tick, 1 for a normal-tick, and 2 for bar-close.
Code: Select all
If BarStatus = 0 then { first tick of new bar }
Chris