Houston, I have a problem!

To add comments, please log in or register
Dave77
168
Dave77  

This coding was to eliminate only pending buy and sell stop orders. It unfortunately is deleting both the pending buy and sell stop orders, but also the orders that are active and in play. How can I change this to only eliminate the pending and not the active buy and sell stops that are in play? Your ideas will be greatly appreciated.

Dave 77, TGIF

Houston, TX

For cnt=1 to TotalTrades

{

mode=OrderValue(cnt,VAL_TYPE);

If mode>OP_SELL then

{

If (Minute>58)then // Delete pending Sell Stops.

{

DeleteOrder(OrderValue(cnt,VAL_TICKET),Cyan);

Exit;

};

};

If mode>OP_BUY then

{

If (Minute>58)then // Delete pending Buy Stops.

{

DeleteOrder(OrderValue(cnt,VAL_TICKET),Cyan);

Exit;

};

};

To add comments, please log in or register