I've been using code in MT4 that waits for a new Bar to open before the rest of the code is executed. I've been trying to migrate this specific feature into my MT5 code, but without success. Specifically, I'm getting hung up on the Time[0] variable that is no longer in MT5. Can someone assist with this please!!?? Thank You!!!
- MQL5 Wizard: Development of trading robots for MetaTrader 5
- Download MetaTrader 5 build 1730 with new trader features
- Web version features
You may have a look at the "Migrating from MQL4 to MQL5" article (https://www.mql5.com/en/articles/81).
By searching "Time[" in that article, you may find how to implement "Time[]" feature in MQL5:
datetime Time[]; int count; // number of elements to copy ArraySetAsSeries(Time,true); CopyTime(_Symbol,_Period,0,count,Time);
Depending on how many elements you need to access the Time array, you may specify the value of "count".

Migrating from MQL4 to MQL5
- 2010.05.17
- Sergey Pavlov
- www.mql5.com
This article is a quick guide to MQL4 language functions, it will help you to migrate your programs from MQL4 to MQL5. For each MQL4 function (except trading functions) the description and MQL5 implementation are presented, it allows you to reduce the conversion time significantly. For convenience, the MQL4 functions are divided into groups, similar to MQL4 Reference.
mpr:
I've been using code in MT4 that waits for a new Bar to open before the rest of the code is executed. I've been trying to migrate this specific feature into my MT5 code, but without success. Specifically, I'm getting hung up on the Time[0] variable that is no longer in MT5. Can someone assist with this please!!?? Thank You!!!
Have a read of this . . . https://www.mql5.com/en/forum/10841/436688#comment_436688
I've been using code in MT4 that waits for a new Bar to open before the rest of the code is executed. I've been trying to migrate this specific feature into my MT5 code, but without success. Specifically, I'm getting hung up on the Time[0] variable that is no longer in MT5. Can someone assist with this please!!?? Thank You!!!

strange datetime assignment
- www.mql5.com
I tried to verify NewBar appearance with the following code from Samuels article "Step-By-Step Guide to writing an Expert Advisor in MQL5 for Beginners".
Thanks!!!

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