Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stochastics Indicator With Selective Smoothing

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Stochastics Indicator With Selective Smoothing

    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.
    Attached Files
    Last edited by KBJ; 11-04-2007, 11:41 PM.

    #2
    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.)

    Comment


      #3
      Stochastics Indicator with Selective Smoothing..

      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

      Comment


        #4
        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

        Comment


          #5
          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

          Comment


            #6
            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)
            Attached Files

            Comment


              #7
              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.

              Comment


                #8
                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 P.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by maybeimnotrader, Yesterday, 05:46 PM
                2 responses
                20 views
                0 likes
                Last Post maybeimnotrader  
                Started by adeelshahzad, Today, 03:54 AM
                5 responses
                32 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by stafe, 04-15-2024, 08:34 PM
                7 responses
                32 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by merzo, 06-25-2023, 02:19 AM
                10 responses
                823 views
                1 like
                Last Post NinjaTrader_ChristopherJ  
                Started by frankthearm, Today, 09:08 AM
                5 responses
                22 views
                0 likes
                Last Post NinjaTrader_Clayton  
                Working...
                X