you need to avoid placing orders between hours 22:00 and 02:00
spreads very high in that times
or you may add some codes include max allowed spread but it is less reliable more than time filter
I am doing that with my expert
- 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 sell order's TP/SL (or Buy Stop's/Buy Limit's entry) will be triggered when the Ask / OrderClosePrice
reaches it. To trigger at a specific Bid price, add the average spread.
MODE_SPREAD (Paul) - MQL4 programming forum - Page 3 #25 - The charts show Bid prices only. Turn on the Ask
line to see how big the spread is (Tools → Options (control+O) → charts → Show ask line.)
Most brokers with variable spread widen considerably at end of day (5 PM ET) ± 30 minutes. My GBPJPY (OANDA) shows average spread = 26 points, but average maximum spread = 134.
Hi guys!
Thank you for the replies. But the point was not that. I know that when I send a market order it will be executed at bid (sell orders) or ask (buy orders) prices, and maybe some slippage according to book volume.
The point here is that even after my buy order being executed, the high price of the candle did not change at all, as it was suposed to do. Please, take a look at the picture attached at my previous message. That picture was took after my order execution, not before.
Further, since EAs are optimized using past historical data provided by the broker, it is expected that such historical data to contain all order executions, at least from that broker. Otherwise any optimized EA may fail miserably using the trained parameter set.
Hi guys!
Thank you for the replies. But the point was not that. I know that when I send a market order it will be executed at bid (sell orders) or ask (buy orders) prices, and maybe some slippage according to book volume.
The point here is that even after my buy order being executed, the high price of the candle did not change at all, as it was suposed to do. Please, take a look at the picture attached at my previous message. That picture was took after my order execution, not before.
Further, since EAs are optimized using past historical data provided by the broker, it is expected that such historical data to contain all order executions, at least from that broker. Otherwise any optimized EA may fail miserably using the trained parameter set.
Your Buy will have been executed at the Ask price. Your chart and the candle only show the Bid price so your candle will not update to reflect the price of your order, because the Ask is not part of the candle prices.
Your Buy will have been executed at the Ask price. Your chart and the candle only show the Bid price so your candle will not update to reflect the price of your order, because the Ask is not part of the candle prices.
Oh God! You sure? That was not my understanding (until today) about what candles should represent. If historical candles only show executions at bid prices it is a real problem for training EAs, since in MT5 OHLC historical rates are used to simulate ticks in the "most accurate" testing mode.
Just to exemplify what I am saying, I attached a picture below showing the historical data I downloaded from the broker using the CopyRates function. It is showing my order execution as well as candles. Historical data are the same we see at MT5 chart, and it also does not include my executed order price.
So, considering this and the above comments, even in optimizing EAs, we should avoid time intervals with supposed low spreads. I say "supposed" just because during testing BID and ASK prices are generated from OHLC prices, and they do not correspond to reality, and any spread verification is useless.
- www.mql5.com
- 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 everyone!
Today at ICmarkets we sent few orders at 00:10 for market execution, in a real account. The problem is that the executed price is way out of the range of the candle. That means, it is supposed that a candle range should contain all executed prices during its time interval. Have you had a similar problem?
Since my strategy uses historical data for walkforward optimization, such historical data should replicate past market operations.
I am attaching one example, with GBPUSD.
Thank you very much for any clue on how do deal with that.
Best regards!