コード例 #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 );
        }
コード例 #2
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);
        }
コード例 #3
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;
        }
コード例 #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);
        }
コード例 #5
0
ファイル: BackTestingStockReport.cs プロジェクト: bg0jr/Maui
        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 );
                    }
                }
            }
        }