Money Management - Dollars per Point

 
Currently developing a trend-following system to trade GBPUSD. I'm trying to mimic the Turtle System money management rules, which require the calculation of "Dollars Per Point" (i.e. dollar value of a pip). Has anyone tackled this in MQL? Here's a English example of the logic I'm trying to implement:

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.
 
"Is this the best way to implement in MQL? Doesn't seem to be testing well at all."

No.

Review the MarketInfo() function
 
Thanks.

DollarVolatility = MarketInfo(Symbol(), MODE_TICKVALUE)

is much cleaner.
 
and...
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.
 
Thirteen years plus after, a newbie in algo trading finds this helpfull!! Thank you!!
Reason: