Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Profit target in a strategy

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

    Profit target in a strategy

    In the condition builder, I want to enter the value for the profit target as follows:

    If long, sell when the close 0 is lower than the low of highest bar
    If short, sell when the close 0 is higher than the low of the lowest bar.

    How?

    If not possible to do in condition builder, can you please give the code that i can just insert in the code of existing strategy. Thanks.

    #2
    Hi ju1234,

    Yes, you can create custom conditions taking you flat on the 'Conditions and Actions' screen of the wizard - http://www.ninjatrader-support.com/H...rdScreens.html

    Please illustrate your trading logic a bit more, so we can make recommendations on the realization.

    Thanks!

    Comment


      #3
      OK, now i have a simple strategy which has the condition stochastic cross over action enter long. Now to set a profit target on that long position i want to set in the "Profit target and stop price" screen of the wizard a condition which should exit my long position whenever subsequent to the long entry, the clocing price of the current bar closes below the low of the the bar which is highest since the long entry. Similar set for the short side.

      I know how to use the wizard but don't know how to construct these profit criteria.

      Specific instructions would be appreciated. Thanks.

      Comment


        #4
        ju1234,

        If you have a specific logic you want the profit trigger to hit at instead of just a certain amount of ticks or percentage from your entry price then you want to go back to your Conditions and Actions page and create the condition through a new Set. Put in your logic and then tell it to do an ExitLong().
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Thank you Josh. Here is the problem: I would choose price close of current bar on the left, choose < , on the right I am not sure what? How would i choose and "low of the highest high bar since long entry"? I am not even sure if it can be done through the wizard. Is there a code you can write for this whole thing that I can just add to my other strategy. Thanks.

          Comment


            #6
            Hi ju1234,

            Please take a look at this thread here, where a custom stop loss value was developed for use in the wizard - http://www.ninjatrader-support2.com/...ad.php?t=11609

            Comment


              #7
              I think this thread is perhpas not the correct one, i did not see anything about stop loss.

              Comment


                #8
                ju1234,

                It shows you logic on how to get highest high. You need to take it from there yourself. Add your own ExitLong or ExitShort action.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Thank you josh,

                  I know the "Highest High" but I am trying to figure out how I should write "the low of the bar which constitutes the highest high bar".

                  Low[0] < Low of Max(high,20)[0].

                  In this condition the "Max(High,20)[0]" component tells the strategy that in the last 20 bars the bar that is highest. I want the current bar to be less than the low of that bar. So please tell me how I can write the "low of " part of this condition.

                  Thank you and sorry if i am harping on the same question.

                  Comment


                    #10
                    You want to just use HighestBar() instead then. http://www.ninjatrader-support.com/H...ighestBar.html

                    That will give you a bar index that you can put into Low[].
                    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
                    627 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    359 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    105 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    562 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    567 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X