The indicator is a multi instrument indicator that uses the same primary data series as the strategy and adds the "NAVOL" instrument as a second data series. So two questions:
1. Where do I go wrong?
2. When a multi instrument indicator adds a second instrument, does this second instrument has to be added once again in the strategy (as bellow), or is it allready added/called by the indicator?
protectedoverridevoid Initialize()
{
Add("NAVOL", PeriodType.Minute, 30);
Add(SMA(Fast));
Add(SMA(Slow));
Add(VolRATIO(2, 65));
Add(SMA(Fast));
Add(SMA(Slow));
Add(VolRATIO(2, 65));
CalculateOnBarClose = true;
}
///<summary>
/// Called on each bar update event (incoming tick)
///</summary>
protectedoverridevoid OnBarUpdate()
{
// Condition set 1
if (CrossAbove(SMA(Fast), SMA(Slow), 29)
&& CrossAbove(VolRATIO(BarsArray[1], 2, 65).Plot0, Vol, 29))
{
EnterLong(DefaultQuantity, "");
}
// Condition set 2
if (CrossBelow(SMA(Fast), SMA(Slow), 29)
&& CrossAbove(VolRATIO(BarsArray[1], 2, 65).Plot0, Vol, 29))
{
EnterShort(DefaultQuantity, "");
}
}
//Thanks!

Comment