This code is not reading orders that are open, i'm not sure why. thanks for any help...
this is the code that opens the orders, which comes after the sell code in the ea. it does work, as the ea has no issues opening.
so the problem is that he ea always reads the 'selectorder' as false, even if there is an open order, but i'm not sure why.
Inserted Code
Alert ("Checking for open short trend"); OrderSelect(ticket,SELECT_BY_TICKET); Alert (" error : ",GetLastError()); if (OrderSelect(ticket,SELECT_BY_TICKET) == false) { Alert("No open order"); } if (OrderSelect(ticket,SELECT_BY_TICKET) == true) { ...ea wont go past this point...
Inserted Code
... { ticket = OrderSend(Symbol(),OP_SELL,1,Bid,5,0,0,"opening short trend",12345,0,White); Alert ("opening short trend"); Alert ("short trend trend Error: ",GetLastError()); OrderSelect(ticket,SELECT_BY_TICKET); if (OrderSelect(ticket,SELECT_BY_TICKET) == true) { Alert ("selecting ordre to modify error: ",GetLastError()); OrderModify(ticket,OrderOpenPrice(),SStopLose,STakeProfit,0,Blue); Alert ("modify order error 1 : ",GetLastError()); } } ...
so the problem is that he ea always reads the 'selectorder' as false, even if there is an open order, but i'm not sure why.