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(); }
private void RegisterLineChartTimer() { dispatcherTimer = new SmartDispatcherTimer(); dispatcherTimer.IsReentrant = false; dispatcherTimer.Interval = TimeSpan.FromSeconds(1); dispatcherTimer.TickTask = () => { UpdateGUI(); }; dispatcherTimer.Start(); }
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(); }