after the stop loss is set to value other than zero the bot does not buy and sell

 
      stoploss = ((LastSARValue1 - LastSARValue) / 4) + PriceArray[0].low;
           
      myrequest.type = ORDER_TYPE_BUY;
      myrequest.action = TRADE_ACTION_DEAL;
      myrequest.sl = 0;
      myrequest.tp = stoploss;
      myrequest.symbol = _Symbol;
      myrequest.volume = 0.1;
      myrequest.price = Ask;
      myrequest.type_filling = ORDER_FILLING_FOK;
      OrderSend (myrequest,myresult);


When myrequest.tp = 0; the bot buys and sells, when the tp is " = 1;" any other number than zero the bot does not buy and sell.





Files:
 
DarthRickSanchez1:

If the EA has been compiled but ist not doing what it should, the debugger is the tool of choice. Check the variable values that lead to the opening and/or non-opening of positions.

Reason: