예제 #1
0
        private void Random_OnSelected(object sender, RoutedEventArgs e)
        {
            TradingChart.RemoveIndicators();

            var strategy = new RandomTradingStrategy(TradingChart.Candles);

            TradingChart.SetStrategy(strategy);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        // ==================================================
        // 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);
        }
예제 #5
0
        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);
        }