I have and indicator with 2 different time frames. I am trying to have 2 different Values called, one for each time frame.
Under addplot() in the language reference it show and example using Values[0] and then Values[1]. This example below seems to work fine as an indicator.
protected override void OnBarUpdate()
{
if (BarsInProgress == 1)
{
if(High[1][0] > High[1][1])
{
Value[0][0] = 1;
}
else
{
Value[0][0] = 0;
}
}
if (BarsInProgress == 2)
{
if(High[2][0] > High[2][1])
{
Value[1][0] = 2;
}
else
{
Value[1][0] = 0;
}
}
}
[Browsable(false)]
[XmlIgnore]
public Series<double> MyPlot
{
get { return Values[0]; }
}
[Browsable(false)]
[XmlIgnore]
public Series<double> MyPlot2
{
get { return Values[1]; }
}
But when I go to reference this in a strategy I can't seem to get the strategy to recognize Values[1]. Example below of strategy. Any help would be greatly appreciated. Thanks, Ryan
protected override void OnBarUpdate()
{
if(MyIndicator1[0] == 1)
{
EnterLong();
}
if(MyIndicator1[0] == 2)
{
EnterLong();
}
}

Comment