I would like to add Heiken Ashi into my indicator as secondary data series.
The function and the syntax is clear, however my question would be : what syntax should I use so that whenever I change the instrument or the timeframe, the Heiken Ashi data series would follow my primary settings? In the code below, I add a 1 minute Heiken Ashi, but if I would like to switch to 15 seconds bars, I would like Heiken Ashi to switch as well. Or if I change the instrument to NQ, Heiken Ashi should also follow that.
Thank you
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Name = "Examples Indicator";
}
else if (State == State.Configure)
{
AddHeikenAshi("ES 12-24", BarsPeriodType.Minute, 1, MarketDataType.Last);
}
}

Comment