private void Random_OnSelected(object sender, RoutedEventArgs e) { TradingChart.RemoveIndicators(); var strategy = new RandomTradingStrategy(TradingChart.Candles); TradingChart.SetStrategy(strategy); }
private async void simulateButton_Click(object sender, RoutedEventArgs e) { SetEverythingEnabled(false); await TradingChart.BeginTesting(); SetEverythingEnabled(true); ShowBalance(); }
private void RSI_OnSelected(object sender, RoutedEventArgs e) { TradingChart.RemoveIndicators(); var rsi = new Rsi(TradingChart.Candles, 14, 70, 30); TradingChart.AddIndicator(rsi); var strategy = new RsiTradingStrategy(TradingChart.Candles, rsi); TradingChart.SetStrategy(strategy); }
private void MACD_OnSelected(object sender, RoutedEventArgs e) { TradingChart.RemoveIndicators(); var macd = new Macd(new ExponentialMaCalculation(), 12, 26, 9, TradingChart.Candles); TradingChart.AddIndicator(macd); var strategy = new MacdTradingStrategy(TradingChart.Candles, macd); TradingChart.SetStrategy(strategy); }
// ================================================== // events // ================================================== private void MA_OnSelected(object sender, RoutedEventArgs e) { TradingChart.RemoveIndicators(); var ma = new MovingAverage(50, new ExponentialMaCalculation(), TradingChart.Candles); TradingChart.AddIndicator(ma); var strategy = new MaTradingStrategy(TradingChart.Candles, ma); TradingChart.SetStrategy(strategy); }
private void MACrossRSI_OnSelected(object sender, RoutedEventArgs e) { TradingChart.RemoveIndicators(); var rsi = new Rsi(TradingChart.Candles, 14, 66, 33); TradingChart.AddIndicator(rsi); var ma = new MovingAverage(13, new ExponentialMaCalculation(), TradingChart.Candles); TradingChart.AddIndicator(ma); var ma2 = new MovingAverage(4, new ExponentialMaCalculation(), TradingChart.Candles); TradingChart.AddIndicator(ma2); var strategy = new MaCrossRsiTradingStrategy(TradingChart.Candles, rsi, ma2, ma); TradingChart.SetStrategy(strategy); }
private async void CandlesTimerElapsed() { if (TradingChart.LoadingCandlesTask == null) { return; } await TradingChart.LoadingCandlesTask; // TO TEST 'REAL TIME TRADING' TradingChart.rightCandleDateAhead = TradingChart.rightCandleDateAhead.AddDays(1); await Dispatcher.InvokeAsync(async() => { await TradingChart.LoadNewCandles(); ShowBalance(); }); }
private void ListBoxItem1mn_OnSelected(object sender, RoutedEventArgs e) { TradingChart.candleInterval = CandleInterval.Month; TradingChart.RestartSeries(); }
private void ListBoxItem5m_OnSelected(object sender, RoutedEventArgs e) { TradingChart.candleInterval = CandleInterval.FiveMinutes; TradingChart.RestartSeries(); }
private void ResetState() { TradingChart.RemoveIndicators(); TradingChart.RemoveMarkers(); BalanceTextBlock.Visibility = Visibility.Collapsed; }