Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator or Alert?

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

    Indicator or Alert?

    Good Morning,
    I run 2 Stochastics Fast indicators on my chart in the same window, plotting only the %D lines - so I have 2 lines. I need to create an indicator or alert that displays the difference between those 2 lines. I would prefer an oscillator that would plot a line that is the difference between the 2 lines but an alert would also work - to alert me when the difference hits a certain level.

    I have not programmed indicators nor alerts before but I do have programming experience so with a tutorial I might be able to do it.

    Would you suggest an indicator or alert and do you have any help materials?

    Thanks so much
    Mark Lewis

    #2
    Hello Marklhc1988,

    Thank you for the note.

    I have attached a sample indicator that will plot the spread of two stochastics fast indicators.

    There are a few key items that make this work.

    Firstly, I set up a plot to use by calling AddPlot in State.SetDefaults (Line 50).

    Second, I set up two StochasticsFast indicators at the class level (for performance reasons) and initialize them in State.DataLoaded (Lines 30, 31, 57, and 58)

    Thirdly, I perform the calculation in OnBarUpdate starting at line 62. The Values[][] array is a collection of the plots added to the script where the first index is the plot object itself and the second index is the BarsAgo value of the plot i.e. the value for the plot at the indexed bar.

    To import the script, download the attached file and import it by going to Tools>Import>NinjaScript addon.

    Please let me know if I can assist further.
    Attached Files
    Last edited by NinjaTrader_ChrisL; 02-18-2019, 11:04 AM.

    Comment


      #3
      Hi Chris!
      Thanks so much for your quick response and for creating the indicator, I really appreciate it.

      ** Problem**

      Did you happen to create for NT8? I have NT7. In any event I downloaded the indicator and tried to import and got an error.

      Let me know,
      Thanks, Mark

      Comment


        #4
        Hello Marklhc1988,

        My apologies, I will convert the sample indicator for NT7 shortly.

        Comment


          #5
          Hello Marklhc1988,

          Thanks for your patience.

          I have added the NT7 version of the same indicator.

          Please let me know if I can assist further.
          Attached Files

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          558 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          324 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          545 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          547 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X