Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help coding indicator

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

    Help coding indicator

    Hi

    I do not understand how to write the code to create the below indicator. Would any of you help, please?

    The indicator is a slight variation of the Stochastic oscillator, having two lines.

    Line 1:

    SET A = CLOSE
    SET B = MIN(CLOSE, n)
    SET C = MAX(CLOSE,n)
    SET D = A - B
    SET E = C - B
    SET F = D/E
    SET G = F*100

    Line 2:

    N-period EMA of the above line 1.

    #2
    Originally posted by Srikanth View Post
    Hi

    I do not understand how to write the code to create the below indicator. Would any of you help, please?

    The indicator is a slight variation of the Stochastic oscillator, having two lines.

    Line 1:

    SET A = CLOSE
    SET B = MIN(CLOSE, n)
    SET C = MAX(CLOSE,n)
    SET D = A - B
    SET E = C - B
    SET F = D/E
    SET G = F*100

    Line 2:

    N-period EMA of the above line 1.
    What you have written is the FastStochastics. Make a copy of the FastStochastics that ships with NinjaTrader, and change "line 61" to reference the EMA instead of the SMA. You make the copy by using the NT editor to open the file, then using the right-click menu to save the file to a different name.

    Make sure that you recompile the assembly after you make the change.

    Comment


      #3
      Many thanks, koganam. I find the readings of StochasticsFast different from what I wanted. However, for all practical purposes, the FS works just as well. Thanks for your suggestion about the EMA.


      Originally posted by koganam View Post
      What you have written is the FastStochastics. Make a copy of the FastStochastics that ships with NinjaTrader, and change "line 61" to reference the EMA instead of the SMA. You make the copy by using the NT editor to open the file, then using the right-click menu to save the file to a different name.

      Make sure that you recompile the assembly after you make the change.

      Comment


        #4
        Originally posted by Srikanth View Post
        Many thanks, koganam. I find the readings of StochasticsFast different from what I wanted. However, for all practical purposes, the FS works just as well. Thanks for your suggestion about the EMA.
        Er, no. It is EXACTLY the calculation for the FastStochastics.

        What you wrote are broken out versions of lines 53, 54 and 59 in the NT ship-code.
        Last edited by koganam; 11-26-2015, 10:12 AM.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        118 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        166 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        85 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        130 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        88 views
        0 likes
        Last Post PaulMohn  
        Working...
        X