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); }
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; } }
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(); }
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(); }
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(); }
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(); } }