Exemplo n.º 1
0
        public override OHLCBars CreatePriceBars(TickerReference tickerReference)
        {
            var bars = new OHLCBars(PricePoolSizeConfig.GetPoolSize(typeof(OHLCBars)));

            _bars.Add(tickerReference.Id, bars);
            return(bars);
        }
Exemplo n.º 2
0
        public IPriceItemFeed <TItem> Assign(TickerReference tickerReference, Action <TickerReference, TItem> priceAction)
        {
            var itemFeed = new PriceItemFeed <TickerReference, TItem>(tickerReference, priceAction);

            _item[tickerReference.Symbol.Id][tickerReference.Interval.UnitId] = itemFeed;
            return(itemFeed);
        }
Exemplo n.º 3
0
        public override RenkoBars CreatePriceBars(TickerReference tickerReference)
        {
            var bars = new RenkoBars(PricePoolSizeConfig.GetPoolSize(typeof(RenkoBars)), 10, 1);

            _bars.Add(tickerReference.Id, bars);
            return(bars);
        }
Exemplo n.º 4
0
 protected void QuotePriceAction(TickerReference tickerReference, long timestamp, double bid, double ask)
 {
     if (MinutePriceBarFeed != null)
     {
         QuoteFeed(timestamp, bid, ask);
     }
 }
Exemplo n.º 5
0
 public void MinutePriceAction(TickerReference tickerReference, IPriceBar priceBar)
 {
     if (_bars.ContainsKey(tickerReference.Symbol.Id) && _bars[tickerReference.Symbol.Id].ContainsKey(tickerReference.Interval.UnitId))
     {
         UpdatePrice(_bars[tickerReference.Symbol.Id][tickerReference.Interval.UnitId], tickerReference, priceBar);
     }
 }
Exemplo n.º 6
0
        public SignalAdvisor(TickerReference tickerReference)
        {
            _SignalTimeframe = tickerReference;

            _position         = PositionOption.None;
            _positionStrength = _positionFullStrength;
        }
Exemplo n.º 7
0
 protected void MinutePriceAction(TickerReference tickerReference, IPriceBar priceBar)
 {
     if (MinutePriceBarFeed != null)
     {
         MinutePriceBarFeed(tickerReference, priceBar);
     }
 }
Exemplo n.º 8
0
        public IPriceOptionFeed <TOption, double> Assign(TickerReference tickerReference, TOption priceOption, Action <TickerReference, long, TOption, double> priceAction)
        {
            var optionFeed = new PriceOptionFeed <TickerReference, TOption, double>(tickerReference, priceOption, priceAction);

            _option[tickerReference.Symbol.Id][tickerReference.Interval.UnitId] = optionFeed;
            return(optionFeed);
        }
Exemplo n.º 9
0
        public void Setup(TickerReference tickerReference)
        {
            if (!_bars.ContainsKey(tickerReference.Symbol.Id))
            {
                _bars.Add(tickerReference.Symbol.Id, new Dictionary <int, TBars>());
            }

            if (!_bars[tickerReference.Symbol.Id].ContainsKey(tickerReference.Interval.UnitId))
            {
                _bars[tickerReference.Symbol.Id].Add(tickerReference.Interval.UnitId, CreatePriceBars(tickerReference));
            }
        }
