No you can't. You can never know which tick will make the high. And you may receive any number of ticks live.
After the close, you now know the high/low/close. But the market has moved on. You can't trade those prices. That is information only,
Doing what?
Use the tick data of the M1 bar that just closed instead of the current bar.
For example, if the previous bar data allows for a trade it acts like a delayed signal.
Use the tick data of the M1 bar that just closed instead of the current bar.
For example, if the previous bar data allows for a trade it acts like a delayed signal.
If im following your logic correctly, you want to have your EA check your conditions immédiately after candle close? Since you say you dont need to trade the exact price or know entries. It wouldn't be too late, as this is mostly just your own preference. There are many ways to trade, right? :) Whatever works for you.
Currently im using a very simple code to run (part of) my EA as soon as a new candle opens (so it uses info on the candle that just closed): if(iVolume(NULL,0,0) == 1) { Insert code here }
Mind you, this is MT4 so the MT5 might look a little different. Also, you have to pay mind that the indicators that you use all have to be set to shift 1, since when you use shift 0 they will be functioning on the candle that just opened, with one tick of volume. That wouldnt be good :P
For a new bar test, Bars is unreliable (a refresh/reconnect can change number of bars on chart), volume is unreliable (miss ticks), Price is unreliable (duplicate prices and The == operand. - MQL4 programming forum.) Always use time.
MT4: New candle - MQL4 programming forum #3 (2014)
MT5: Accessing variables - MQL4 programming forum #3 (2022)
I disagree with making a new bar function, because it can only be called once per tick (second call returns false). A variable can be tested multiple times.
Running EA once at the start of each bar - MQL4 programming forum (2011)
Hi William,
Thanks for the info! You have a good point in volume not being fully dependably. Im going to take your wisdom and review it thoroughly.
For a new bar test, Bars is unreliable (a refresh/reconnect can change number of bars on chart), volume is unreliable (miss ticks), Price is unreliable (duplicate prices and The == operand. - MQL4 programming forum.) Always use time.
MT4: New candle - MQL4 programming forum #3 (2014)
MT5: Accessing variables - MQL4 programming forum #3 (2022)
I disagree with making a new bar function, because it can only be called once per tick (second call returns false). A variable can be tested multiple times.
Running EA once at the start of each bar - MQL4 programming forum (2011)
Hi William,
Thanks for the info! You have a good point in volume not being fully dependably. Im going to take your wisdom and review it thoroughly.
Thanks for your insight! You raise a valid point about volume not being fully reliable. I’ll definitely take your advice into consideration and review everything thoroughly. Appreciate it!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
It seems that the best method is controlling bar opening prices. You program the EA in a way that it processes only bar open tick so this will reflect on a live chart the backtests results when using that mode.
You can also program the EA to receive only 4 ticks (like it does on the 1min OHLC mode), but he says it also won´t quite be the same because on the tester metatrader already knows the OHLC 1min data, on the live chart obviously you can´t know that because the bar is forming.
Only after the close we get that data, but then he says it´s "too late". How 1min delay is too late? Can´t we just use the last 1min bar tick data? If you are not coding a super precise scalping EA, I don´t see what´s the problem in doing that.
Here is the video: https://www.youtube.com/watch?v=q8WUNHzl_RQ
Wouldn´t doing this getting us closer to the 1min OHLC mode resuts?