Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

colored stochastics smoothed

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

    colored stochastics smoothed

    When i compare a Ninja chart with stochastics to a stochastic chart that is created in Ensign i see at times big differences.

    i think the stochastics are calculated differently in both programs

    in Ensign:
    Formula
    Raw stochastic is the percentage of where a price is in a range of highest high - lowest low over a set of bars. Some call the raw value Fast %K.

    Raw Stochastic = 100 * (Last - LowestLow) / (HighestHigh - LowestLow).
    Slow %K is an average of the Raw Stochastic. Some call this first average Fast %D.
    Slow %D is an average of the Slow %K. This is the 2nd average.
    Ensign Windows has 4 choices of which formula to use for calculating the averages. The average used for the original Stochastic work was an exponential moving average. However, variations using simple average, weighted average and smoothed average are also worthy and useful Stochastic calculations.

    The smoothed average formula is very similar to the exponential formula. The difference is in how the Alpha decay factor is derived from the average parameter N. See these formulas:
    Exponential = Previous Average + ((Current Value - Previous Average) / Alpha)
    where Alpha = (N+1)/2
    Smoothed = Previous Average + ((Current Value - Previous Average) / Alpha)
    where Alpha = N
    The parameter N is greater than or equal to 1. If the parameter entered is less than 1, then invert the parameter using N = 1 / parameter.
    Ensign Windows does not do a 3rd average. If an average of the Slow %D is wanted, then put on a moving average study and set its Data Point to be the %D value of the Stochastic study.

    see; http://ensign.editme.com/stochastic end of page

    im searching for the smoothed stochastics.

    How is stochastics calculated in Ninja?
    Is it possible to create the smoothed stochastics with different colors for rising and falling?

    Thanks

    #2
    You can review the code of the Stochastics by opening it up in the NinjaScript Editor. If you want to make any changes you can feel free to make them and save it as a new indicator.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      thanks for the reply.

      im not a programmer.
      all i want to know is how the stochastics in Ninja is calcaluated.
      is it the same as the formulal i posted?
      Can you help?
      thanks

      Comment


        #4
        The way Stochastics is calculated in NinjaTrader is outlined by the math formulas outlined here: http://tadoc.org/indicator/STOCH.htm

        Take note that what you posted is smoothed via EMA. NinjaTrader uses SMA. As far as which MA style to use, there is no set guideline.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          thanks, that can be the difference im looking for sma/ema



          i tried to edit existing script, saved it in a new file
          but when i compile i get 20 errors, see below

          what is it what im doing wrong ?
          Thanks for the help

          NinjaScript FileErrorIndicator\stochsmoothcolor.csThe type or namespace name 'IndicatorBase' could not be found (are you missing a using directive or an assembly reference?)Indicator\colorstochastics2.csThe type or namespace name 'colorstochastics2' could not be found (are you missing a using directive or an assembly reference?)Indicator\colorstochastics2.csThe type 'NinjaTrader.Indicator.Indicator' already contains a definition for 'cacheColorStochastics'Indicator\colorstochastics2.csThe type 'NinjaTrader.Indicator.Indicator' already contains a definition for 'cacheColorStochasticsFast'Indicator\colorstochastics2.csThe type or namespace name 'colorstochastics2' could not be found (are you missing a using directive or an assembly reference?)Indicator\colorstochastics2.csThe type 'NinjaTrader.Indicator.Indicator' already contains a definition for 'checkColorStochastics'Indicator\colorstochastics2.csThe type 'NinjaTrader.Indicator.Indicator' already contains a definition for 'checkColorStochasticsFast'Indicator\colorstochastics2.csThe type or namespace name 'colorstochastics2' could not be found (are you missing a using directive or an assembly reference?)Indicator\colorstochastics2.csType 'NinjaTrader.Indicator.Indicator' already defines a member called 'ColorStochastics' with the same parameter typesIndicator\colorstochastics2.csThe type or namespace name 'colorstochastics2' could not be found (are you missing a using directive or an assembly reference?)Indicator\colorstochastics2.csType 'NinjaTrader.Indicator.Indicator' already defines a member called 'ColorStochastics' with the same parameter typesIndicator\colorstochastics2.csType 'NinjaTrader.Indicator.Indicator' already defines a member called 'ColorStochasticsFast' with the same parameter typesIndicator\colorstochastics2.csType 'NinjaTrader.Indicator.Indicator' already defines a member called 'ColorStochasticsFast' with the same parameter typesColorStochastics.csThe type 'NinjaTrader.Indicator.Indicator' already contains a definition for 'cacheColorStochastics'ColorStochastics.csThe type 'NinjaTrader.Indicator.Indicator' already contains a definition for 'cacheColorStochasticsFast'ColorStochastics.csThe type 'NinjaTrader.Indicator.Indicator' already contains a definition for 'checkColorStochastics'ColorStochastics.csThe type 'NinjaTrader.Indicator.Indicator' already contains a definition for 'checkColorStochasticsFast'ColorStochastics.csType 'NinjaTrader.Indicator.Indicator' already defines a member called 'ColorStochastics' with the same parameter typesColorStochastics.csType 'NinjaTrader.Indicator.Indicator' already defines a member called 'ColorStochastics' with the same parameter typesColorStochastics.csType 'NinjaTrader.Indicator.Indicator' already defines a member called 'ColorStochasticsFast' with the same parameter types

          Comment


            #6
            Please ensure you have not made two copies.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              no only 1 copy

              the original is colorstochastics
              the copy is colorstochastics2

              Comment


                #8
                That is likely why. Your second one is still using all of your same things as your first. Please delete one.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  hmmm

                  how must i read your previous post:

                  " You can review the code of the Stochastics by opening it up in the NinjaScript Editor. If you want to make any changes you can feel free to make them and save it as a new indicator."

                  Comment


                    #10
                    Not sure what your question is. Your colorstochastics issue is completely different. That is not a system indicator and I cannot give you any advise on it. From a system indicator stand point you can make changes and right click->save as. I could not tell you how a 3rd party indicator might work.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      oh ok , i told you im not a programmer....

                      all i want is stochastics in 2 colors and calculated via ema
                      like the ensign formula

                      looks like mission impossible for someone without programmer skills


                      thanks for the help

                      Comment


                        #12
                        As a last resort you could try one of the 3rd party NinjaScript Consultants here: http://www.ninjatrader.com/webnew/pa...injaScript.htm
                        Josh P.NinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by funk10101, Today, 12:02 AM
                        1 response
                        10 views
                        0 likes
                        Last Post NinjaTrader_LuisH  
                        Started by GLFX005, Today, 03:23 AM
                        1 response
                        6 views
                        0 likes
                        Last Post NinjaTrader_Erick  
                        Started by nandhumca, Yesterday, 03:41 PM
                        1 response
                        13 views
                        0 likes
                        Last Post NinjaTrader_Gaby  
                        Started by The_Sec, Yesterday, 03:37 PM
                        1 response
                        11 views
                        0 likes
                        Last Post NinjaTrader_Gaby  
                        Started by vecnopus, Today, 06:15 AM
                        0 responses
                        1 view
                        0 likes
                        Last Post vecnopus  
                        Working...
                        X