예제 #1
0
 public static double GetPipsFromRelative(this ProtoOASymbol symbol, long relative) => Math.Round((relative / 100000.0) / symbol.GetPipSize(), symbol.Digits - symbol.PipPosition);
예제 #2
0
 public static double GetPipValue(this ProtoOASymbol symbol, double tickValue) => tickValue * (symbol.GetPipSize() / symbol.GetTickSize());
예제 #3
0
        public static double SubtractPipsFromPrice(this ProtoOASymbol symbol, double price, double pips)
        {
            var pipsInPrice = pips * symbol.GetPipSize();

            return(Math.Round(price - pipsInPrice, symbol.Digits));
        }
예제 #4
0
        public static long GetRelativeFromPips(this ProtoOASymbol symbol, double pips)
        {
            var pipsInPrice = pips * symbol.GetPipSize();

            return((long)Math.Round(pipsInPrice * 100000, symbol.Digits));
        }
예제 #5
0
        public static double AddPipsToPrice(this ProtoOASymbol symbol, double price, double pips)
        {
            var pipsInPrice = pips * symbol.GetPipSize();

            return(Math.Round(price + pipsInPrice, symbol.Digits));
        }