Price Helper
This class is helpful when you need to calculate a conversion coefficient from one currency to another. It does not connect to the MT4 server — all calculations happen locally.
This class is helpful when you need to calculate a conversion coefficient from one currency to another. It does not connect to the MT4 server — all calculations happen locally.
The PriceHelper class lives in the CPlugin.PlatformWrapper.MetaTrader4.Utilities namespace.
Get conversion coefficient
For example, suppose you need to know the coefficient to convert from GBP to XAU.
// instantiate a variable of class PriceHelper
var ph = new PriceHelper();
// feed it all the prices you need
ph.UpdatePrices("GBPUSD", 1.60, 1.61);
ph.UpdatePrices("XAUUSD", 1300, 1301);
// etc.
// get the coefficient
var pc = ph.GetPriceCoeffInCurrency("GBP", "XAU");
Get price of a single pip
To get the price of one pip, use the GetPriceOnePipsInCurrency function.
For example:
// instantiate a variable of class PriceHelper
var ph = new PriceHelper();
// feed it all the prices you need
ph.UpdatePrices("GBPUSD", 1.60, 1.61);
// etc.
// get the pip price in USD when you trade GBPUSD
var pop = ph.GetPriceOnePipsInCurrency("GBPUSD", "USD");

