示例#1
0
        public async Task Start()
        {
            Client       = new Client();
            balance      = new GetBalances();
            marketOrder  = new MarketOrder();
            quantity     = new TotalToVolume();
            currentPrice = new GetCurrentPrice();
            // Output window
            outputData = new Strategy1Data();

            Dispatcher.CurrentDispatcher.Invoke(() =>
            {
                Client.PoloniexClient.Live.Start();
            });

            // Override this method on sub classes
            dispatcherTimer.TickTask = async() =>
            {
                await OnBar();
            };
            dispatcherTimer.Start();


            await GetTickerData();

            // Start method
            OnStart();
        }
 private void RegisterTimer()
 {
     timer             = new SmartDispatcherTimer();
     timer.IsReentrant = false;
     timer.Interval    = TimeSpan.FromSeconds(20);
     timer.TickTask    = async() =>
     {
         await CheckServiceChanged();
     };
     timer.Start();
 }
示例#3
0
 private void RegisterLineChartTimer()
 {
     dispatcherTimer             = new SmartDispatcherTimer();
     dispatcherTimer.IsReentrant = false;
     dispatcherTimer.Interval    = TimeSpan.FromSeconds(1);
     dispatcherTimer.TickTask    = () =>
     {
         UpdateGUI();
     };
     dispatcherTimer.Start();
 }
示例#4
0
        public void StartProcess()
        {
            // Read file in the background.
            cityLoader.RunWorkerAsync();

            // SmartDispatched - disallows renetry.
            var timer = new SmartDispatcherTimer();

            timer.IsReentrant = false;
            timer.Interval    = TimeSpan.FromSeconds(updateIntervalSec);
            timer.TickTask    = async() => {
                await loadLatestEarthquakes();
            };
            timer.Start();

            // Initial load. fire and forget
            loadLatestEarthquakes();
        }