CCI (700) indicator/strategy idea

JTrader

Guest
Messages
5,741
Likes
507
Hi

attached are screenshots in the form of an indicator for a strategy idea that I have been playing with.

I like it on the 2-minute chart with tick-by-tick indicator updates, and intrabar order generation disabled. On the 2-3 minute charts I am then able to use smaller stop-losses as there is less price action per bar.

With as long a period as 700, if you start to use timeframes above 2-3 minutes, trades, and time between trades, perhaps lasts too long for intraday trading, with days when no trades are signalled.

It is a CCI700, with the scaling fixed at -245 to 245. It buy when the price crosses above 0, and sellshort when the price crosses below 0. With these settings, about 6 trades are produced on average per 24-hours, = 2 trades per 8 hour trading session on EURUSD - GBPUSD.

With such a long length as 700, fewer trades are signalled - which suits my approach - fewer trades with more accurate signals.

After each signal at least 20+ pips are usually there for the taking within a short space of time, besides following the flat loss-making - breakeven trade signals.

I do not want to hold trades overnight.

One problem that you can see from the screenshots (and perhaps the main weakness)is that there are occassions (though they are short lived and don't result in losses above what a 12 pip stop loss can usually handle, and often might only be 3-5 pips losses when you add on a 3 pip spread) when the CCI hovers around 0, crossing backwards and forwards, before setting off in a prolonged new direction up or down. Again, having a CCI700 ensures there are less of these flat crosses than would occur with a CCI250 or CCI20 for example. A CCI 1000 for instance would result in even fewer crosses, but the number of falser crosses doesn't seem to reduce by many if at all.
With a 1000 period the the swings that result in a trend tend to laster longer, sometimes over a day, perhaps not the best for intraday trading, as you have nothing to do some days, but then if your strategy was to make more money in the end, who cares :?:
So perhaps it might be better to develop a solution that does not use a longer period than 700, but focuses on avoiding trading the false crosses :?:

For example, with a CCI700 on a 2-minute chart, over the last 1 month there have been 143 swings above and below 0. Of these, 111 have been false crosses, that do not present an opportunity to tie on any profit, but losses are typically below 10 pips. The other 32 (approx) present the opportunity to make at least 20 pips profit. Many of these presented the opportunity for 50+ pip profit, before a CCI700 swing back above or below 0.

It would be useful to have some kind of filter that attempts to restrict access to these flat signals that either result in a breakeven or small loss. But how could this be accomplished?.........[/b]I have played around with moving the entry level from 0 to -100 & 100, but this results in bigger price difference between an entry and a reversal. Also you could say that buy when CCI700 crosses above 100, sell @ below -100, and exit that trade when CCI700 crosses back below/above 100 & -100, and do not take on a reverse trade until the opposite 100 -100 level is hit. However, this does not reduce the number of flat non-profit making signals.

I have done some basic testing of a full strategy version of the indicator with external stops, profit targets, dollar trailing, and breakeven stops - to see how it would perform.

I am considering using the CCI crosses above and below 0 as the entry-exit strategy, with a discretionary profit taking exit, but with a stop-loss of sorts in place.

All constructive feedback and ideas for improvement are appreciated, particularly with regard to predicting the occurence of, managing, and avoiding/filtering out trading the flat loss making/breakeven swings.

Thanks a lot
jtrader

jtrader CCI 700 indicator code -

inputs:
Length (700),
Scale (245),
OverSold(0),
OverBought(0),
OverSColor( Cyan ),
OverBColor( Red ) ;

variables:
CCIValue( 0 ) ;

CCIValue = CCI( Length ) ;

Plot1( CCIValue, "CCI" ) ;
Plot2( OverBought, "OverBot" ) ;
Plot3( OverSold, "OverSld" ) ;
plot4(0,"0");

{ Color criteria }
if CCIValue > OverBought then
SetPlotColor( 1, OverBColor )
else if CCIValue < OverSold then
SetPlotColor( 1, OverSColor ) ;

{ Alert criteria }
if CCIValue crosses over overbought then
Alert( "indicator crosses over zero" );
if CCIValue crosses under oversold then
Alert( "indicator crosses under zero" );
 
Last edited:
Hi
As mentioned, on a 2-min EURUSD chart over one month, 111 of 143 swings above and below 0 result in false swings that lead to small losses usually. However, of these 111, 68 last for 6 two minute bars or less. Therefore one possible solution to avoiding the flat-lining crosses would be not to enter until the 7th bar of the CCI700 swing above or below 0.........
 
on a 2-min EURUSD chart over one month, 111 of 143 swings above and below 0 result in false swings that lead to small losses usually.

With costs and slip I would imagine that these small losses will become a little larger if you take this live. So for 111 losing trades will incur minimum $3400 cost and slip per lot on top of the lets say $90 * 111/lot loss so you have to cover $13390/lot in the winners to break even which means each winner has to make on average at least 34 pips.

I am not sure these stats look too encouraging. Good luck with finding the filter. Maybe you could try something like, after crossover buy a new x-bar highest high or sell a new x-bar lowest low.
 
jtrader said:
For example, with a CCI700 on a 2-minute chart, over the last 1 month there have been 143 swings above and below 0. Of these, 111 have been false crosses, that do not present an opportunity to tie on any profit, but losses are typically below 10 pips. -



How many of these losers would you avoid if you cut out the wee small hours? It's not worth trading these pairs before about 7am and, personally, I find Cable best from 7 up until about lunch time. My own strategies don't perform as well in the afternoon for some reason, although I expect others will have different experiences.

As well as finding a particular 'setup' for a trade, you also need to define when conditions are right for this setup - time of day can be part of that.

Simon
 
jtrader
Hi
As mentioned, on a 2-min EURUSD chart over one month, 111 of 143 swings above and below 0 result in false swings that lead to small losses usually. However, of these 111, 68 last for 6 two minute bars or less. Therefore one possible solution to avoiding the flat-lining crosses would be not to enter until the 7th bar of the CCI700 swing above or below 0.........

Hi Twalker
this is a proposed filter solution that i posted above. By only entering once x number of consecutive bars have closed above CCI level 0, over the last month for instance, 68 of the 111 false/flatlosing crosses would not have been traded, if i had entered after the 7th consecutive bar that closed above or below the CCI level of 0.
Does this filter approach make it sound any more promising?

Don't suppose you know off the top of your head what code could be added to the indicator in my earlier post above, in order to add this functionality do you? Would the x number of closes above CCI level of zero be declared as an input or a variable? It would be good to optimise the 7 also, allthough it does look to be about the right number having studied 8 weeks of historical.

Hi Simon

funnily enough, the overnight false crosses do not seem to be any more frequent than during the day. Although volume can become thin overnight, on the other hand trends can be established and continue until morning.
Dividing the day into 0800-1600, 1600-0000, and 0000-0800, over the last 8 weeks, there has been more or less the same number of 1 bar close crosses above and below CCI700 level of zero on a 2-minute chart. Not sure how this compares if you take the 7 consecutive closes aobve or below CCI zero level into account.

I do not propose to trade overnight, but between the hours of 7 or 8am - 4 or 6pm. I have not done any detailed testing as yet, as I don't know how to write the "7 consecutive closes above overbought or oversold" criteria into an indicator or strategy yet.

Today would have triggered one trade so far, with 40-43 pips profit available from the entry point on EURUSD. Friday was a similar story.

Thanks
jtrader.
 
Last edited:
jtrader,

You're coming at the problem the wrong way.

There are two ways to create strategies.

1) Long term, trend-following, 'fat-tail' approaches.
2) Strategies that take advantage of a particular phase/mode of the market. e.g. breakouts work in volatile markets, overbought/oversold signals in congested markets etc

