예제 #1
0
 public CandleChartUpdater(CandleChart chart, CandleChartStore store, ICandleProvider provider)
 {
     this.chart    = chart;
     this.store    = store;
     this.provider = provider;
     this.entry    = new Lazy <ChartEntryEntity>(() => store.FindOrCreateEntry(chart.Symbol, chart.Range));
 }
 public ForexMarket(ForexMarketContext context, ITickProvider tickProvider, ICandleProvider candleProvider)
 {
     this.context        = context;
     this.tickProvider   = tickProvider;
     this.candleProvider = candleProvider;
     this.listeners      = new List <IMarketListener>();
 }
        public CandleMonitorData(CandleMonitorFeeds item, ICandleProvider candleProvider, IAppSettingCandleMonitor appSetting)
        {
            Settings = item.MarketFeedSettings;

            var p = candleProvider.Load(Settings); // Just populate the provider DataStores, don't get any data

            LastRunUtc   = p.LastUpdatedUtc;
            IsFastUpdate = item.TradeFromUtc.HasValue || (item.HasOverlay && appSetting.HasOverlayFastUpdate);
            HasOverlay   = item.HasOverlay;
            DataSource   = candleProvider.DataStores[Settings];

            BatchSize = IsFastUpdate ? 60 : 25;
        }
 public CandleMonitor(ICoinbaseProClient client
                      , IStartupWorkflow startupWorkflow
                      , ICandleProvider candleProvider
                      , ICandleMonitorFeedProvider candleMonitorFeedProvider
                      , ICandleProducer candleProducer
                      , IOptions <AppSetting> appSetting
                      , ILogger <CandleMonitor> logger)
 {
     _client                    = client;
     _startupWorkflow           = startupWorkflow;
     _provider                  = candleProvider;
     _candleMonitorFeedProvider = candleMonitorFeedProvider;
     _candleProducer            = candleProducer;
     _appSetting                = appSetting.Value;
     _logger                    = logger;
 }
예제 #5
0
 public BackTestRunner(ICandleProvider candleProvider, ITickProvider tickProvider)
 {
     this.candleProvider = candleProvider;
     this.tickProvider   = tickProvider;
 }
예제 #6
0
        private static HistoricalAdvicesModel CreateHistoricalAdvicesModel(string symbol, ITradingStrategy strategy, ICandleProvider candleProvider)
        {
            var candles = candleProvider.GetCandles(symbol);
            var advices = strategy.Prepare(candles);

            return(new HistoricalAdvicesModel
            {
                RefreshTime = DateTime.UtcNow,
                Symbol = symbol,
                Advices = advices.Select(_ => _.TradeAdvice)
            });
        }
예제 #7
0
 public SymbolInformationService(IExchangeApi api, ICandleProvider candleProvider)
 {
     this.api            = api;
     this.candleProvider = candleProvider;
 }
 public ForexMarket(Instruments instrument, ITickProvider tickProvider, ICandleProvider candleProvider) : this(new ForexMarketContext(instrument, MarketState.Unknown), tickProvider, candleProvider)
 {
 }
 public SwingLowHighTradingStrategy(ICandleProvider provider)
 {
     this.provider = provider;
 }