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 argusthome, 03-08-2026, 10:06 AM
        0 responses
        74 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        45 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        26 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        32 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        61 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X