Use martingale until profit is not less then 1000
if(UseMartingleHistoryProfit(MagicNumber2)lt;0)Lot s=NextLot(MagicNumber2);elseLots=LotSize;(BUY CONDITION. .)
AND
//==========
dual HistoryProfit(int magic)
dual hp=0;
for(int I=0;ilt;=OrdersHistoryTotal();I )
if(OrderSelect(I,SELECT_BY_POS,MODE_HISTORY))
if(OrderSymbol()==Symbol()OrderMagicNumber()==magi c)
hp=OrderProfit();
return(hp);
dual NextLot(int magic)
double lot=0;
for(int I=0;ilt;=OrdersHistoryTotal();I )
if(OrderSelect(I,SELECT_BY_POS,MODE_HISTORY))
if(OrderSymbol()==Symbol()OrderMagicNumber()==magi c)
lot=OrderLots()*2;
return(lot);