Barno_07:
https://www.mql5.com/en/job
I just wanted to contact you guys through e-mail. I m learning MQL4 and need your help in that. I want to create an Expert Advisor which will operate my orders in every 1 minutes and 5 minutes candlesticks. But it is only working in Hourly candlesticks. It would be great if you look into my problem and help me with some codes.
Thank you,
Barnadeep
![Freelance service at MQL5.com Freelance service at MQL5.com](/i/community/logo_mql5_small.png)
you can store the last time of the 5m bar and check if it's not the same for the new one , then you have a new bar on the 5 min time-frame and you can put your code in this block
you can do like this in both 1M and 5M
datetime lastbar=iTime(NULL,PERIOD_M1,100); void onTick() { if(iTime(NULL,PERIOD_M1,0)!=lastbar) { //do some thing , you have now a new bar opening and the code will run once at each opening lastbar=iTime(NULL,PERIOD_M1,0); } else //do something else }
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
I just wanted to contact you guys through e-mail. I m learning MQL4 and need your help in that. I want to create an Expert Advisor which will operate my orders in every 1 minutes and 5 minutes candlesticks. But it is only working in Hourly candlesticks. It would be great if you look into my problem and help me with some codes.
Thank you,
Barnadeep