1 is easy. You just get a couple of moving averages or do x day breakouts. The problem is that it's slow and expensive.
2 requires that you watch the market and identify which mode/phase it is in. Then apply the correct strategies.

Which of these is your CCI(700) looking to exploit? IMO neither. You've come up with a random indicator and looking to apply a random filter that will make your random indicator look less random. Why would CCI(700) work? You can make a case that something like MA(20) or RSI(14) would work because you know other people are looking at them. But there's no-one looking at CCI(700).

Go back to your charts. What market mode/phase are we in? Trending, congestion, highly volatile? Identify short term opportunities. Are the markets always down on Mondays? If you take the morning breakout does it always make 10 points before failing? Then design a strategy that exploits something you can see. Applying random indicators will get you nowhere.
 
Hi Twalker
this is a proposed filter solution that i posted above. By only entering once x number of consecutive bars have closed above CCI level 0, over the last month for instance, 68 of the 111 false/flatlosing crosses would not have been traded, if i had entered after the 7th consecutive bar that closed above or below the CCI level of 0.
Does this filter approach make it sound any more promising?

Don't suppose you know off the top of your head what code could be added to the indicator in my earlier post above, in order to add this functionality do you? Would the x number of closes above CCI level of zero be declared as an input or a variable? It would be good to optimise the 7 also, allthough it does look to be about the right number having studied 8 weeks of historical.

