Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 geddyisodin, Today, 05:20 AM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by Max238, Today, 01:28 AM
          3 responses
          32 views
          0 likes
          Last Post Max238
          by Max238
           
          Started by timko, Today, 06:45 AM
          2 responses
          13 views
          0 likes
          Last Post NinjaTrader_ChristopherJ  
          Started by habeebft, Today, 07:27 AM
          0 responses
          5 views
          0 likes
          Last Post habeebft  
          Started by Tim-c, Today, 03:54 AM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Working...
          X