![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| NinjaScript File Sharing Discussion Discussion for shared NinjaScript files. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Mar 2007
Location: , Florida, USA
Posts: 663
Thanks: 36
Thanked 7 times in 6 posts
|
Some descriptions of the Stochastics indicator talk about a 4th variable to specify the type of smoothing to be done (SMA, EMA, WMA, etc.)
I have attached the source code for a Stochastics indicator which allows the user to select the type of smoothing that is desired on the %D plot. Refer to the following link for more info: Stochastics vs Fast Stochastics Indicator KBJ 30-Oct-2007: I've modified this post to include a screen shot of the parameters screen. 05-Nov-2007: Improved the code.
Last edited by KBJ; 11-04-2007 at 10:41 PM.
|
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Mar 2007
Location: , Florida, USA
Posts: 663
Thanks: 36
Thanked 7 times in 6 posts
|
I have just updated code, below, so the CalcMovingAverage method returns the the Indicator class, which allows more flexible use.
([re]download attachment below for details.) |
|
|
|
|
|
#3 |
|
Member
Join Date: Feb 2007
Location: , ,
Posts: 68
Thanks: 0
Thanked 0 times in 0 posts
|
That's pretty slick!.. Any chance you might some day duplicate that same change to the one Josh has posted in the forum called StochasticsOverlay (the one that lays on top of price) ? Although I would guess you probably already have loads of other projects in the que.
Happy Trading |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Mar 2007
Location: , Florida, USA
Posts: 663
Thanks: 36
Thanked 7 times in 6 posts
|
Randy,
Thanks. All kudos gratefully accepted. Unfortunately the Stochastics Overlay indicator is written in such a way that it would not be easy to merge in the code that colors in-between lines. We'll see what NT V6.5 has to offer, as there's supposed to be a way to do this kind of thing a lot easier. KBJ |
|
|
|
|
|
#5 |
|
Member
Join Date: Feb 2007
Location: , ,
Posts: 68
Thanks: 0
Thanked 0 times in 0 posts
|
Understood KBJ. Thanks for considering it and let's hope there are some new and exciting possibilities with the new 6.5 when it comes out.
Thanks again and Happy Trading, Randy |
|
|
|
|
|
#6 |
|
Senior Member
Join Date: Jan 2008
Location: Madrid, Spain
Posts: 229
Thanks: 2
Thanked 0 times in 0 posts
|
I have loaded over one chart this indicator and it worked perfectly.
However, when I opened and compiled it (whithout any modifications), showed me errors. Error code C0246. Regards. (NT version 6.5.0.10) |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Jan 2008
Location: Madrid, Spain
Posts: 229
Thanks: 2
Thanked 0 times in 0 posts
|
I have just seen the problem.
The enum declaration must be between <class definition> and <Ninja Script code generated ... > Will it be because of the version ? REgards. |
|
|
|
|
|
#8 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
No it is not because of the version of NT. Using enums generally should be declared outside the indicator class which is why you only need to declare it once for all your NinjaScript files. Do it once in any of your NinjaScripts and then you can use the enums in any file.
Josh
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Double Stochastics | NinjaTrader_Ray | NinjaScript File Sharing Discussion | 22 | 11-09-2011 03:34 AM |
| Stochastics Overlay | NinjaTrader_Josh | NinjaScript File Sharing Discussion | 18 | 08-14-2009 01:42 PM |
| Stochastics vs Fast Stochastics Indicator | KBJ | Miscellaneous Support | 4 | 10-17-2007 04:44 PM |
| RSI Smoothing | rally | Charting | 2 | 08-12-2007 01:57 PM |
| Adapative Stochastics Indicator | dgregor5 | Indicator Development | 3 | 07-19-2007 11:38 AM |