コード例 #1
0
ファイル: DoubleCrossover.cs プロジェクト: riyanhax/Maui
            private IndicatorResult GenerateResult(IPriceSeries shortTermPoints, IPriceSeries longTermPoints)
            {
                var signals = Indicator.SignalGenerationStrategy.Generate(shortTermPoints, longTermPoints);

                var reportData = new GenericIndicatorReport.Data()
                {
                    SignalOfDayUnderAnalysis = GetCurrentSignal(signals, longTermPoints),
                    Prices  = myPrices,
                    Signals = signals
                };

                reportData.Points[Indicator.ShortTerm.Name] = shortTermPoints;
                reportData.Points[Indicator.LongTerm.Name]  = longTermPoints;

                var result = new IndicatorResult(Indicator.Name, Stock, reportData.SignalOfDayUnderAnalysis);

                if (Context.GenerateHistoricSignals)
                {
                    result.Signals = signals;
                }

                result.Report = new DoubleCrossoverReport(Indicator, Stock, reportData);

                return(result);
            }
コード例 #2
0
            private IndicatorResult GenerateResult(IPriceSeries points)
            {
                var signals = Indicator.SignalGenerationStrategy.Generate(myPrices, points);

                var reportData = new GenericIndicatorReport.Data()
                {
                    SignalOfDayUnderAnalysis = GetCurrentSignal(signals, points),
                    Prices  = myPrices,
                    Signals = signals
                };

                reportData.Points[Indicator.Name] = points;

                var result = new IndicatorResult(Indicator.Name, Stock, reportData.SignalOfDayUnderAnalysis);

                if (Context.GenerateHistoricSignals)
                {
                    result.Signals = signals;
                }

                result.Report = new SmaReport(Indicator, Stock, reportData);

                return(result);
            }