Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with Condition builder

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

    Help with Condition builder

    Strategy: Entering on one specific price and exiting on another
    In the Strategy Wizzard Condition builder I am trying to create an entry when price crosses above a specific price number and exit when it hits a specific price target. Say an equity is trading currently at 10 and my strategy calls to enter when that equity price hits 15 (MyInput).
    I cant figure it out. Please post a screenshot of the Condition Builder to show if possible.
    Thanks.

    #2
    You would select Price Data -> Close on one side and compare it to Misc -> Numeric value on the right side. Alternatively, you can select User Defined Inputs and choose a variable you create in the previous page in the Wizard.
    Attached Files
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thank you Josh.
      How do I create the MyInput under User Defined Inputs in your screenshot?

      Comment


        #4
        Please see the tutorials in the Help Guide. http://www.ninjatrader-support.com/H...de.html?SetUp7
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Josh,
          I did watch the videos though in the video example the condition had a ... (3 dot) icon where one can click to insert the user defined input ; in our example the "Numeric Value" condition does not have the ... icon to be able to insert my user defined input, please help.
          Thanks

          Comment


            #6
            Right. Take a look at the screenshot I posted earlier. Look at the item pointed at on the lower right hand side. You want to just expand that and select your user defined input from there.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              OK Josh,
              Thank you that works real good.
              Sorry I did not realize you can leave the bottom panel blank.

              Comment


                #8
                Josh,
                Great seminar yesterday.
                Question, similar to the buy question in this thread before...I want to create a strategy condition where i sell / close a specific quantity at a specific price. Please advice.
                Thanks

                Comment


                  #9
                  Hi designer,

                  Thank you. What you want to do is in the Conditions and Actions page add an action. You want to use either an "Exit short limit" or "Exit long limit" order depending on the type of position you have open already. From there you can select the price you want and the quantity you want.
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #10
                    Thanks,
                    Would that work even if the strategy does not have a buy condition?
                    Say I just want to create an exit from an existing position.
                    Thanks again

                    Comment


                      #11
                      No. Strategies can only interact with positions created from the strategy itself.
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #12
                        I created code (attached) using the Strategy Wizzard where I set a condition to buy at spec price and sell at spec price.
                        When I implement the strategy in a chart it does not trigger the buy sometimes. Please review code if i need to adjust something pls let me know.
                        Thanks
                        Attached Files

                        Comment


                          #13
                          designer,

                          The code you provided should work. Please remember that you will only be able to sell if you had a long position already open. You will also only be able to buy when you are flat. If you already have a long position, additional long orders will be ignored.
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #14
                            I had a long position already open when i had the sell position.
                            It works sometimes not always.
                            Try this one... In the Strategy set SKF 30 min chart Buy 100 at 141.5 Sell at 166.5.
                            Thanks

                            Comment


                              #15
                              designer,

                              Unfortunately I cannot run it on my end. What you would want to do is debug your code. You will need to come out of the Strategy Wizard to do this. Please see these tips: http://www.ninjatrader-support.com/v...ead.php?t=3418


                              Please use TraceOrders = true and then print values for your GetCurrentBid() as well as your PriceSell to evaluate if your condition is true. The TraceOrders will give you a reason why your order is ignored or rejected if that is what is happening. Otherwise the Print() will tell you if you are actually submitting the order or not.

                              Please also note that your SetStopLoss() may be closing your long position before you do ExitLong(). This could also be a potential factor in why your exit is not working.
                              Josh P.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              580 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              335 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              102 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              554 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              552 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X