incrementing lotsize

 

i have the following code right now, and i want to increase the lotsize every 1000 dolllar:

for the variables:

extern bool increment=true;
extern double Incrementlevel = 1000;
extern double BaseLot = 0.1;
and in the start:

if (increment)
{
int lotmultiple = AccountBalance()/increment;
lots = BaseLot*lotmultiple;
}

but when i run a backtest with 10000 (ten thousand) dollar, and i print the lotmultiple, it still says 10000, while it should be 10 (10000 / 1000).
What did i miss here?

 
ido370:

i have the following code right now, and i want to increase the lotsize every 1000 dolllar:

for the variables:

and in the start:

but when i run a backtest with 10000 (ten thousand) dollar, and i print the lotmultiple, it still says 10000, while it should be 10 (10000 / 1000).
What did i miss here?


How can you do AccountBalance()/increment check your DATA TYPES !!!!!
 
deVries:

How can you do AccountBalance()/increment check your DATA TYPES !!!!!


oh man :( Changed the name later, and forgot to change the other part too... duhh :)

thanks for pointing it out

 

Interestingly, the compiler type-cast boolean vrb 'increment' to int value 1, do the division, and returns result.

Seems like boolean type vrb CAN be operated on...? first time seeing this.

[Deleted]  

dears,

can someone send me the link to download the metaEditor 4?

thank you.

 
It's part of every download. Press the yellow diamond button or F5