/*[[ Name := delete all trades Author := Copyright © 2005, MetaQuotes Software Corp. Link := http://www.metaquotes.net/ Lots := 1.00 Stop Loss := 0 Take Profit := 0 Trailing Stop := 0 ]]*/ Define: deleteSL(1), deleteSS(1), deleteBL(1), deleteBS(1), deleteorders(1); var: i(0); if deleteorders = 1 then { for i = 1 to TotalTrades Begin { if ord(i,VAL_SYMBOL) = symbol and ord(i,VAL_TYPE) = OP_BUY then CloseOrder(ord(i,VAL_TICKET),ord(i,VAL_LOTS),bid,0,white); }; End; }; if deleteorders = 1 then { for i = 1 to TotalTrades Begin { if ord(i,VAL_SYMBOL) = symbol and ord(i,VAL_TYPE) = OP_SELL then CloseOrder(ord(i,VAL_TICKET),ord(i,VAL_LOTS),ask,0,white); }; End; }; if deleteSL = 1 then { for i = 1 to TotalTrades Begin { if ord(i,VAL_SYMBOL) = symbol and ord(i,VAL_TYPE) = OP_SELLLIMIT then DeleteOrder(ord(i,VAL_TICKET),white); }; End; }; if deleteSS = 1 then { for i = 1 to TotalTrades Begin { if ord(i,VAL_SYMBOL) = symbol and ord(i,VAL_TYPE) = OP_SELLSTOP then DeleteOrder(ord(i,VAL_TICKET),white); }; End; }; if deleteBL = 1 then { for i = 1 to TotalTrades Begin { if ord(i,VAL_SYMBOL) = symbol and ord(i,VAL_TYPE) = OP_BUYLIMIT then DeleteOrder(ord(i,VAL_TICKET),white); }; End; }; if deleteBS = 1 then { for i = 1 to TotalTrades Begin { if ord(i,VAL_SYMBOL) = symbol and ord(i,VAL_TYPE) = OP_BUYSTOP then DeleteOrder(ord(i,VAL_TICKET),white); }; End; };