/// <summary> /// draw a pattern on his individual chart /// прорисовать паттерн на его индивидуальном чарте /// </summary> private void PaintSinglePattern(IPattern pattern, ChartCandlePainter chart) { if (chart.GetChart().InvokeRequired) { chart.GetChart().Invoke(new Action <IPattern, ChartCandlePainter>(PaintSinglePattern), pattern, chart); return; } chart.ClearDataPointsAndSizeValue(); chart.ClearSeries(); if (pattern.Type == PatternType.Candle) { chart.PaintSingleCandlePattern(((PatternCandle)pattern).GetInCandle()); } if (pattern.Type == PatternType.Volume) { chart.PaintSingleVolumePattern(((PatternVolume)pattern).GetInCandle()); } if (pattern.Type == PatternType.Indicators) { PatternIndicators pat = (PatternIndicators)pattern; for (int i = 0; pat.Indicators != null && i < pat.Indicators.Count; i++) { if (chart.IndicatorIsCreate(pat.Indicators[i].Name + "0") == false) { chart.CreateSeries(chart.GetChartArea(pat.Indicators[i].NameArea), pat.Indicators[i].TypeIndicator, pat.Indicators[i].NameSeries + "0"); } chart.ProcessIndicator(pat.Indicators[i]); } } }
/// <summary> /// draw a closing pattern on its individual chart /// прорисовать паттерн на закрытие на его индивидуальном чарте /// </summary> public void PaintClosePattern(int index) { if (_bot.PatternsToClose == null || _bot.PatternsToClose.Count <= index) { _chartSingleClosePattern.ClearSeries(); return; } IPattern pattern = _bot.PatternsToClose[index]; PaintSinglePattern(pattern, _chartSingleClosePattern); }
/// <summary> /// draw a pattern on the opening on his individual charts /// прорисовать паттерн на открытие на его индивидуальном чарте /// </summary> public void PaintOpenPattern(int index) { if (_bot.PatternsToOpen == null || _bot.PatternsToOpen.Count <= index) { _chartSingleOpenPattern.ClearSeries(); return; } IPattern pattern = _bot.PatternsToOpen[index]; PaintSinglePattern(pattern, _chartSingleOpenPattern); }