I want to 2 indicators in multi time frame. I wrote an indicator PAInd that base its logic on 5 min bars but should update its data every 1Min. the indicator is expose an UpdateInd() method. the UpdateInd() call the Update() method in order to force a call to OnBarUpdate() every 1Min.
I wrote another indicator PAStrategyInd that run on 1Min bar and call PAInd indicator.the PAStrategyInd call the UpdateInd() method of PAInd every 1 min.
it seems that PAInd indicator data is update its data every 5Min and not every 1 min as expected.
public class PAInd : Indicator
{
protected override void OnBarUpdate()
{ do something}
public void UpdateInd()
{
Update();
}
}
public class PAInd : Indicator
{
protected override void Initialize()
{ Add(PeriodType.Minute, 5);}
protected override void OnBarUpdate()
{
if(BarsPeriod.Value != 1 || BarsInProgress !=0)
return;
PAInd m_PAInd = PAInd(BarsArray[1]);
m_PAInd.UpdateInd();
do something
}
}
Comment