private void Random_OnSelected(object sender, RoutedEventArgs e) { TradingChart.RemoveIndicators(); var strategy = new RandomTradingStrategy(TradingChart.Candles); TradingChart.SetStrategy(strategy); }
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 void ResetState() { TradingChart.RemoveIndicators(); TradingChart.RemoveMarkers(); BalanceTextBlock.Visibility = Visibility.Collapsed; }