Exemplo n.º 1
0
        private void AddStandaloneCharts( IAnalysisResult result, Report report )
        {
            var visitor = new ChartSectionVisitor();
            var walker = new ReportWalker( visitor );
            walker.Visit( result.Report );

            var standaloneCharts = visitor.Sections
                .Where( section => !HandledByChartMergeOperators( section ) )
                .ToList();

            report.Sections.AddRange( standaloneCharts );
        }
        private void AddStandaloneCharts(IAnalysisResult result, Report report)
        {
            var visitor = new ChartSectionVisitor();
            var walker  = new ReportWalker(visitor);

            walker.Visit(result.Report);

            var standaloneCharts = visitor.Sections
                                   .Where(section => !HandledByChartMergeOperators(section))
                                   .ToList();

            report.Sections.AddRange(standaloneCharts);
        }
Exemplo n.º 3
0
        private void AddIndicators( StockPriceChart chart, Report report )
        {
            var visitor = new ChartSectionVisitor();
            var walker = new ReportWalker( visitor );
            walker.Visit( report );

            foreach ( var section in visitor.Sections.OfType<GenericChartSection>() )
            {
                foreach ( var entry in section.Chart.IndicatorPoints )
                {
                    // could be that the chart is already added
                    // sample: indicator 1 = SMA.200, indicator 2 = SMA.10xSMA.200 (double cross over). then SMA.200 would be added two times
                    if ( !chart.IndicatorPoints.ContainsKey( entry.Key ) )
                    {
                        chart.IndicatorPoints.Add( entry.Key, entry.Value );
                    }
                }
            }
        }