money managment

To add comments, please log in or register
loid
10
loid  
i want to icrease lot with 0.1 with every new order and every 25 order it start all over again

i code it with best idea i got but i dont know what is wrong im not good in programming

double LotsOptimized()
{
double lot=0.1;
double orders[]=HistoryTotal(); // history orders total


//---- return lot size
if(orders=={1,16,51,76,101,116,151,176,201,215,251,276,301,316,351,376,401}) lot=0.2;
if(orders=={2,17,52,77,102,117,152,177,202,217,252,277,302,317,352,377,402}) lot=0.3;
if(orders=={3,18,53,78,103,118,153,178,203,218,253,278,303,318,353,378,403}) lot=0.4;
if(orders=={4,19,54,79,104,119,154,179,204,219,254,279,304,319,354,379,404}) lot=0.5;
if(orders=={5,20,55,80,105,120,155,180,205,220,255,280,305,320,355,380,405}) lot=0.6;
if(orders=={6,21,56,81,106,121,156,181,106,221,256,281,306,321,356,381,406}) lot=0.7;
if(orders=={7,22,57,82,107,122,157,182,107,222,257,282,307,322,357,382,407}) lot=0.8;
if(orders==8) lot=0.9;
if(orders==9) lot=1.0;
if(orders==10) lot=1.1;
if(orders==11) lot=1.2;
if(orders==12) lot=1.3;
if(orders==13) lot=1.4;
if(orders==14) lot=1.5;
if(orders==15) lot=1.6;
if(orders==16) lot=1.7;
if(orders==17) lot=1.8;
if(orders==18) lot=1.9;
if(orders==19) lot=2.0;
if(orders==20) lot=2.1;
if(orders==21) lot=2.2;
if(orders==22) lot=2.3;
if(orders==23) lot=2.4;
if(orders==24) lot=2.5;
return(lot);
}

please help and if you have better idea too
Brian Dee - Random Trader
1758
Brian Dee - Random Trader  

LH
Just write the <last used> lot size to a file
If this size is 2.5, start again at 0.2
FWIW
-BB-

loid
10
loid  
can you put what you say in code please?
loid
10
loid  
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


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);
}
To add comments, please log in or register