How to adjust lot size according to equity ratioon MT5 EA?
any suggestions please?
Yes.By Loss not by margin :
by ration you mean a % of equity i gather . (like 0.5 means half the equity)
First ,you need to calculate what the tick size cost is for your asset per one lot .
MT5 provides this in SymbolInfoDouble(_Symbol,SYMBOL_TRADE_TICK_VALUE);
Call this TickValueForOneLot (TVOL)
Then ,your strategy has an SL (that it indicates must be placed at a level) ,and you have that SL size in points/ticks.
So ,essentially you want to lose a % within SL points .
Calculate the amount willing to risk ToRisk = equity * ration
Divide it by the SL points (including spread)
and you get the desired tick value (per point)
Divide DesiredTickValue by TVOL and you get your Lot size
Make sure lot size is within the rules of the traded asset. (min , max , step)
Yes.By Loss not by margin :
by ration you mean a % of equity i gather . (like 0.5 means half the equity)
First ,you need to calculate what the tick size cost is for your asset per one lot .
MT5 provides this in SymbolInfoDouble(_Symbol,SYMBOL_TRADE_TICK_VALUE);
Call this TickValueForOneLot (TVOL)
Then ,your strategy has an SL (that it indicates must be placed at a level) ,and you have that SL size in points/ticks.
So ,essentially you want to lose a % within SL points .
Calculate the amount willing to risk ToRisk = equity * ration
Divide it by the SL points (including spread)
and you get the desired tick value (per point)
Divide DesiredTickValue by TVOL and you get your Lot size
Make sure lot size is within the rules of the traded asset. (min , max , step)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
How to adjust lot size according to equity ratioon MT5 EA?
any suggestions please?