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 DannyP96, 05-18-2026, 02:38 PM
        1 response
        27 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        117 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        69 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        226 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        414 views
        0 likes
        Last Post CaptainJack  
        Working...
        X