示例#1
0
 public RangeBarBuilder(BarsInfo info)
     : base(info)
 {
     _period        = (info.Period as RangePeriod) ?? throw new ArgumentException("period");
     _tickSize      = info.Instrument.MinPriceIncrement;
     _rangeInPoints = info.Instrument.IncrementsToPoints(_period.TicksPerBar);
 }
示例#2
0
 public PriceActionBarBuilder(BarsInfo barsInfo)
     : base(barsInfo)
 {
     Period = (barsInfo.Period as PriceActionPeriod) ?? throw new ArgumentException("period");
     _initialTrendBarSizeInPoints    = TrendBarSizeInPoints = barsInfo.Instrument.IncrementsToPoints(Period.TrendBarSizeInTicks);
     _initialReversalBarSizeInPoints = ReversalBarSizeInPoints = barsInfo.Instrument.IncrementsToPoints(Period.ReversalBarSizeInTicks);
 }
 public LimitedLookBackBars(BarsInfo barsInfo)
 {
     BarsInfo          = barsInfo;
     OpenValueSeries   = new BarBasedValueSeries(this, BarInputType.Open);
     HighValueSeries   = new BarBasedValueSeries(this, BarInputType.High);
     LowValueSeries    = new BarBasedValueSeries(this, BarInputType.Low);
     CloseValueSeries  = new BarBasedValueSeries(this, BarInputType.Close);
     VolumeValueSeries = new BarBasedValueSeries(this, BarInputType.Volume);
 }
示例#4
0
 /// <summary>
 /// A utility method to create a bar builder from a BarsInfo object, so that
 /// you don't have to write this switch statement all over your own code.
 /// </summary>
 public static BarBuilder Create(BarsInfo barsInfo)
 {
     return(barsInfo.Period switch
     {
         SecondPeriod => new SecondBarBuilder(barsInfo),
         MinutePeriod => new MinuteBarBuilder(barsInfo),
         RangePeriod => new RangeBarBuilder(barsInfo),
         TickPeriod => new TickBarBuilder(barsInfo),
         PriceActionPeriod => new PriceActionBarBuilder(barsInfo),
         _ => throw barsInfo.Period.GetType().UnknownTypeException(),
     });
示例#5
0
 public TickBarBuilder(BarsInfo info)
     : base(info)
 {
     _period = (TickPeriod)info.Period;
 }
 private WavePatternEngine(ProcessingContext processingContext, WavePatternEngineSettings settings, BarsInfo barsInfo)
     : base(processingContext, settings)
 {
     _bars = ProcessingContext.GetBars(barsInfo);
     _eDistanceInPoints      = _bars.BarsInfo.Instrument.IncrementsToPoints(settings.ETicks);
     _xDistanceInPoints      = _bars.BarsInfo.Instrument.IncrementsToPoints(settings.XTicks);
     _reversalOffsetInPoints = _bars.BarsInfo.Instrument.IncrementsToPoints(settings.ReversalOffsetTicks);
     _initializer            = new Initializer(_bars);
 }
 public MinuteBarBuilder(BarsInfo barsInfo)
     : base(barsInfo)
 {
     _period = (barsInfo.Period as MinutePeriod) ?? throw new ArgumentException("period");
 }
示例#8
0
 public SecondBarBuilder(BarsInfo barsInfo)
     : base(barsInfo)
 {
     _period = (barsInfo.Period as SecondPeriod) ?? throw new ArgumentException("period");
 }
示例#9
0
 protected BarBuilder(BarsInfo barsInfo)
 {
     BarsInfo        = barsInfo;
     Bars            = new Bars(barsInfo);
     SessionIterator = new TradingSessionIterator(BarsInfo.TradingHours, BarsInfo.FirstSessionDate);
 }