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);
        }
        public AbstractSection Merge( IAnalysisResult result )
        {
            var visitor = new GenericChartSectionVisitor( Indicators );
            var walker = new ReportWalker( visitor );
            walker.Visit( result.Report );

            if ( !visitor.Sections.Any() )
            {
                return null;
            }

            var section = CreateMergedChartsSection( result.Stock, visitor.Sections );
            return section;
        }
Esempio n. 4
0
        public AbstractSection Merge(IAnalysisResult result)
        {
            var visitor = new GenericChartSectionVisitor(Indicators);
            var walker  = new ReportWalker(visitor);

            walker.Visit(result.Report);

            if (!visitor.Sections.Any())
            {
                return(null);
            }

            var section = CreateMergedChartsSection(result.Stock, visitor.Sections);

            return(section);
        }
Esempio n. 5
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 );
                    }
                }
            }
        }