Thanks
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Creating Stochastics of CCI
Collapse
X
-
Hi designer,
Thanks for the post. Please tell us at what step you run into trouble following the tutorial and we will gladly assist you. Here is the tutorial link - http://www.ninjatrader-support.com/H...verview22.htmlJosh P.NinjaTrader Customer Service
-
Hi Josh,
I am trying to create an indicator which is the Stochastics of the CCI. I was able to create all the parameters from the wizzard but when I get to the code portion i'm not sure where to insert the code from the CCI and the Stochastics. I guess I have to insert the CCI code...
Thanks
Comment
-
Hi designer,
First you will have to create a DataSeries object, because the Stochastics takes only a DataSeries input. In the Variables section add
Then in the Initialize addCode:private new DataSeries cciValue;
Then you can use the Set() method to fill the DataSeries in the OnBarUpdate sectionCode:cciValue = new DataSeries(this);
Finally you can create your Stochastic CCI calculationCode:cciValue.Set(CCI(Close, MyPeriod)[0]);
Please also review this link -Code:double stochCCI = Stochastics(cciValue, MyPeriodD, MyPeriodK, MySmoothingPeriod)[0];
Comment
-
Hi designer,
Please check out the following thread, the indicator posted there should give a good starting point for what you want to do -
Originally posted by designer View PostThanks,
Do you suggest a similar indicator I can use as a template for the NT code?
Comment
-
Would I be able to use the StochRSI code (attached)and just replace RSI with CCI in the code?
ThanksAttached Files
Comment
-
I don't see why not. It should work fine. I have replaced RSI with CCI in indicators before and it was very simple and effective.
Comment
-
Hi,
Yes, this indicator can easily be modified to produce a Stochastic CCI.
Your minimum, maximum and rsi sets would then look like this -
Of course for better style you would want to change the PeriodRSI variable name into PeriodCCI (in the Variables and Properties sections), same with the rsi.Set dataseries.Code:[FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]minimum.Set( MIN(CCI(PeriodRsi), LookBack)[[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]]);[/SIZE][/FONT] [SIZE=2][FONT=Courier New]maximum.Set( MAX(CCI(PeriodRsi), LookBack)[[/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]]);[/SIZE][/FONT] [SIZE=2][FONT=Courier New]rsi.Set( CCI(PeriodRsi)[[/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]]);[/SIZE][/FONT] [/SIZE][/FONT]
Originally posted by Elliott Wave View PostI don't see why not. It should work fine. I have replaced RSI with CCI in indicators before and it was very simple and effective.
Comment
-
Thanks,
I was able to paste your CCI code as shown below (see attachment) then i saved it but when I try to import the saved file into the chart i do not see it in the Indicators list...please check if i placed in the right location.
ThanksAttached Files
Comment
-
You would then have to debug the error, I would not know what the problem is since its not my code.
Here is a help resource that may provide some guidance - http://www.ninjatrader-support2.com/...ead.php?t=3418RayNinjaTrader Customer Service
Comment
-
Hi designer,
Please check out this debugged and commented code of the StocCCI and let me know if you have questions.
Originally posted by designer View PostRay thanks I did as sugested but get the following errors in lines 50-56
Error CS0103
ThanksAttached Files
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
599 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
345 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
558 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
558 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment