Exemple #1
0
 private async void UpdateMarketData(object sender, EventArgs e)
 {
     _marketDataUpdater.Stop();
     //await MarketData.Update();
     MarketData.UpdateFake();
     _marketDataUpdater.Start();
     //await AnalizeBuy();
     Plot.Update(ref MarketData.GetData());
     Legend.Update(ref MarketData.GetData(), AlpacaData.GetAccountData(), AlpacaData.GetPositionns());
 }
Exemple #2
0
 private void UpdatePositions()
 {
     Positions.Clear();
     foreach (var position in AlpacaData.GetPositionns())
     {
         Positions.Text +=
             $"{position.Symbol()} {position.Volume():#.00} {position.CurrenPrice():#.00}{AlpacaData.GetAccountData().Currency()}" +
             Environment.NewLine;
     }
     Positions.Foreground = new SolidColorBrush(Colors.Purple);
 }
Exemple #3
0
        private async void UpdateAlpacaData(object sender, EventArgs e)
        {
            _accountDataUpdater.Stop();
            await AlpacaData.Update();

            _accountDataUpdater.Start();
            await AnalizeSell();

            UpdatePositions();
            Legend.Update(ref MarketData.GetData(), AlpacaData.GetAccountData(), AlpacaData.GetPositionns());
        }
Exemple #4
0
        private void OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            var tb = (TextBlock)sender;

            foreach (var price in _stockTextBlocks)
            {
                if (!price.Value.Equals(tb))
                {
                    continue;
                }
                Settings.SelectedStock = price.Key;
                break;
            }
            SelectedStockChenged.Invoke(sender, new EventArgs());
            Update(ref MarketData.GetData(), AlpacaData.GetAccountData(), AlpacaData.GetPositionns());
        }
Exemple #5
0
 private void LegendCanvas_SizeChanged(object sender, SizeChangedEventArgs e)
 {
     Update(ref MarketData.GetData(), AlpacaData.GetAccountData(), AlpacaData.GetPositionns());
 }