Hello,
With the help of Mr.William of formulas@equis I tried to fashion an exploration where for 5 consecutive bars the Bollinger Bands are inside the Keltner Channels and after being there for 5 consecutive bars they move outside the Keltner Channels.
The indicator code (named TTM William)for the Bollinger Bands moving outside the Keltner Channels after being there for 5 consecutive bars is
A:=BBandTop(C,20,S,2);
B:=(Mov(C,20,E)+(ATR(10)*1.5));
Z:= BBandBot(C,20,S,2);
G:=(Mov(C,20,E)-(ATR(10)*1.5));
X:= Sum(A<B AND Z<G, 6) = 6;
signal:= Ref(X, -1) AND (A>B OR Z>G);
{Plot}
signal
The 5 bars in question are coded thus
A:=BBandTop(C,20,S,2);
B:=(Mov(C,20,E)+(ATR(10)*1.5));
Z:= BBandBot(C,20,S,2);
G:=(Mov(C,20,E)-(ATR(10)*1.5));
X:= Sum(A<B AND Z<G, 6) = 6;
signal:= Ref(X, -1) AND (A>B OR Z>G);
{Plot}
Ref(signal,+1)
The integer 1 is changed to 1,2,3,4 and 5 for each instance and 5 indicators are coded TTM1 TTM2 TTM3 TTM4 and TTM5 respectively
The final indicator and Exploration (plugged in Filter) is
Fml( "TTM William") =1 AND Fml( "TTM 1") =1 AND Fml( "TTM 2") =1 AND Fml( "TTM 3") =1 AND
Fml( "TTM 4") =1 AND Fml( "TTM 5") =1
But neither does the indicator plot (though the 6 individual indicators plot successfully) a binary wave and the exploration says 'results of exploration not defined on calculation date ' (load minimum records deselected)
Where am I going wrong
Can anyone help?
Regards,
Dr.Chatterjee