Esempio n. 1
0
 private void listBoxTicker_SelectedIndexChanged(object sender, EventArgs e)
 {
     timerLastPrice.Stop();
     chart      = null;
     ticker     = listBoxTicker.SelectedItem.ToString();
     tradeLogic = new FormTradeLogic(ticker, market);
     tradeLogic.GetPriceHistoryByPeriod("Min5", DateTime.Now.AddDays(-6), DateTime.Now.AddYears(10), listBoxTicker_SelectedIndexChanged_UIResultHandler);
 }
Esempio n. 2
0
 private void FormChart_FormClosed(object sender, FormClosedEventArgs e)
 {
     timerLastPrice.Stop();
     if (chart != null)
     {
         chart.Dispose();
         chart = null;
     }
     parent.Activate();
     if (parent.WindowState == FormWindowState.Minimized)
     {
         parent.WindowState = FormWindowState.Normal;
     }
 }
Esempio n. 3
0
        public void listBoxTicker_SelectedIndexChanged_UIResultHandler(RequestItemGroup resultResponse)
        {
            if (Helper.IsResultHasErrors(resultResponse))
            {
                return;
            }
            Dictionary <int, PriceCandle> priceHistory = (Dictionary <int, PriceCandle>)resultResponse.items[0].result.resultData;

            chart = new PriceChart(ticker, Graphics.FromHwnd(panelChart.Handle), 0, 0, panelChart.Width, panelChart.Height);
            chart.SetData(priceHistory, ConvertDataType.BAR_5, ConvertDataType.BAR_15);
            chart.ReDrawFull();
            Text = "Chart " + market.MarketName() + "  " + ticker;

            timerLastPrice.Start();
        }
Esempio n. 4
0
        private void listBoxTicker_SelectedIndexChanged(object sender, EventArgs e)
        {
            timerLastPrice.Stop();
            chart      = null;
            ticker     = listBoxTicker.SelectedItem.ToString();
            tradeLogic = new FormTradeLogic(ticker, market);
            int dayCount = 6;

            if (totalPeriod != TotalPeriod.Default)
            {
                dayCount = GetTotalPeriodDayCount();
            }
            tradeLogic.GetPriceHistoryByPeriod("Min5", DateTime.Now.AddDays(-dayCount), DateTime.Now.AddYears(10), listBoxTicker_SelectedIndexChanged_UIResultHandler);
            totalPeriod = TotalPeriod.Default;
            PrintTotalPeriod();
        }
Esempio n. 5
0
        public void buttonLoadChartData_UIResultHandler(RequestItemGroup resultResponse)
        {
            if (Helper.IsResultHasErrors(resultResponse))
            {
                return;
            }
            Dictionary <int, PriceCandle> priceHistory = (Dictionary <int, PriceCandle>)resultResponse.items[0].result.resultData;

            if (chart == null || ticker == null)
            {
                return;
            }

            chart = new PriceChart(ticker, Graphics.FromHwnd(panelChart.Handle), 0, 0, panelChart.Width, panelChart.Height);
            chart.SetData(priceHistory, convertFromPeriod, viewResultPeriod);
            chart.ReDrawFull();
            loadRequeststarted = false;
            timerLastPrice.Start();
        }
Esempio n. 6
0
        private void FormChart_Load(object sender, EventArgs e)
        {
            Text = "Chart " + market.MarketName();
            LoadTickers();

            // form created with some ticker
            if (ticker != "BTC_BTC")
            {
                timerLastPrice.Stop();
                chart      = null;
                tradeLogic = new FormTradeLogic(ticker, market);
                int dayCount = 6;
                if (totalPeriod != TotalPeriod.Default)
                {
                    dayCount = GetTotalPeriodDayCount();
                }
                tradeLogic.GetPriceHistoryByPeriod("Min5", DateTime.Now.AddDays(-dayCount), DateTime.Now.AddYears(10), listBoxTicker_SelectedIndexChanged_UIResultHandler);
                totalPeriod = TotalPeriod.Default;
                PrintTotalPeriod();
            }
        }