You could try somethign like that. I might approach it a little differently and look for another independent verification of a move such as a breakout as my primary signal and use this indicator as my confirmation. This is only a personal choice however. As for coding for 7 bars above/belw 0, may be more use if you turn this into a strategy and then you can see how it performs and start playing with the inputs. I do not have time right now to write the code for you but the most long winded but straight forward way is to change the indicator is

{ Color criteria }
if CCIValue > OverBought then
SetPlotColor( 1, OverBColor )
else if CCIValue < OverSold then
SetPlotColor( 1, OverSColor ) ;

to something like

if CCIValue > OverBought and CCIValue[1] > OverBought and CCIValue[2] > OverBought ...

it will not allow you to simply change it as an input but wait til you have a strategy for that.
 
zab said:
Go back to your charts. What market mode/phase are we in? Trending, congestion, highly volatile? Identify short term opportunities. Are the markets always down on Mondays? If you take the morning breakout does it always make 10 points before failing? Then design a strategy that exploits something you can see. Applying random indicators will get you nowhere.

This is the way to start. What you've got so far is just an entry trigger - you need to work out what type of market conditions you're looking to enter into & then use your trigger only when those conditions are met.

A good way to do this is to use the 'data2' functionality (where you can reference data on one timeframe before deciding whether to act in another). For instance if the hourly chart is rising from oversold conditions or support, then look for a long entry trigger on the 15 minute chart.

