LKB, make sure you delete "plot Data = close;
Then cut and paste the following into the NewStudy window. I just tried it and got no errors. This is Gloe's work below :
#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);