Exemplo n.º 10
0
 public static bool TrySubscribe(TickerReference ticker, IPriceFeedService priceFeedService,
                                 Action <TickerReference, ICandlestickBar> priceBarAction)
 {
     if (ticker.PriceFeedType == typeof(CandlestickPriceOption) && ((CandlestickPriceOption)ticker.PriceFeedOption) == CandlestickPriceOption.All)
     {
         priceFeedService.Subscribe(ticker, priceBarAction);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 11
0
 public static bool TrySubscribe(TickerReference ticker, IPriceFeedService priceFeedService,
                                 Action <TickerReference, long, CandlestickPriceOption, double> priceOptionAction)
 {
     if (ticker.PriceFeedType == typeof(CandlestickPriceOption))
     {
         priceFeedService.Subscribe(ticker, (CandlestickPriceOption)ticker.PriceFeedOption, priceOptionAction);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 12
0
        public TickerReference Setup(TickerSymbol tickerSymbol, FeedInterval interval, HeikenAshiPriceOption ohlcPriceOption)
        {
            if (ohlcPriceOption == HeikenAshiPriceOption.All)
            {
                Registry.ItemSetup(tickerSymbol.Id, interval.UnitId);
            }
            else
            {
                Registry.OptionSetup(tickerSymbol.Id, interval.UnitId);
            }

            var tickerReference = new TickerReference(Guid.NewGuid(), tickerSymbol, interval, typeof(HeikenAshiPriceOption), (int)ohlcPriceOption);

            Aggregator.Setup(tickerReference);

            return(tickerReference);
        }
Exemplo n.º 13
0
 public IPriceOptionFeed <HeikenAshiPriceOption, double> Subscribe(TickerReference tickerReference, HeikenAshiPriceOption priceOption, Action <TickerReference, long, HeikenAshiPriceOption, double> priceAction)
 {
     return(Registry.Assign(tickerReference, priceOption, priceAction));
 }
Exemplo n.º 14
0
 public IPriceItemFeed <IHeikenAshiBar> Subscribe(TickerReference tickerReference, Action <TickerReference, IHeikenAshiBar> priceAction)
 {
     return(Registry.Assign(tickerReference, priceAction));
 }
Exemplo n.º 15
0
 public abstract void UpdatePrice(TBars bars, TickerReference tickerReference, IPriceBar priceBar);
Exemplo n.º 16
0
 public IPriceOptionFeed <RenkoPriceOption, double> Subscribe(TickerReference tickerReference, RenkoPriceOption priceOption, Action <TickerReference, long, RenkoPriceOption, double> priceAction)
 {
     return(Renko.Subscribe(tickerReference, priceOption, priceAction));
 }
Exemplo n.º 17
0
 public abstract TBars CreatePriceBars(TickerReference tickerReference);
Exemplo n.º 18
0
 public IPriceOptionFeed <OHLCPriceOption, double> Subscribe(TickerReference tickerReference, OHLCPriceOption priceOption, Action <TickerReference, long, OHLCPriceOption, double> priceAction)
 {
     return(OHLC.Subscribe(tickerReference, priceOption, priceAction));
 }
Exemplo n.º 19
0
 public void PriceAction(TickerReference tickerReference, ICandlestickBar priceBar)
 {
     Registry.PriceAction(tickerReference, priceBar);
 }
Exemplo n.º 20
0
 public IPriceOptionFeed <CandlestickPriceOption, double> Subscribe(TickerReference tickerReference, CandlestickPriceOption priceOption, Action <TickerReference, long, CandlestickPriceOption, double> priceAction)
 {
     return(Registry.Assign(tickerReference, priceOption, priceAction));
 }
Exemplo n.º 21
0
 public IPriceItemFeed <ICandlestickBar> Subscribe(TickerReference tickerReference, Action <TickerReference, ICandlestickBar> priceAction)
 {
     return(Registry.Assign(tickerReference, priceAction));
 }
Exemplo n.º 22
0
 public IPriceItemFeed <IOHLCBar> Subscribe(TickerReference tickerReference, Action <TickerReference, IOHLCBar> priceAction)
 {
     return(OHLC.Subscribe(tickerReference, priceAction));
 }
Exemplo n.º 23
0
 public void PriceAction(TickerReference tickerReference, IOHLCBar priceBar)
 {
     Registry.PriceAction(tickerReference, priceBar);
 }
Exemplo n.º 24
0
 public EventProbe(TickerReference ticker)
 {
     Ticker = ticker;
 }
Exemplo n.º 25
0
 public void PriceAction(TickerReference tickerReference, IHeikenAshiBar priceBar)
 {
     Registry.PriceAction(tickerReference, priceBar);
 }
Exemplo n.º 26
0
 private void MinutePriceBarFeed(TickerReference tickerReference, IPriceBar priceBar)
 {
     OHLC.Aggregator.MinutePriceAction(tickerReference, priceBar);
     PriceBar.Aggregator.MinutePriceAction(tickerReference, priceBar);
 }
Exemplo n.º 27
0
 public void PriceAction(TickerReference tickerReference, long timestamp, HeikenAshiPriceOption priceOption, double value)
 {
     Registry.PriceAction(tickerReference, timestamp, priceOption, value);
 }
Exemplo n.º 28
0
 public IPriceItemFeed <ICandlestickBar> Subscribe(TickerReference tickerReference, Action <TickerReference, ICandlestickBar> priceAction)
 {
     return(Candlesticks.Subscribe(tickerReference, priceAction));
 }
Exemplo n.º 29
0
 public override void UpdatePrice(RenkoBars bars, TickerReference tickerReference, IPriceBar priceBar)
 {
     bars.Write(priceBar.Timestamp, priceBar.Close);
 }
Exemplo n.º 30
0
 public override void UpdatePrice(OHLCBars bars, TickerReference tickerReference, IPriceBar priceBar)
 {
     bars.Write(priceBar);
 }