I’m trying to get a single chart to plot each system’s results in my brokerage account and the total of all systems (like the
Portfolio Builder chart). I’ve come close but this only displays the first system and doesn’t iterate the results for the others or the total of all systems. Here is what I’m doing:
// Create a query, activate it and write your code here…
// Your systems selection
Int64[] systems = new Int64[]
{
92190352, // Drunk Uncle
102238099, // Nordic C2/ES Swing
98996797, // W Oversold
84372841, // XLN Swing Trading
102283423, // HFX 10 Stock Blue Chip
100008908, // ETF Capital Builder
};
// Your EMA period
int emaPeriod = 30;
foreach (var systemId in systems)
{
// Get a system (for its Name)
var c2System = GetC2SYSTEM(systemId);
// Daily equity data with commissions and fees
ITimeSheet timeSheet = TimeSheetFactory(systemId, TimeInterval.Day);
// Let TimeSheet run
timeSheet.EquitiesSheet();
// Extract equity data.
var equity = timeSheet.GetColumn(systemId, EquityType.Equity);
// Your Technical analysis data
var taData = C2TALib.EMA(equity, emaPeriod);
// Create a chart object
ITimeSeriesChart chart = new TimeSeriesChart();
chart.Name = c2System.Name;
// Add equity to the chart
chart.Add(equity, "Equity", Color.Blue);
// Add Technical analysis to the chart
chart.Add(taData, "EMA_" + emaPeriod.ToString(), Color.Red);
// Show the chart
CHART = chart;
}
Help!