I can see from this example that it's pretty easy to pass a secondary bars object to a NT indicator (CCI):
protected override void OnBarUpdate()
{
// Checks to ensure all Bars objects contain enough bars before beginning
if (CurrentBars[0] <= BarsRequired || CurrentBars[1] <= BarsRequired || CurrentBars[2] <= BarsRequired)
return;
if (BarsInProgress == 0)
{
if (CCI(20)[0] > 200 && CCI(BarsArray[1], 20)[0] > 200
&& CCI(BarsArray[2], 20)[0] > 200)
{
// Do something
}
}
}
For example, if the condition was:
if (Opens[0][0] < MyCustomIndicator(Period, StdDevThresh).VSLow[0]
&& Position.MarketPosition != MarketPosition.Long)
{
EnterLong(amount, "EnterLongOpen");
}
CCI(BarsArray[1], 20)[0]
Thanks

Comment