InvestorsHub Logo
icon url

gloe

01/03/12 4:58 PM

#60127 RE: LKB Trader #60125

The thing that I have worked on most is trying to modify the WoodieCCI indicator. If you look at the WoodieCCI indicator and look at the code for it, you will see how complicated it is. It is a collection of several "paintbars" that show up in various places in the CCI panel itself. After alot of time, all I succeeded in doing was to change some colors and some of the default line thickness to suit my preferences. I tried to delete alot of code for stuff I don't use (like the SW and the CZI), but I always ended up with "RED CODE" that tells you you have a mistake and so the indicator will not work AT ALL. So I won't post that.

I'll post the HFE paintbar. This is really taken directly from TOS RSIWilderCrossover study. I just changed the RSI to CCI, changed the threshold to -200 (for the default) and changed the color of the arrows. You need to put 2 of these in your charts, as is the case with all the crossover studies: one is for UP (the default) and then you need a second one to change to DOWN.


#HFE CCI 14 Identifies when the CCI 14 has a Hook from Extreme (HFE): a hook from overbought or oversold, by finding when the CCI has crossed over or under a specified value. Values below -200 indicate an oversold position; Values above +200 indicate an overbought position.
#Length: The number of bars used to calculate the CCI (Default is 14)
#crossingType: Defines whether to apply the study when the CCI has gone above or below the specified threshold and then recrosses the threshold (Default is above)
#threshold: Index value to be crossed (Default is -200)

input length = 14;
input crossingType = {default above, below};
input threshold = -200;

plot signal = Crosses(CCI(length = length).CCI, threshold, crossingType == crossingType.above);

signal.DefineColor("Above", GetColor(4));
signal.DefineColor("Below", GetColor(4));
signal.AssignValueColor(if crossingType == crossingType.above then signal.color("Above") else signal.color("Below"));

signal.SetPaintingStrategy(if crossingType == CrossingType.above
then PaintingStrategy.BOOLEAN_ARROW_UP
else PaintingStrategy.BOOLEAN_ARROW_DOWN);

####################################