Reduce the number of buy and sell signals from indicator?


0
0

Hi! Im trying to reduce the number of buy and sell signals triggering from this custom indicator i’ve created from CCI Average indicator in TOS. Im wanting to have only the initial signal and no more duplicates before a new signal is created. Here is the code im working with so far..

declare upper;

 

input cciLength = 14;

input cciAvgLength = 9;

input over_sold = -100;

input over_bought = 100;

 

def CCI = CCI(length = cciLength);

def CCIAvg = Average(CCI, cciAvgLength);

def OverBought = over_bought;

def OverSold = over_sold;

 

plot UpSignal = CCI crosses above oversold;

plot DownSignal = CCI crosses below overbought;

 

UpSignal.SetDefaultColor(Color.UPTICK);

UpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

DownSignal.SetDefaultColor(Color.DOWNTICK);

DownSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

Attachments:
Marked as spam
Posted by (Questions: 1, Answers: 0)
Asked on February 3, 2020 11:19 am
671 views
0
Private answer

There are no duplicate signals in this indicator. Your indicator is showing each solitary instance in which the CCI crosses overbought and oversold. This is the exact nature of the CCI and to change this means you are no longer using the CCI as the basis for your signals. Your screenshot does not show the time frame, the ticker symbol applied to the chart and does not display the CCI study under the price graph. When you post a screenshot, all of those elements are required.

Because your screenshot also does not mark which signals you want to remove we are completely dead in the water here. I suspect what you want is to remove all green arrows until a new red arrow appears. Likewise you want to remove all red arrows until a new green one appears.

Well that is simply not the way the CCI works. If you try to remove those signals you have completely broken the entire purpose of the indicator. I suggest you reimagine how you want to do this. Perhaps a moving average computed from the CCI. Then instead of CCI crossing overbought and oversold you could count only when the CCI crosses it's moving average. But the CCI is so choppy I doubt there will be any value to that method.

Marked as spam
Posted by (Questions: 37, Answers: 4116)
Answered on February 4, 2020 8:47 am