Пример #1
0
        /// <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]);
                }
            }
        }
Пример #2
0
 /// <summary>
 /// создан ли индикатор
 /// </summary>
 /// <param name="name">имя индикатора</param>
 /// <returns>true - создан false - нет</returns>
 public bool IndicatorIsCreate(string name)
 {
     return(ChartCandle.IndicatorIsCreate(name));
 }