# Thread: CCI Stoch Signal Indicators

1. ## CCI Stoch Signal Indicators

Here are 2 indicators that I've been working on -- one based on CCI, the other on the Stochastic Oscillator. The basic idea of the indicators is to generate buy/sell signals, based on parameters that define the signal. Up/Down arrows are placed on the indicator window to indicate buy/sell.

In terms of calling these indicators with iCustom(), they return:

0 = Neutral
-1 = Sell

The hope is that by having indicators that simply return buy, sell or neutral, EA logic can be simplified and concentrate on order management, regardless of the signal generators (i. e., technical indicators) employed. So, aside from the value of these indies as a trading system, the notion of normalizing the signal interface from an indicator to the EA may have wider use.

StochSignalIndy:

Mode=0 for iCustom()

extern double KPeriod = 5;
extern double DPeriod = 3;
extern double Slowing = 3;
extern double MAMethod = 0;
extern double PriceType = 0;
extern double Threshold = 3; // Divergence before signal is set

CCISignalIndy:

Mode=6 for iCustom()

extern double CCIPeriod = 14.0;
extern double OverBought = 200; // sell signal threshold
extern double OverSold = -200; // buy signal threshold

To use them, I've been taking the CCISignalIndy as the leading indicator, then the StochSignalIndy as the confirmation, if it agrees within 5 bars. You can change the behavior by altering the threshold variables.

Here's a picture:

Hope someone finds these useful.

MM

2. Hi MusicMan,

Thanks for sharing your system. Here is an EA.

3. I have been playing with this EA all day.

I found EURUSD 1H - default - with breakeven set at 50 pips produces a nice graph.

However I think the EA is missing one factor. Anyone have any idea what it could be?

4. In my tests, if does 84% wins... and over 90% on the longs... but the loss trades are bigger than the win trades, which drags down the profit. I think I need to just watch it trade in visual mode and see if I can come up with a 3rd factor that will perhaps reduce those few-but-large losers.

Funyoo's order management is way better than mine. This EA does much better with these indicators than the ones I've been playing with!

Thanks,

MM

5. Actually, I think what it's missing is a center signal zone for CCI. Right now, it takes only the extreme over-sold, over-bought signals. It should also generate signals when it crosses the middle line, or even rebounds off the middle line with and angle of at least 45 degrees (or perhaps a parameter to set the slope). This would make more trades, which might also improve profit.

I'll see what I can do, although if there is some center-line crossing and slope-calculating code around somewhere as an example, it might help.

MM

6. Here is the version of CCISignalIndy that signals on crossing the zero line -- Buy if the line crosses going up, sell if it crosses going down. This behavior is controlled by the crosses argument -- 1 to turn it on, 0 to turn it off.

To pass this extra argument, I have extended EA as well.

MM

7. Here is a version of the CCISignalIndy and CCIStockSignal EA that includes parameters to filter cross signals based on the slope of a number of bars in the past when the cross happens. The parameters are minslope and runbars, defaulted to 30 and 5 respectively.

Now we can have cross signals with no filter by setting minslope to zero, or we can set minslope and runbars values and only get cross signals when the slope is steep enough to indicate a strong direction.

I am not done testing yet to determine the best values for these.

Also, if you just want the over-bought and over-sold signals without cross signals, set crosses to zero.

MM

8. i think it needs to limit its trades, not make more of them.

9. Certainly, it needs to limit its losing trades.

On the center crossing signals, they can easily be turned off with crosses=0. However, they can add to winning trades, particularly when the market is going sideways with the right range.

Ranging markets are really what this combination is good at. The CCI over-bought and over-sold indicators are always going to be the reverse of a strongly trending market. Funyoo's EA has the "reverse" feature, but markets that range for a while, then trend for a while, could make that a bit hard to manage.

What we really need is an EA with both a range-trading and trend-trading strategy, plus the ability to recognize which to use when. Perhaps one of these multi-timeframe MA indicators can tell the difference? Not sure.... but it's worth investigating.

MM

10. Originally Posted by MusicMan
Certainly, it needs to limit its losing trades.

On the center crossing signals, they can easily be turned off with crosses=0. However, they can add to winning trades, particularly when the market is going sideways with the right range.

Ranging markets are really what this combination is good at. The CCI over-bought and over-sold indicators are always going to be the reverse of a strongly trending market. Funyoo's EA has the "reverse" feature, but markets that range for a while, then trend for a while, could make that a bit hard to manage.

What we really need is an EA with both a range-trading and trend-trading strategy, plus the ability to recognize which to use when. Perhaps one of these multi-timeframe MA indicators can tell the difference? Not sure.... but it's worth investigating.

MM

could use Slope Direction Line.mq4 to filter in trending conditions? An FFCal type news filter would also be of benefit.