This way you are more likely to pick winning trades (because you've got price action on 2 timeframes both 'agreeing' with each other) and you'll have more accurate entries (better R:R ratio) as your trigger is based on the smaller timeframe.

I realise that as you're still just getting started with EL code this might all sound horribly complicated, but it's well worth learning to do these things. In a few days/weeks you'll wonder why you didn't do it sooner.

Good luck
Simon
 
you need to work out what type of market conditions you're looking to enter into

If you can work this out consistently then it should be easy to make money. It is the major problem after which the signal is the easy part. I favour a system which can operate in all conditions i.e. it is flat in uncertainty and take a trade when price action suggests direction is now less uncertain within the working time frame and system parameters.
 
jtrader said:
Hi Twalker
this is a proposed filter solution that i posted above. By only entering once x number of consecutive bars have closed above CCI level 0, over the last month for instance, 68 of the 111 false/flatlosing crosses would not have been traded, if i had entered after the 7th consecutive bar that closed above or below the CCI level of 0.
Does this filter approach make it sound any more promising?

Don't suppose you know off the top of your head what code could be added to the indicator in my earlier post above, in order to add this functionality do you? Would the x number of closes above CCI level of zero be declared as an input or a variable? It would be good to optimise the 7 also, allthough it does look to be about the right number having studied 8 weeks of historical.

Hi Simon

funnily enough, the overnight false crosses do not seem to be any more frequent than during the day. Although volume can become thin overnight, on the other hand trends can be established and continue until morning.
Dividing the day into 0800-1600, 1600-0000, and 0000-0800, over the last 8 weeks, there has been more or less the same number of 1 bar close crosses above and below CCI700 level of zero on a 2-minute chart. Not sure how this compares if you take the 7 consecutive closes aobve or below CCI zero level into account.

I do not propose to trade overnight, but between the hours of 7 or 8am - 4 or 6pm. I have not done any detailed testing as yet, as I don't know how to write the "7 consecutive closes above overbought or oversold" criteria into an indicator or strategy yet.

Today would have triggered one trade so far, with 40-43 pips profit available from the entry point on EURUSD. Friday was a similar story.

Thanks
jtrader.

Hi Jtrader
I trade the US indices using a 50CCI as part of my strategy. I'm looking at a strategy using 50 cci on a 15 min forex application. To help filter the duff trades I'll see if cci reaches +- 100 fairly quickly, if it doesn't I'll stuff in a stop @ B/E. If it reaches the hundred zone quickly I'll only exit when CCI closes below 100 (towards zero). An extra filter will be the slope (or lack of it) on a 34 EMA. Looking at your example you posted - a filter around +- 50 - 75 may be worth looking at. - HTH - Regards - Phil
 
twalker said:
If you can work this out consistently then it should be easy to make money. It is the major problem after which the signal is the easy part. I favour a system which can operate in all conditions i.e. it is flat in uncertainty and take a trade when price action suggests direction is now less uncertain within the working time frame and system parameters.

It's certainly true that identifying market conditions is the hard part, but I think it's possible to some extent when using 2 or more timeframes.

What you definitely can do is exclude certain conditions/phases that you know create lower probability trades - extreme o/b or o/s areas, or during low relative volatility perhaps. (This maybe similar to what you mean when you say 'flat in uncertainty'?)

Using these types of ideas along with an entry signal that includes price action and not just an indicator cross, I believe are the starting points for a workable strategy.
(Oh, and the exit's quite important too :!: )

Simon
 
philto37 said:
Hi Jtrader
I trade the US indices using a 50CCI as part of my strategy. I'm looking at a strategy using 50 cci on a 15 min forex application. To help filter the duff trades I'll see if cci reaches +- 100 fairly quickly, if it doesn't I'll stuff in a stop @ B/E. If it reaches the hundred zone quickly I'll only exit when CCI closes below 100 (towards zero). An extra filter will be the slope (or lack of it) on a 34 EMA. Looking at your example you posted - a filter around +- 50 - 75 may be worth looking at. - HTH - Regards - Phil

I believe jtrader is looking for a mechanical strategy. 'fairly quickly', 'stuff in a stop' 'hundred zone', 'towards zero' and 'slope' just don't make the grade.
 
zab said:
I believe jtrader is looking for a mechanical strategy. 'fairly quickly', 'stuff in a stop' 'hundred zone', 'towards zero' and 'slope' just don't make the grade.

Hi Zab - Thank you for your kind observations - silly me - when Jtrader said "All constructive feedback & ideas for improvement are appreciated" I thought mine may help. I'm sure Jtrader will understand my wording, as, like me, he must have been using CCI & it's terms for a long while. I'm also sure that Jtrader doesn't really need you as his mouthpiece & would not be so rude & destructive towards someone making a serious & (hopefully) helpful reply. I hope this doesn't start to ruin a good thread & we can all move on to discussing the original subject - Regards - Phil
 
zab said:
But note that no pm please (from the Elite thread)
a) isn't a mechanical trader
b) changes his 'strategies' every few months

Sure, but neither of those points alter why it's interesting to read his thread alongside this one.

AM
 
turtle trader -
This is the way to start. What you've got so far is just an entry trigger - you need to work out what type of market conditions you're looking to enter into & then use your trigger only when those conditions are met.

A good way to do this is to use the 'data2' functionality (where you can reference data on one timeframe before deciding whether to act in another). For instance if the hourly chart is rising from oversold conditions or support, then look for a long entry trigger on the 15 minute chart.

