The below strategy code
-----------------------
protected override void Initialize()
{
Add(PeriodType.Day, 1);
MyIndicator(BarsArray[1], Period).Plots[0].Pen.Color = Color.Blue;
Add(MyIndicator(BarsArray[1], Period));
}
---------------------
Throws exception: Failed to call method 'Initialize' for strategy 'MyStrategy': 'BarsArray' property can not be accessed from within 'Initialize' method
Questions:
- Is there a way to add an indicator into strategy with specific Period?
- How to plot such an indicator (with hardcoded period) from a strategy?
Thanks for help,
Alex.
Comment