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 gbourque, Today, 06:39 AM
        0 responses
        2 views
        0 likes
        Last Post gbourque  
        Started by cmtjoancolmenero, Yesterday, 03:58 PM
        1 response
        17 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by benmarkal, Yesterday, 12:52 PM
        3 responses
        23 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by helpwanted, Today, 03:06 AM
        1 response
        20 views
        0 likes
        Last Post sarafuenonly123  
        Started by Brevo, Today, 01:45 AM
        0 responses
        12 views
        0 likes
        Last Post Brevo
        by Brevo
         
        Working...
        X