MA
As written, your var
olBarTime
is volatile & is being reset each tick - when start() executes again
To do what I think you want, use a static var which preserves its state (i.e. value) across ticks
--
static int oldBarTime; init() { oldBarTime=Time[0]; } int start() { if(oldBarTime!=Time[0]) { oldBarTime=Time[0]; Print("Opening of a 15 mn bar"); } return(0); }
Good luck
-BB-

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Dear All,
I am trying to use the following code and cant make it work. I have check and rechecked the code seem clean, I cant figure out why nothing is being printed....please help.
Nothing is being printed...did i miss something ?
thx!