Counting loss and counting profit

 

I want that my EA count the consecutive win and the consecutive loss, becuase then i want to change the lots and stop loss/profit.

Like if i have 3 or more consecutive win, i want change the take profit and still in untile i reach the first stop

So if i have 2 or more consecutive loss i want to change the lots,

So how keep tracking of it?Because with account balance or accountequity i can't do it

 
The_Matrix wrote >>

I want that my EA count the consecutive win and the consecutive loss, becuase then i want to change the lots and stop loss/profit.

Like if i have 3 or more consecutive win, i want change the take profit and still in untile i reach the first stop

So if i have 2 or more consecutive loss i want to change the lots,

So how keep tracking of it?Because with account balance or accountequity i can't do it

Hi. this is a part of a code of some EA i've done. This should put U on the right track. U can stream linke this a lot, but I gave up on this specefic one.

//FAIL1
OrderSelect(OrdersHistoryTotal()-1, SELECT_BY_POS, MODE_HISTORY);
if(OrderProfit() < 0) fail1=true; else fail1=false;


//FAIL2
OrderSelect(OrdersHistoryTotal()-2, SELECT_BY_POS, MODE_HISTORY);
if(OrderProfit() < 0) fail2=true; else fail2=false;


if((!fail2)&&(!fail1))
{
LOT=MLOT;
//LOT=AccountBalance()/DEV;
if (LOT < 0.01) LOT=0.01;
CreateTextLable("label_object11","NO LOSS",20,"Times New Roman",LawnGreen,0,40,240);
}

 
Blooper1980:

Hi. this is a part of a code of some EA i've done. This should put U on the right track. U can stream linke this a lot, but I gave up on this specefic one.

//FAIL1
OrderSelect(OrdersHistoryTotal()-1, SELECT_BY_POS, MODE_HISTORY);
if(OrderProfit() < 0) fail1=true; else fail1=false;


//FAIL2
OrderSelect(OrdersHistoryTotal()-2, SELECT_BY_POS, MODE_HISTORY);
if(OrderProfit() < 0) fail2=true; else fail2=false;


if((!fail2)&&(!fail1))
{
LOT=MLOT;
//LOT=AccountBalance()/DEV;
if (LOT < 0.01) LOT=0.01;
CreateTextLable("label_object11","NO LOSS",20,"Times New Roman",LawnGreen,0,40,240);
}

Thanks

But this also in in the account i use multiple EA or made manual trading??

I try it

For 2 consecutive stop loss

if((fail2)&&(fail1))
{
Takeprofit=newtakeprofit;
}

Reason: