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

NT8 Strategy Builder - Range exclusion - NO TRADE ZONE, i.e... an OR condition

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

    NT8 Strategy Builder - Range exclusion - NO TRADE ZONE, i.e... an OR condition

    No Trade Range is a common concept for BOTs but does not seem a possibility within NT8 Strategy Builder since most strategy steps would be ALL" rather than "Any" where I would call this an OR capability.

    No trade entries between CL price xx.97 to xx.03 for example.

    So a rule of only enter short if close is below x price would allow a correct entry but then there is no way to say OR above x price. And no close is ver below AND above price zone.

    Any way to create an indicator with that capability - like an S/R zone type?

    #2
    Hello JMont1,

    Yes, in your condition you can require the Close[0] price to be greater than a number OR below a number by using 'If Any' in either the condition set or in the individual group in a condition set in the Strategy Builder.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      @NinjaTrader_ChelseaB, perhaps to be clearer, the request is that in a conditions and action with "If All" on the page -- how can price close be lower than or higher than a zone. So if price is lower than 58.97, it cannot also be higher than 59.05 at the same time. But the strategy would want to enter if lower than 58.97 OR higher than 59.05.

      Any idea how to create an option or indicator like that for the "If All" Step?

      Comment


        #4
        Hello JMont1,

        This is Jim responding on behalf of Chelsea who is out of the office at this time.

        Let's say we have two conditions, Condition A and Condition B.

        If All would mean if Condition A is true AND Condition B is true, do the following.

        If Any would mean if Condition A is true OR if Condition B is true, do the following.

        So using If Any, if the price is lower than 58.97, OR if the price is greater than 59.05, do the following.

        Please let us know if you have any questions.
        JimNinjaTrader Customer Service

        Comment


          #5
          NinjaTrader_Jim Yes, that is clear - and why I am asking for assistance with a method to do it with condition "If All"

          There are other conditional statements that would also be on the step so All is required

          Comment


            #6
            Hello JMont1,

            You could create a Condition Group to accomplish this. The main Condition should be "If All" then your Condition Group which contains the conditions you mentioned would be "If Any"

            Please let us know if you have any additional questions.
            Attached Files
            JimNinjaTrader Customer Service

            Comment


              #7
              NinjaTrader_Jim That is clever -- Never knew that was possible. Thank you!

              Comment


                #8
                Is there a method or indicator that would separate out the CL handle from the cents? In the example above it is trying to NOT do any entries around the whole number price of 59.00 but the actual strategy plan would to never trade in the area of any price handle = 58.00, 59.00 60.00 so the strategy would not be concerned with the dollar value (handle) but just use the cent values of xx.97 to xx(+1).05 to avoid entry, Otherwise each instantiation I would have to input the current range zones rather than have it know to avoid all of these zones.

                I am guessing I would need an indicator for this separation of the dollar from cents but not sure if even that can be accomplished.

                Comment


                  #9
                  Hello JMont1,

                  Below are a few links to the help guide that touch on condition groups.



                  It is possible to use math and custom logic to retrieve the decimal part from a double value in an unlocked script, however this would not be possible using the Strategy Builder which is limited to left and right comparisons and cannot do math.

                  Below is a public link to a google search on getting the decimal from a double. Many coders have suggested using Math.Truncate().
                  Chelsea B.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by nandhumca, Today, 03:41 PM
                  0 responses
                  4 views
                  0 likes
                  Last Post nandhumca  
                  Started by The_Sec, Today, 03:37 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post The_Sec
                  by The_Sec
                   
                  Started by GwFutures1988, Today, 02:48 PM
                  1 response
                  5 views
                  0 likes
                  Last Post NinjaTrader_Clayton  
                  Started by ScottWalsh, 04-16-2024, 04:29 PM
                  6 responses
                  33 views
                  0 likes
                  Last Post ScottWalsh  
                  Started by frankthearm, Today, 09:08 AM
                  10 responses
                  36 views
                  0 likes
                  Last Post frankthearm  
                  Working...
                  X