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

X number of bars.

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

    X number of bars.

    How would I code this in the Strategy Builder? If RSI was greater than 80 in any one or more of the last 10 bars.

    Can Indicators be built too in NT8?

    Thanks.

    #2
    Hello,

    Thank you for the post.

    You could use a Group condition for this type of logic in the strategy builder.
    • When in the Condition and Action Editor select Group and leave if Any selected.
    • In the group editor, you would need to add 10 conditions to check the RSI for the number of BarsAgo needed.
    • In the Condition, you would add the following
    • Indicators -> RSI
    • Set the Bars Ago to 0 for this RSI
    • in the Center choose Greater Than
    • On the right choose Misc -> Numeric Value and enter 80.


    You would need to repeat this and add another RSI but now select 1 for the BarsAgo and repeat this up to 10 BarsAgo.

    If any of the conditions within 10 bars becomes true, this overall group condition would become true.

    You can also create your own indicators in the platform as well.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      So if I want to go back 20 or 30 bars I need to do this each time for a bar? There is no like a shortcut for this? Like do the condition in one statement itself?
      Thanks.

      Comment


        #4
        Originally posted by Trader17 View Post
        So if I want to go back 20 or 30 bars I need to do this each time for a bar? There is no like a shortcut for this? Like do the condition in one statement itself?
        Thanks.
        Think logically.

        If the RSI, at some time within the period, were to have been bigger than 80, then it means that all you need to do is determine if the maximum value of the RSI within the period is bigger than 80. In other words, use the MAX() class.

        ref: http://ninjatrader.com/support/helpG...aximum_max.htm

        Comment


          #5
          Thanks. This is done directly in the code, correct? I am not familiar with it too well yet. Can this be done in the Strategy Builder too?
          Thanks.

          Comment


            #6
            Originally posted by Trader17 View Post
            Thanks. This is done directly in the code, correct? I am not familiar with it too well yet. Can this be done in the Strategy Builder too?
            Thanks.
            From my quick glance, as you can access indicators from the Strategy Builder, I would expect that you should be able to do it in the Strategy builder. MAX() is an indicator, not a method.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Perr0Grande, Today, 08:16 PM
            0 responses
            2 views
            0 likes
            Last Post Perr0Grande  
            Started by elderan, Today, 08:03 PM
            0 responses
            3 views
            0 likes
            Last Post elderan
            by elderan
             
            Started by algospoke, Today, 06:40 PM
            0 responses
            10 views
            0 likes
            Last Post algospoke  
            Started by maybeimnotrader, Today, 05:46 PM
            0 responses
            9 views
            0 likes
            Last Post maybeimnotrader  
            Started by quantismo, Today, 05:13 PM
            0 responses
            7 views
            0 likes
            Last Post quantismo  
            Working...
            X