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

How to create a false condition in builder

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

    How to create a false condition in builder

    Good morning team, how can I create a condition if high 52 < high 45 and high 18 < high 12 not to enter a long? Thank you in advance

    #2
    Hello aalonzo17,

    Thank you for your post and welcome to the NinjaTrader forum community!

    This could be done using a bool variable that changes between true or false depending on whether you want to allow a long entry or not. I'm not sure which values you are referencing when you mention "high 52 < high 45 and high 18 < high 12" - please clarify what the numbers represent. Are those the number of bars ago that you are checking the High price for or are they perhaps indicator periods?

    Once I have more information from you, I would be glad to provide some screenshots as an example of how you could toggle a bool based on your desired condition.

    I look forward to your reply.
    Emily C.NinjaTrader Customer Service

    Comment


      #3
      Hi Emily! Thanks for the fast response. Right, the numbers I'm referring to represent bars ago.

      Comment


        #4
        Originally posted by aalonzo17 View Post
        Hi Emily! Thanks for the fast response. Right, the numbers I'm referring to represent bars ago.
        Thanks for clarifying!

        First, you would need to set up the bool on the Inputs and Variables screen. Here I have set up a bool called AllowLong that defaults to be true:Next, you would need to configure your condition that sets the bool to false. Here are some screenshots of a set where I set up the condition as you have described and configured the action to set AllowLong to be false:You would also need a set that checks for conditions when you want AllowLong to be set to true again. I have created a set with the opposite; it checks if the High from 52 barsAgo is greater than the High from 45 barsAgo AND if the High from 18 barsAgo is greater than the High from 12 barsAgo. If so, it sets AllowLong to true:Finally, you need your set that enters a long condition. In this case, I have a condition that simply checks if the position is flat and if AllowLong is true. If so, the action is to enter a long position via market order:For additional resources related to the Strategy Builder, including a webinar on our YouTube channel and some examples of common conditions and actions, please see the links below:Please feel free to reach out with any additional questions or concerns.
        Emily C.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by lightsun47, Today, 03:51 PM
        0 responses
        2 views
        0 likes
        Last Post lightsun47  
        Started by 00nevest, Today, 02:27 PM
        1 response
        8 views
        0 likes
        Last Post 00nevest  
        Started by futtrader, 04-21-2024, 01:50 AM
        4 responses
        41 views
        0 likes
        Last Post futtrader  
        Started by Option Whisperer, Today, 09:55 AM
        1 response
        13 views
        0 likes
        Last Post bltdavid  
        Started by port119, Today, 02:43 PM
        0 responses
        8 views
        0 likes
        Last Post port119
        by port119
         
        Working...
        X