public Report Generate(IAnalysisResult result) { var stock = result.Stock; var report = new Report("ClosedPricesChart", "Closed price chart: " + stock.Name); var chart = new StockPriceChart(stock, Prices.ForStock(stock)); var chartSection = new GenericChartSection("Closed prices", chart); report.Sections.Add(chartSection); return(report); }
public Report Generate( IAnalysisResult result ) { var stock = result.Stock; var report = new Report( "ClosedPricesChart", "Closed price chart: " + stock.Name ); var chart = new StockPriceChart( stock, Prices.ForStock( stock ) ); var chartSection = new GenericChartSection( "Closed prices", chart ); report.Sections.Add( chartSection ); return report; }
private void AddChart( Data data ) { var chart = new StockPriceChart( Name, myStock, data.Prices ); foreach ( var entry in data.Points ) { chart.IndicatorPoints.Add( entry.Key, entry.Value ); } chart.Signals = data.Signals; var section = new GenericChartSection( Name, chart ); Sections.Add( section ); }
private GenericChartSection CreateChartSection( TradingResult tradingResult ) { var chart = new StockPriceChart( "TradingProtocol", tradingResult.Stock, tradingResult.Prices ); var trades = tradingResult.TradingLog.Orders .Select( o => o.Timestamp ) .ToList(); var signals = tradingResult.SystemSignals .Where( s => trades.Contains( s.Time ) ); chart.Signals = new SignalSeries( tradingResult.Prices, new SeriesIdentifier( new StockObjectIdentifier( tradingResult.Stock ), new ObjectDescriptor( "Trading" ) ), signals ); AddIndicators( chart, tradingResult.SystemReport ); var section = new GenericChartSection( "Chart", chart ); return section; }
public GenericChartSection Generate( SystemResult result ) { var chart = new StockPriceChart( result.System, result.Stock, result.Prices ); chart.Signals = result.Signals; var section = new GenericChartSection( "Chart", chart ); return section; }