I'm getting the following error when I attempt to load an additional Unirenko bar period in NT8:
All data must first be loaded by the hosting NinjaScript in its configure state. Attempted to load CL 01-19 Nymex: UniR T15R45O2
I'm using the following code:
else if (State == State.Configure)
{
AddDataSeries(BarsPeriodType.Minute, 1); // works
BarsPeriod largePeriod = new BarsPeriod()
{
BarsPeriodType = (BarsPeriodType)501,
BaseBarsPeriodType = BarsPeriodType.Minute,
BaseBarsPeriodValue = LargeBarPeriodBaseValue,
Value = LargeBarPeriodValue,
Value2 = LargeBarPeriodValue2,
};
AddDataSeries(largePeriod); // data load error
}
Adding the minute period type bars works, but the Unirenko fails. This is in an indicator and not a strategy. I'm aware that a hosting strategy needs to add the same periods as embedded indicators; this is not that situation.
LargeBarPeriodBaseValue, LargeBarPeriodValue, and LargeBarPeriodValue2 are user configurable parameters.They're initialized during the State.SetDefaults state clause but are can be modified via indicator properties.
Thanks.
Comment