I am calculating a new DataSeries. How do I use it within a multi-time frame strategy? I run the strategy on weekly bars and add daily bars.
I have done the following:
private DataSeries myMTMCumPnl;
protected override void Initialize()
{
Add(PeriodType.Day, 1); // BIP 1
myMTMCumPnl = new DataSeries(this);
}
protected override void
{
// code
if (BarsInProgress == 1)
{
//
MTMPLCum = Position.GetProfitLoss(Closes[1][0], PerformanceUnit.Currency) + Performance.AllTrades.TradesPerformance.Currency.
myMTMCumPnl.Set(MTMPLCum); // this is where I would like to set the myMTMCumPnl dataseries to daily cumulated PnL
PLDay = myMTMCumPnl[0]-myMTMCumPnl[1]; // this is where I would like to access the PLDay for the daily bars
}
}
Thank you
whotookmynickname

Comment