Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Help

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

    Strategy Help

    Can someone tell me how to make reference to a peak or dip in an RSI value in a strategy?

    thanks for your time.

    #2
    safetrading,

    That is tricky. You need to objectively set out and define what a peak is and what a valley is. When you come up with objective rules then you can program it with the Strategy Wizard. It would just be a matter of comparing prior bar's values with the next bar's value to determine if it is up or down.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the reply. I understand how to reference different values from one bar to the next to create a peak or dip, but what I don't understand is how to refernece that in time. For example, I could say a peak made by the preceding bar being less than the current bar, and next bar is also less than the current bar.

      Now we have a peak, but how do I reference that point in time whether is is one bar ago, or 5 bars ago?

      Originally posted by NinjaTrader_Josh View Post
      safetrading,

      That is tricky. You need to objectively set out and define what a peak is and what a valley is. When you come up with objective rules then you can program it with the Strategy Wizard. It would just be a matter of comparing prior bar's values with the next bar's value to determine if it is up or down.

      Comment


        #4
        From programming you can set yourself a variable that records what bar the peak was formed and then you can just access this variable whenever you need it.

        Code:
        if (....... peak logic)
             peakOccurence = CurrentBar;
        Now you know which bar it occured on. If you wanted to access the price of this bar in the future you can now do something like this:
        Code:
        Close[CurrentBar - peakOccurence]
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Thanks, I'll give it a try.

          Originally posted by NinjaTrader_Josh View Post
          From programming you can set yourself a variable that records what bar the peak was formed and then you can just access this variable whenever you need it.

          Code:
          if (....... peak logic)
               peakOccurence = CurrentBar;
          Now you know which bar it occured on. If you wanted to access the price of this bar in the future you can now do something like this:
          Code:
          Close[CurrentBar - peakOccurence]

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          633 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          364 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          567 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          568 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X