ive dragged it onto a chart, and see nothing
Hi!
I like the sound of your script, so I thought I'd give it a go.
I've downloaded the file, compiled it & added it into the relevant 'scripts' folder on my MT4 account. When I attempt to add it to a chart, I get "'lot_sizing' is not script and cannot be executed". What am I doing wrong?
Thanks
Hi!
I like the sound of your script, so I thought I'd give it a go.
I've downloaded the file, compiled it & added it into the relevant 'scripts' folder on my MT4 account. When I attempt to add it to a chart, I get "'lot_sizing' is not script and cannot be executed". What am I doing wrong?
Thanks
Hi,
It is nice to know that I'm not the only one trying to do just that.
If you don't mind
void OnStart(){ Alert(Lots(SL_pips,perc_to_loose)," Lot size for ",Symbol()," with ",SL_pips," SL pips and ",perc_to_loose,"% Risk "); Print("Lot size : ",Lots(30,perc_to_loose/100)); Print("[SL] in pips : ",SL_pips);
When you call the function Lots(), it will always calculate for 30 pips.
Have you try TICKVALUE?
I did and it cuts my code considerably. Mind-blown.

- book.mql4.com
Hi,
It is nice to know that I'm not the only one trying to do just that.
If you don't mind
When you call the function Lots(), it will always calculate for 30 pips.
Have you try TICKVALUE?
I did and it cuts my code considerably. Mind-blown.
Just modify the '30' to 'SL_pips', Thats a little oversight that I missed.
void OnStart(){ Alert(Lots(SL_pips,perc_to_loose)," Lot size for ",Symbol()," with ",SL_pips," SL pips and ",perc_to_loose,"% Risk "); Print("Lot size : ",Lots(SL_pips,perc_to_loose/100)); Print("[SL] in pips : ",SL_pips);But in the Alert it still shows the input from the user, so if you modify the pips to let's say 50, it will give you another result

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Lot sizing risk based and also converting the currency of the account:
Hi, so I just made a little code here that will help out a lot of coders that hate doing this (I count myself in it haha). It's made to calculate the lot size of a position based on the risk input and the account size+currency.
Author: Noe Combes Bardoll