public MovingAverageViewModel(WpfStrategy strategy, IHelperFactoryContainer iHelperFactoryContainer,
                                      Dispatcher UiDispatcher, ILoggerFacade logger)
            : base(strategy, iHelperFactoryContainer, UiDispatcher, logger)
        {
            var chartHelper = ServiceLocator.Current.GetInstance <IChartHelper>();

            TimeFormatter  = chartHelper.TimeFormatter;
            PriceFormatter = chartHelper.PriceFormatter;

            IsActive           = false;
            IsLoadingTrades    = true;
            IsLoadingOrderBook = true;

            cancellationTokenSource = new CancellationTokenSource();

            tradeHelperFactory = HelperFactoryContainer.GetFactory <ITradeHelperFactory>();

            orderBookHelperFactory = HelperFactoryContainer.GetFactory <IOrderBookHelperFactory>();

            ShowCandlesticks = Strategy.StrategySubscriptions.Any(s => s.SubscribeCandlesticks);

            Trades             = new List <Trade>();
            TradesChart        = new ChartValues <Trade>();
            SmaTradesChart     = new ChartValues <Trade>();
            BuyIndicatorChart  = new ChartValues <Trade>();
            SellIndicatorChart = new ChartValues <Trade>();
            CandlesticksChart  = new ChartValues <Candlestick>();
            CandlestickLabels  = new ObservableCollection <string>();
        }
 public StrategyDisplayViewModelBase(Strategy strategy,
                                     IHelperFactoryContainer iHelperFactoryContainer,
                                     Dispatcher UiDispatcher, ILoggerFacade logger)
     : base(logger)
 {
     HelperFactoryContainer = iHelperFactoryContainer;
     Dispatcher             = UiDispatcher;
     Strategy = strategy;
 }
Esempio n. 3
0
        public MovingAverageViewModel(WpfStrategy strategy, IHelperFactoryContainer iHelperFactoryContainer,
                                      Dispatcher UiDispatcher, ILoggerFacade logger)
            : base(strategy, iHelperFactoryContainer, UiDispatcher, logger)
        {
            var chartHelper = ServiceLocator.Current.GetInstance <IChartHelper>();

            TimeFormatter  = chartHelper.TimeFormatter;
            PriceFormatter = chartHelper.PriceFormatter;

            IsActive           = false;
            IsLoadingTrades    = true;
            IsLoadingOrderBook = true;

            cancellationTokenSource = new CancellationTokenSource();

            var tradeHelperFactory = HelperFactoryContainer.GetFactory <ITradeHelperFactory>();

            tradeHelper = tradeHelperFactory.GetTradeHelper();

            orderBookHelperFactory = HelperFactoryContainer.GetFactory <IOrderBookHelperFactory>();

            ShowCandlesticks = Strategy.StrategySubscriptions.Any(s => s.SubscribeCandlesticks);
        }
Esempio n. 4
0
        public StrategyAssemblyManager(IHelperFactoryContainer iHelperFactoryContainer)
        {
            this.iHelperFactoryContainer = iHelperFactoryContainer;

            Files = new List <string>();
        }