datetime Update_Time; void OnTick() { if(Update_Time != iTime(NULL,0,0)) { Update_Time = iTime(NULL,0,0); ... //your code } }
If you use M5 TF - this sode will be work 1 time per 5 minutes when new candle is appeared. Try it.
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
Good morning everyone,
I wrote an expert Advisor in mql4 format which open position at certain time of the day, it calculate number of lots, take profit and stop loss.
Now I want to change it because it doesn’t work very well and I want that it open position when the candle start (in the timeframe I set) but I don’t know the function to write it. Can someone please help me?