I can’t understand why it won’t open the order.
2019.01.20 16:44:45.510 Core 01 2015.02.13 16:36:04 failed market buy 0.01 EURUSD sl: 1.14001 tp: 1.17311 [Invalid stops]
2019.01.20 16:44:45.510 Core 01 2015.02.13 16:36:04 Alert: The Buy order request could not be completed -error:4756
2019.01.20 16:44:45.510 Core 01 2015.02.13 16:36:04 price=1.140110 sl=1.140010 tp=1.173110 lots=0.010000 sprd=0.000140
At the same time, if the spread is less than 1.0 pips, it opens normally.
2019.01.20 17:00:53.865 Core 01 2014.01.31 15:52:42 deal #2969 sell 0.03 EURUSD.DUKAS at 1.34799 done (based on order #2969)
2019.01.20 17:00:53.865 Core 01 2014.01.31 15:52:42 deal performed [#2969 sell 0.03 EURUSD.DUKAS at 1.34799]
2019.01.20 17:00:53.865 Core 01 2014.01.31 15:52:42 order performed sell 0.03 at 1.34799 [#2969 sell 0.03 EURUSD.DUKAS at 1.34800]
2019.01.20 17:00:53.865 Core 01 2014.01.31 15:52:42 market buy 0.02 EURUSD.DUKAS sl: 1.34794 tp: 1.37204 (1.34799 / 1.34804 / 1.34799)
2019.01.20 17:00:53.865 Core 01 2014.01.31 15:52:42 deal #2970 buy 0.02 EURUSD.DUKAS at 1.34804 done (based on order #2970)
2019.01.20 17:00:53.865 Core 01 2014.01.31 15:52:42 deal performed [#2970 buy 0.02 EURUSD.DUKAS at 1.34804]
2019.01.20 17:00:53.865 Core 01 2014.01.31 15:52:42 order performed buy 0.02 at 1.34804 [#2970 buy 0.02 EURUSD.DUKAS at 1.34804]
2019.01.20 17:00:53.865 Core 01 2014.01.31 15:52:42 Alert: A Buy order has been successfully placed with Ticket#:2970!!
2019.01.20 17:00:53.865 Core 01 2014.01.31 15:52:42 104 price=1.348040 sl=1.347940 tp=1.372040 lots=0.020000 sprd=0.000050
This is the opening code
mrequest.action = TRADE_ACTION_DEAL; // immediate order execution
mrequest.price = NormalizeDouble(latest_price.ask,_Digits); // latest ask price
mrequest.sl = NormalizeDouble(latest_price.ask - STP*_Point,_Digits); // Stop Loss
mrequest.tp = NormalizeDouble(latest_price.ask + split[i]*100*_Point,_Digits); // Take Profit
mrequest.symbol = _Symbol; // currency pair
mrequest.volume = Lot*bet[i]; // number of lots to trade
mrequest.magic = EA_Magic; // Order Magic Number
mrequest.type = ORDER_TYPE_BUY; // Buy Order
mrequest.type_filling = ORDER_FILLING_FOK; // Order execution type
mrequest.deviation=100; // Deviation from current price
Stop level 0, tried different brokers, different quotes.
krungsri
Made the conclusion of the bid. Yes, sometimes it happens, probably at night.
Thank you the question is gone 😉
swan
Does not open if the SL-stoporder sell is higher than the current bid. I.e., the stop loss should be executed immediately upon opening.
fxsaber
Write a short playback code and the data to run it in the Tester.