double norm=NormalizeDouble(your_value,1)
int firstnum=(norm-MathFloor(your_value))*10;
see also our library stdlib.mq4, DoubleToStrMorePrecision function
int firstnum=(norm-MathFloor(your_value))*10;
see also our library stdlib.mq4, DoubleToStrMorePrecision function
Thanks Slawa..
fwiw mt4 is working great at my end keep up the good work :)
fwiw mt4 is working great at my end keep up the good work :)
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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 am trying to calculate a formula that will allow 5% of account equity to be used as lots size.
So on a 10k account it would set a lot size of 0.5 lots, 50k acc would be 2.5 lots etc......
This is the formula.
Levv = MathAbs((AccountEquity()*Perc/100/100)/10);
Perc is declared as an exernal double.
I need to round this down to 1 decimal place so mt4 will acept the order.
I have tried mathround() but it will round it to 1 lot.
Thanks & GT......