Exemplo n.º 1
0
        private void Random_OnSelected(object sender, RoutedEventArgs e)
        {
            TradingChart.RemoveIndicators();

            var strategy = new RandomTradingStrategy(TradingChart.Candles);

            TradingChart.SetStrategy(strategy);
        }
Exemplo n.º 2
0
        private async void simulateButton_Click(object sender, RoutedEventArgs e)
        {
            SetEverythingEnabled(false);
            await TradingChart.BeginTesting();

            SetEverythingEnabled(true);
            ShowBalance();
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
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);
        }
Exemplo n.º 6
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);
        }
Exemplo n.º 7
0
        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();
            });
        }
Exemplo n.º 8
0
 private void ListBoxItem1mn_OnSelected(object sender, RoutedEventArgs e)
 {
     TradingChart.candleInterval = CandleInterval.Month;
     TradingChart.RestartSeries();
 }
Exemplo n.º 9
0
 private void ListBoxItem5m_OnSelected(object sender, RoutedEventArgs e)
 {
     TradingChart.candleInterval = CandleInterval.FiveMinutes;
     TradingChart.RestartSeries();
 }
Exemplo n.º 10
0
 private void ResetState()
 {
     TradingChart.RemoveIndicators();
     TradingChart.RemoveMarkers();
     BalanceTextBlock.Visibility = Visibility.Collapsed;
 }