Does anyone know an easy way of converting an EA from 4 to 5 decimals?
Thanx
Thanx
Email Setup in MT4 (Gmail) The Easiest Way 28 replies
easiest and the most profitable way 12 replies
Easiest way to check correlation 0 replies
easiest way to get realtime fx feed data? 7 replies
The Easiest way to convert EA from Standard to ECN trading account 1 reply
DislikedI calculate a pips factor variable (pf) in the Init function and multiply any pips value by this. pf will be either 1 or 10.
This method has the advantage of being able to run on both 4 and 5 decimal place systems which some other schemes don't.
Declare these variables as static:
int sRange;
double pips, pf = 1.;
Put this code in the Init function:
// conversion factors for 4 and 5 digit systems.
pips = MarketInfo(Symbol(), MODE_TICKSIZE);
if (Digits < 4)
{
pf = (0.01/pips);
}
if (Digits > 3)
{
pf = (0.0001/pips);
}
sRange = SetupRange*pf;...Ignored