Learn
Indicators

What is and how to use CCI in Tuned Script

what is the commodity channel index? the cci is a momentum based oscillator used to help determine when an asset is reaching a condition of being overbought or oversold the cci was originally developed to spot long term trend changes but has been adapted by traders for use on all markets or time frames trading with multiple time frames provides more buy or sell signals for active traders traders often use the cci on the longer term chart to establish the dominant trend and on the shorter term chart to isolate pull backs and generate trade signals key points about the cci the cci is a market indicator used to track market movements that may indicate buying or selling; the cci compares the current price to the average price over a specific time period; different strategies can use the cci in different ways, including using it across multiple timeframes to establish dominant trends, pullbacks, or entry points into that trend; some trading strategies based on cci can produce multiple false signals or losing trades when conditions turn choppy how to add the cci to my script? below you will find a short example of using the cci in your script tunedscript //inputs length = intinput("length of the cci", 20) //indicator cci = cci(length) //plot plot(cci, "cci", "#996a15", 2, plotstyle line, 0, false) band1 = plot(seriesof(100 0), "upper band", "#c0c0c0", 1, plotstyle line, 0, false) band2 = plot(seriesof( 100 0), "lower band", "#c0c0c0", 1, plotstyle line, 0, false) fill(band1, band2, "#9c6e1b", 80, "background", false) //signal push out(never order) how to use the cci to generate buy and sell signals? for the example, we'll use the default settings length = 20 to generate signals we will use the most basic method of setting a crossover and crossunder of the zero line to generate either a long or a short crossover the zero line = long trade crossunder the zero line = short trade tunedscript //inputs length = intinput("length of the cci", 20) //indicator cci = cci(length) //conditions buy = crossover(cci, seriesof(0 0)) sell = crossunder(cci, seriesof(0 0)) //plot plot(cci, "cci", "#996a15", 2, plotstyle line, 0, false) band1 = plot(seriesof(100 0), "upper band", "#c0c0c0", 1, plotstyle line, 0, false) band2 = plot(seriesof( 100 0), "lower band", "#c0c0c0", 1, plotstyle line, 0, false) fill(band1, band2, "#9c6e1b", 80, "background", false) //signal push out(signalif(buy, sell)) so now you have learned what cci is, how to use it and how to put it in a script and generate signals from it have fun scripting!