Пример #1
0
        public BarInfo Double2Int(BarInfoView bar)
        {
            if (bar == null)
                return null;

            BarInfo field = new BarInfo();
            
            field.Open = Codec.PriceToTick(bar.Open);
            field.High = Codec.PriceToTick(bar.High);
            field.Low = Codec.PriceToTick(bar.Low);
            field.Close = Codec.PriceToTick(bar.Close);
            field.BarSize = bar.BarSize;

            return field;
        }
Пример #2
0
        public BarInfoView Int2Double(BarInfo bar)
        {
            if (bar == null)
                return null;

            BarInfoView field = new BarInfoView();
            
            field.Open = Codec.TickToPrice(bar.Open);
            field.High = Codec.TickToPrice(bar.High);
            field.Low = Codec.TickToPrice(bar.Low);
            field.Close = Codec.TickToPrice(bar.Close);
            field.BarSize = bar.BarSize;

            return field;
        }
Пример #3
0
        public BarInfo Double2Int(BarInfoView bar)
        {
            if (bar == null)
            {
                return(null);
            }

            var field = new BarInfo();

            field.Open    = Codec.PriceToTick(bar.Open);
            field.High    = Codec.PriceToTick(bar.High);
            field.Low     = Codec.PriceToTick(bar.Low);
            field.Close   = Codec.PriceToTick(bar.Close);
            field.BarSize = bar.BarSize;

            return(field);
        }