When COBC=True, the BarsAgo index of the most recently closed bar is 0.
When COBC=False, the BarsAgo index of the most recently closed bar is 1.
Ok, during the time period in which Historical bars are processed by OnBarUpdate,
what is the correct BarsAgo index for the most recently closed bar?
The essential questions are,
1. When Historical is true, should the code ignore COBC setting and always use 0?
2. When Historical is False, should the code always use '0' for COBC=True and '1' for COBC=False?
For example, the above two statements can be expressed in code with,
public int FirstBarsAgo { get { return Historical ? 0 : CalculateOnBarClose ? 0 : 1; } }
most recently closed bar for all combinations of Historical and CalculateOnBarClose?
Comment