The function returns the lot size, which is calculated based on the stop loss size and the risk specified in the variable.
I don't know what this code is calculating but that's not the correct lot size. You should test your code before publishing it.
you can try this
https://www.mql5.com/en/code/13593
By the way this one isn't better
Did you bother to test your code guys ?
Where are arguments?
Becouse I have
Balance 1000 euro AUDCAD
risk=10%
SL=504 points
resoult of function is 0.280375...
Lucky. Try it on GOLD (XAGUSD) or other broker with different minimum lot size.
double lose_on_stop_lose=SL_Vasyl*(MarketInfo(Symbol(),MODE_TICKVALUE)/100); double propotion=(balance/100*Lot_sl_risk)/lose_on_stop_lose; double Loto_=MarketInfo(Symbol(),MODE_MINLOT)*propotion;
It works only when minimum lot is 0.01. Minimum lot size has nothing to do with this calculation.
It works only when a point = a tick. It's not the case for a lot of symbols.
Lucky. Try it on GOLD (XAGUSD) or other broker with different minimum lot size.
It works only when minimum lot is 0.01. Minimum lot size has nothing to do with this calculation.
It works only when a point = a tick. It's not the case for a lot of symbols.
I have 0.01 min lot in gold too.
Name broker where I can test.
Thet is better?
double lose_on_stop_lose=SL*(MarketInfo(Symbol(),MODE_TICKVALUE)/(1/MarketInfo(Symbol(),MODE_MINLOT)));
- 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-SL propotion:
Author: Vasyl Nosal