The following will tell me when a signal is in effect:
|
|
Buy:=Cross(RSI(14),30); Sell:=Cross(70,RSI(14)); init:=Cum(IsDefined(Buy+Sell))=1; flag:=ValueWhen(1,Buy-Sell<>0,Buy)*2-1; flag;
|
But, when I try to filter for redundant signals, the following is missing the 1st signal:
|
|
Buy:=Cross(RSI(14),30); Sell:=Cross(70,RSI(14)); init:=Cum(IsDefined(Buy+Sell))=1; flag:=ValueWhen(1,Buy-Sell<>0,Buy)*2-1; If(flag<>Ref(flag,-1),flag,0);
|
Can anyone suggest a fix? Thanks!
--Johnathan