invalid trade request New comment Essam Daoud 2018.09.29 10:25 Hi This mql5 code produced error 10013 "invalid request" which I don't know why, Could some one please help? Thank you MqlTradeRequest tradeRequest; MqlTradeResult tradeResult; int factore = StringFind(Symbol(), "JPY", 0) >= 0 ? 100 : 10000; double _Ask = SymbolInfoDouble(_Symbol, SYMBOL_ASK); double takeProfitPoints = 22 / factore; double stopLossPoints = 99 / factore; double takeProfitPrice = NormalizeDouble(_Ask - takeProfitPoints, _Digits); double stopLossPrice = NormalizeDouble(_Ask + stopLossPoints, _Digits); double lots = StringToDouble(result[2]); tradeRequest.action = TRADE_ACTION_PENDING; tradeRequest.symbol = _Symbol; tradeRequest.volume = 0.01; tradeRequest.price = SymbolInfoDouble(_Symbol, SYMBOL_BID); tradeRequest.sl = stopLossPrice; tradeRequest.tp = takeProfitPrice; tradeRequest.deviation = 2; tradeRequest.type = ORDER_TYPE_SELL_LIMIT; tradeRequest.type_filling = ORDER_FILLING_FOK; bool success = OrderSend(tradeRequest,tradeResult); // GIVES FALSE Print(tradeResult.retcode); // GIVES 10013 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Any idea why this code does not work? Array Invalid Index Value Invalid Pointer Access when calling a class method fxsaber 2018.09.29 20:31 #1 MqlTradeRequest tradeRequest = {0}; New comment
Hi
This mql5 code produced error 10013 "invalid request" which I don't know why, Could some one please help?
Thank you