This way you are more likely to pick winning trades (because you've got price action on 2 timeframes both 'agreeing' with each other) and you'll have more accurate entries (better R:R ratio) as your trigger is based on the smaller timeframe.

Thanks Simon.

if you were looking to trade off a 2-minute chart, what second timeframe would you reference?

What would you be looking for on the longer timeframe before taking entries on the 2-minute chart - purely support or oversold conditions for long trades and the lack of resistance in the intended direction that your entry signal is pointing you in? How would you define support -oversold conditions on the longer timeframe - eg. through the use of a single indicator such as RSI or stochastics, or a more complex approach?

On a different but related matter, If you were to have the two data periods within a strategy for looking at trend direction, won't shorter timeframes lead longer timeframes, and if the trend continues, the longer timeframes will then also start to form the same trend direction as the shorter timeframes? So perhaps it would be illogical to say only take a long entry on 2-minute chart, if trend on 8 minute chart is up - as the 2-minute charts trend up will commence before the 8-minute charts trend up? And saying only take a long entry on 2-minute chart, if trend on 1 minute chart is up, may not be necessary, because if the 2-min chart is trending up, the 1-minute chart will be most likely trending upwards anyway? Am I making sense?

How beneficial have you found this approach to be in terms of strategy performance, as opposed to trading purely off one timeframe?

Do you achieve the 2 linked timeframes by using the ADE library in tradestation 8.1?

Thanks a lot
JT.
 
Last edited:
jtrader said:
Thanks Simon.

if you were looking to trade off a 2-minute chart, what second timeframe would you reference?

What would you be looking for on the longer timeframe before taking entries on the 2-minute chart - purely support or oversold conditions for long trades and the lack of resistance in the intended direction that your entry signal is pointing you in? How would you define support -oversold conditions on the longer timeframe - eg. through the use of a single indicator such as RSI or stochastics, or a more complex approach?

On a different but related matter, If you were to have the two data periods within a strategy for looking at trend direction, won't shorter timeframes lead longer timeframes, and if the trend continues, the longer timeframes will then also start to form the same trend direction as the shorter timeframes? So perhaps it would be illogical to say only take a long entry on 2-minute chart, if trend on 8 minute chart is up - as the 2-minute charts trend up will commence before the 8-minute charts trend up? And saying only take a long entry on 2-minute chart, if trend on 1 minute chart is up, may not be necessary, because if the 2-min chart is trending up, the 1-minute chart will be most likely trending upwards anyway? Am I making sense?

How beneficial have you found this approach to be in terms of strategy performance, as opposed to trading purely off one timeframe?

Do you achieve the 2 linked timeframes by using the ADE library in tradestation 8.1?

Thanks a lot
JT.

When i'm trading shorter TFs (5 mins is about as low as I normally go) then I use mechanical triggers but on a discretionary basis. I've not been able to 'define' the various support/resistance levels I might look for on that timescale in code, so I look for them visually & then wait for my setup to develop. This is based on index futures only, for FX i'm solely mechanical and use at least 15 min TFs.

My purely mechanical systems (both FX & Index) use at least 15 minutes for the actual entry setup, with reference to the hourly chart (to make sure that it's roughly the right sort of environment). Alternatively I'll use 30 and 240 minute charts.

The system based trades are obviously longer term with average time in trades varying from about 5 hours upto 3 days. I've never been able to produce reliable systems on shorter TFs and find the best systems are ones that keep you in a trade as the market makes a 'directional' move.

Regarding shorter TFs being in a trend sooner than longer ones - yes that is certainly true, but they also start 'false' trends more often. Referencing the longer TF is about trying to avoid these false moves. (e.g. don't go long on a 15 minute chart when the markets' about to bump its' head on the top of a major downtrend channel).

Done properly, this type of cross referencing helps improve the win %age, but the main benefit for me is more accurate entries - so I can use tighter stops & greater targets. In that respect it's helped enormously.

The way to do it in TS is using the Reserved Word 'data' - have a look in the User Guide for how to do it. To start with just right click on your chart & select 'Insert Symbol', it'll then give you the chance to input what symbol & TF you want to add. In your strategy you refer to this new data as 'data2' or 'data3' etc, depending on how many different TFs you want to use.

Give it a try, it's well worth it

Simon
 
Top