Beispiel #1
0
        private void PlaceStopOrder()
        {
            var context = new NewStopOrderViewModel
            {
                Board                   = Board,
                Seccode                 = Seccode,
                StopLossByMarket        = true,
                StopLossActivationPrice = CurrentPrice.ToString("F2")
            };
            var window = new NewStopOrder
            {
                DataContext      = context,
                StopLossExpander = { IsExpanded = true },
                //StopLossActivationPrice = { Text = CurrentPrice.ToString("F2") },
                BuySell = { SelectedIndex = CurrentPrice < _lastCandle.Close ? 1 : 0 }
            };

            window.Show();
        }
Beispiel #2
0
        private void PlaceStopOrder(object obj)
        {
            if (SelectedData == null)
            {
                return;
            }
            var context = new NewStopOrderViewModel
            {
                BuySell                 = SelectedData.BuySell == "buy" ? "S" : "B",
                Seccode                 = Seccode,
                Board                   = Board,
                StopLossByMarket        = true,
                StopLossActivationPrice = SelectedData.Price.ToString()
            };
            var window = new NewStopOrder
            {
                DataContext      = context,
                StopLossExpander = { IsExpanded = true },
                BuySell          = { SelectedIndex = SelectedData.BuySell == "buy" ? 1 : 0 }
            };

            window.Show();
        }