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 kevinenergy, 02-17-2023, 12:42 PM
        118 responses
        2,778 views
        1 like
        Last Post kevinenergy  
        Started by briansaul, Today, 05:31 AM
        0 responses
        9 views
        0 likes
        Last Post briansaul  
        Started by traderqz, Yesterday, 12:06 AM
        11 responses
        28 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by PaulMohn, Today, 03:49 AM
        0 responses
        9 views
        0 likes
        Last Post PaulMohn  
        Started by inanazsocial, Today, 01:15 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Jason  
        Working...
        X