every time I test my code, the results look like this (see picture). The prices used by the OrderSend / OrderClose function are wrong. As you can see the expert does not Open or Close many Orders at the current market price but uses a price far above it.
Does any of you know how to solve this? Do you think the problem is in my price data (I use the usual data by metatrader) or is in the code? I don't see that there is something wrong with my OrderSend() oder OrderClose()
if (SignalSHORT == true && OrdersTotal() == 0)
TicketSHORT = OrderSend(Symbol(),OP_SELL,1,Bid,1,0,0,"SELL",16384,0,Red);
PositionSHORT = true;
if (CloseSHORT == True && OrderSelect(TicketSHORT,SELECT_BY_TICKET) == true)
PositionSHORT = False;