Documentation
Applications
Last updated on 11. 9. 2020 by Tomas Vanek
The strategy tried to place stop/limit order at incorrect price
If you are running or backtesting strategie from StrategyQuant X in Metatrader 5, you might can see this info message in your logs:
020.08.26 00:00:01.102 Strategy 1.4.130 (MYMU20,H1) 2020.08.25 22:00 No pending orders of that type
2020.08.26 00:00:01.118 Strategy 1.4.130 (MYMU20,H1) —VERBOSE— 2020.08.25 22:00 Based on its logic, the strategy tried to place stop/limit order at incorrect price. Market price: 28220.00000000, min. price allowed: 28220.00000000, stop/limit order price: 27966.00000000
Is this an error? No. Here is explanation:
It means the entry conditions of the strategy were met and normally the strategy would open a new order. But in this case the calculated order price was out of the market and the order was skipped because of that.
Was this article helpful? The article was useful The article was not useful
Hi. Thanks…but please let us know how to solve this problem? Thanks…
As mentioned in the article, this is not a problem or error per se. Only information about why an order could not be placed
Hi. Thanks…but unfortunately this is the problem because the user cannot run the back test in metatrader or etc. Is not? please let us know how to solve this problem in order to implement the back test. Thanks…
Even if you see this “warning” the EA should trade normally. If there are no trade please send us an email with the strategy to support@Kevin.com and we can check it
Please always send not only EA code but also the Strategyquant file (.sqx extension)
Hi, I have the same message. Based on the answers provided, I understand its not an error.
My question is this. Was the trade also skipped during strategy creation and backtests from SQ?
I am trying to figure out if my backtest results may differ from actual trading because of the skipped trades?
I guess, MonteCarlo would apply the same testing environment so no worries except for expectations on # of trades…
Yes, the trades are also skipped in SQX to match MetaTrader. In SQX you just won’t see the message you see in MT4
hi,
Yes, it is only an information message
Hey, that’s a real error.. as the price is calculated wrongly on MT5 and hence, no placing the order because is below the limit allowed. The strategy is successful on SQW but not when back testing on MT5.. Any solution found???
Thanks.
In SQX such order will be rejected as well but only if the backtesting precision is high enough (tick data ideally)
Can somebody please explain WHY “ the calculated order price was out of the market“? Can this be prevented? I have several portfolio EA’s (Different strategies for multiple symbols) that throw this notice everytime a trade should be placed. Some insight would be nice.
I inserted the mql code into AI and found out why, When the EA tries to place an order, the order price is checked to see if the broker would allow the order price. When it doesn’t, for example it tries to place a stop order with a price within 1 pip of the market price and the minimal distance to market price is 1 pip, then you will see this notification, since the broker would not accept this order. This is what they call “out of the market”. It is not an error because all the calculations and functions… Read more »
there should be an option to filter out strats that rely on perfect price. In my last construction I only got starts that would generate 0 trades in MT5 back tester cause all orders would only create this “non-error”
I guess that the Backtest logic of SQX is mathematical logic, which means that the pending order has a price different from the market price, regardless of the logic of the Stop order or the Limit order, while the logic of placing a pending order in MT5 must comply with the logic of the Stop/Limit order (for example, the Buy Stop price must be greater than the current price). Therefore, when implementing the actual transaction, the EA of SQX on MT5 has a logical conflict, leading to the suggested price of the pending order being invalid with the Stop/Limit. First… Read more »
Have someone found a solution for this – or even better how to avoid sqx to develop a strategy that lead to this error when trading or backtesting on MT5?
Use high precision backtest in SQX. That mean real tick data exported from brokers’ platforms. Only then orders would be rejected the same way in SQX as they are being rejected in MT
I don’t know why SQX support team always try to say that an error is not an error, I have a many ticket that they simply say this is not an error or it is the way it is. This is an error for sure, in the backtest there are a lot of more trades than in real live account, the so backtest data is not accurate as it suppose to be.
I changed preferredFillingType = ORDER_FILLING_FOK to ORDER_FILLING_BOC and it increased number of trades.
Hola chicos, también viví esto y me frustre mucho… pero, para ser honestos y curarnos en salud, cuando creen estrategias, en minima distancia no coloque 1 (eso dice el activo del GBPJPY de mi broker), sino 2, es decir, un pip más de lo que indica el activo del broker que tenga, de esta forma no les saldrá ese mensaje de error… de esa forma lo corregí. sin embargo, las estrategias que ya crearon con minima distancia 1 o que les sale ese mensaje en mt5 no tienen arreglo.. por lo que les sugiero que mejor la desechen y creen… Read more »
To make this “issue” happen less frequently, i have set the strategy parameter “UseSQPipSize” to True instead of False (check MT5 Strategy Inputs towards the end). Now the equity curve in the MT5 backtest (with Every Tick based on Real Ticks) matches the equity of SQ almost exactly. MUST DO Prerequisites: You need to Create a Broker Profile for your Broker, and specify the correct Broker Timezone You need to export from MT5 the Broker Sessions and Instruments (with correct commisions per LOT) You need to import the Sessions and Instruments of your Broker into the Broker profile you created… Read more »