- Don't post pictures of code, they are too hard to read. Please edit
your (original) post and use the CODE button (Alt-S)!
(For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Messages Editor - Frédéric LEBRE: that target price can be reached on current candle with mt5 but it waits next candle. I do not understand why.You are using the tester. Unless you have history for all lower TFs for MT4 and no "unmatched data errors," the generated price movement might be off compared to MT5. MT5 only uses the M1 but that still means market might not have reached your TP until the second candle.
- Was the spread used the same? You buy at the Ask and sell at the Bid.
- Your buy order's TP/SL (or Sell Stop's/Sell Limit's entry) are triggered when the Bid / OrderClosePrice
reaches it. Using the Ask±n, makes your SL
shorter and your TP longer, by the spread. Don't you want the specified amount used in either direction?
- Your buy order's TP/SL (or Sell Stop's/Sell Limit's entry) are triggered when the Bid / OrderClosePrice
reaches it. Using the Ask±n, makes your SL
shorter and your TP longer, by the spread. Don't you want the specified amount used in either direction?
- Don't post pictures of code, they are too hard to read. Please edit
your (original) post and use the CODE button (Alt-S)!
(For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Messages Editor - You are using the tester. Unless you have history for all lower TFs for MT4 and no "unmatched data errors," the generated price movement might be off compared to MT5. MT5 only uses the M1 but that still means market might not have reached your TP until the second candle.
- Was the spread used the same? You buy at the Ask and sell at the Bid.
- Your buy order's TP/SL (or Sell Stop's/Sell Limit's entry) are triggered when the Bid / OrderClosePrice
reaches it. Using the Ask±n, makes your SL
shorter and your TP longer, by the spread. Don't you want the specified amount used in either direction?
- Your buy order's TP/SL (or Sell Stop's/Sell Limit's entry) are triggered when the Bid / OrderClosePrice
reaches it. Using the Ask±n, makes your SL
shorter and your TP longer, by the spread. Don't you want the specified amount used in either direction?
Hi, sorry for code snapshots, i did not know.
in mt4 i use tick data with set spread to 10. in mt5 i imported csv tick data from same source with 10 between bid and ask.
SO i have same bid and same spread.
if you see attached files, on picture 6 you see that price can be reached on MT5 current candle.
I have finally found. on my red candle, the order opens between the close and the low. If the target is lower than the close, it closes on the current candle and if the target is located higher than the close, it closes on the next candle.
As the candle is red, it considers that it may not touch the target.
Therefore this is not of tick by tick backtest, but only OHLC.
Is it possible to make the true tick by tick with MT5 as with MT4?
- 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,
please, could you help me ?
i wrote a smple EA : if ( open - Ask ) > x then buy at market, stop and target 10 pts.
on mt4, target is reached on current candle, and with mt5 target is reached on next candle.
On attached file, you can see (history tick snapshot) that target price can be reached on current candle with mt5 but it waits next candle.
I do not understand why.
Regards,