public static double GetPipsFromRelative(this ProtoOASymbol symbol, long relative) => Math.Round((relative / 100000.0) / symbol.GetPipSize(), symbol.Digits - symbol.PipPosition);
public static double GetPipValue(this ProtoOASymbol symbol, double tickValue) => tickValue * (symbol.GetPipSize() / symbol.GetTickSize());
public static double SubtractPipsFromPrice(this ProtoOASymbol symbol, double price, double pips) { var pipsInPrice = pips * symbol.GetPipSize(); return(Math.Round(price - pipsInPrice, symbol.Digits)); }
public static long GetRelativeFromPips(this ProtoOASymbol symbol, double pips) { var pipsInPrice = pips * symbol.GetPipSize(); return((long)Math.Round(pipsInPrice * 100000, symbol.Digits)); }
public static double AddPipsToPrice(this ProtoOASymbol symbol, double price, double pips) { var pipsInPrice = pips * symbol.GetPipSize(); return(Math.Round(price + pipsInPrice, symbol.Digits)); }