LH
Just write the <last used> lot size to a file
If this size is 2.5, start again at 0.2
FWIW
-BB-
can you put what you say in code please?
lot increase by every new win i want it to repeat every 25 win but in this code it only do the first 25 win and then stop
i want every 25 win it start again from the beginning and keep repeating that
help please
i want every 25 win it start again from the beginning and keep repeating that
help please
double LotsOptimized()
{
double lot=0.1;
int orders=HistoryTotal(); // history orders total
int losses=0,win=0; // number of losses orders without a break
//---- select lot size
//---- calcuulate number of losses orders without a break
if(DecreaseFactor>0)
{
for(int i=orders-1;i>=0;i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==false) { Print("Error in history!"); break; }
if(OrderSymbol()!=Symbol() || OrderType()>OP_SELL) continue;
//----
if(OrderProfit()>0) win++;
if(OrderProfit()<0) losses++;
}
}
//---- return lot size
if(win==1) lot=0.2;
if(win==2) lot=0.3;
if(win==3) lot=0.4;
if(win==4) lot=0.5;
if(win==5) lot=0.6;
if(win==6) lot=0.7;
if(win==7) lot=0.8;
if(win==8) lot=0.9;
if(win==9) lot=1.0;
if(win==10) lot=1.1;
if(win==11) lot=1.2;
if(win==12) lot=1.3;
if(win==13) lot=1.4;
if(win==14) lot=1.5;
if(win==15) lot=1.6;
if(win==16) lot=1.7;
if(win==17) lot=1.8;
if(win==18) lot=1.9;
if(win==19) lot=2.0;
if(win==20) lot=2.1;
if(win==21) lot=2.2;
if(win==22) lot=2.3;
if(win==23) lot=2.4;
if(win==24) lot=2.5;
return(lot);
}
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
i code it with best idea i got but i dont know what is wrong im not good in programming
please help and if you have better idea too