Hi,
I'm trying to refer to a piece of data just once every minute.
Something like if time>time[1] ...
In mql4 how would I write that condition? I've tried multiple ways and can't get it to work. I've looked through the documentation all morning (and searched the internet) and cannot find this basic example or this piece of info that tells me how to refer to past time periods.
Time 1 minute ago is . . .
TimeCurrent() + (PERIOD_M1 * 60);
Time 1 minute ago is . . .
Fiver dude
Time 1 minute ago is . . .
1 minute ago is :
TimeCurrent() - (PERIOD_M1 * 60);
Or quick style.
int NextRun; int start() { if(TimeCurrent>=NextRun) { // do something here then NextRun=TimeCurrent+60; } return(0); }
Whatever you place in place of the comment "do something here" will run every minute.
1 minute ago is :
Or quick style.
Whatever you place in place of the comment "do something here" will run every minute.
Or quick style.
Whatever you place in place of the comment "do something here" will run every minute.
That one did work too, ( I just had to add () after the TimeCurrent, which I guess was okay to do)
The time all the way over to the right shows 60 second intervals which is what I wanted.
If there is a pause for no ticks as Raptor noted, that wouldn't affect my purpose.
My purpose was to verify my indicator parameters at specific trade bars in back-test mode, and I didn't want to fill up the print log with multiple prints from the same bar.
Also in determining a Mean and other calculations from the data, I didn't want multiple entries from the same bar to throw off my results.
That one did work too, ( I just had to add () after the TimeCurrent, which I guess was okay to do)
The time all the way over to the right shows 60 second intervals which is what I wanted.
If there is a pause for no ticks as Raptor noted, that wouldn't affect my purpose.
My purpose was to verify my indicator parameters at specific trade bars in back-test mode, and I didn't want to fill up the print log with multiple prints from the same bar.
Also in determining a Mean and other calculations from the data, I didn't want multiple entries from the same bar to throw off my results.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I'm trying to refer to a piece of data just once every minute.
Something like if time>time[1] ...
In mql4 how would I write that condition? I've tried multiple ways and can't get it to work. I've looked through the documentation all morning (and searched the internet) and cannot find this basic example or this piece of info that tells me how to refer to past time periods.
Thanks