Thanks.
DollarVolatility = MarketInfo(Symbol(), MODE_TICKVALUE)
is much cleaner.
DollarVolatility = MarketInfo(Symbol(), MODE_TICKVALUE)
is much cleaner.
and...
positionPipValue = MarketInfo(Symbol(), MODE_TICKVALUE) * Lots;
positionPipValue = MarketInfo(Symbol(), MODE_TICKVALUE) * Lots;
In Percent Volatility money management models, the lot size is an output derived from the division of Account Risk Equity by Market Dollar Volatility:
Account_Equity = AccountEquity();
VolatilityEquity = Account_Equity * VolatilityPercent;
DollarVolatility = MarketInfo(Symbol(), MODE_TICKVALUE);
Units = VolatilityEquity / ((VolATR*10000) * DollarVolatility);
double Lots = NormalizeDouble( Units, 1);
This code is still a little rough, but I think you get the idea.
Account_Equity = AccountEquity();
VolatilityEquity = Account_Equity * VolatilityPercent;
DollarVolatility = MarketInfo(Symbol(), MODE_TICKVALUE);
Units = VolatilityEquity / ((VolATR*10000) * DollarVolatility);
double Lots = NormalizeDouble( Units, 1);
This code is still a little rough, but I think you get the idea.
Thirteen years plus after, a newbie in algo trading finds this helpfull!! Thank you!!
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
GBP/USD at an exchange rate or 1.8040
(.0001 / 1.8040) x GBP 100,000 = 5.54 x 1.8040 = 9.99416 rounded up will be $10 per pip.
Code in my Expert Advisor:
DollarVolatility = ((Point / Ask) * 100000 * Ask);
Is this the best way to implement in MQL? Doesn't seem to be testing well at all.
Thanks.