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

breakeven in strategy. can have profit target and stop loss

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

    breakeven in strategy. can have profit target and stop loss

    i did the breakeven in my strategy from the example provided in this forum. i read that when you do the trailing stops you can't have profit target and stop loss. is this true with the breakeven?

    #2
    Hello SteveReiza,

    The sample that you are referring to is simplified to not include a profit target, if you also wanted to have a profit target you would need to use similar logic to submit another order from the last set similar to how the stop is being submitted.
    JesseNinjaTrader Customer Service

    Comment


      #3
      thanks for the reply. is there an example of this you can provide?

      Comment


        #4
        Hello SteveReiza,

        I dont know of a specific example like that, the modification would not be difficult to do. You would just submit 1 additional order from the last set that is a limit order and set the price to a price that's above the market. The trail sample and breakeven sample are long only strategies so the offsets you would use for the target would need to be above market.

        Keep in mind that while using the builder in this way the orders would not be tied by OCO so if you use a target price that is too close to the active market when the stop fills you run the risk of also filling the target. The same would happen if the target filled and then the price went down to the stop price before the order was expired.

        JesseNinjaTrader Customer Service

        Comment


          #5
          thanks for the reply. its a simple strategy. a break even. two entries, so two profit targets. and, i'd like to have a stop loss. is it the same thing. just add a limit order at that last set?

          i used average price. that's correct, right?

          or is it realized pnl?
          Attached Files
          Last edited by SteveReiza; 02-02-2024, 03:14 PM.

          Comment


            #6
            Hello SteveReiza,

            Position average price would be the price which your entry fill created, that can be used as a starting price for an offset for targets.

            The purpose of the last set in those samples is to keep the order alive until it fills, you need to keep calling the order method so it does not expire. Once the position is flat that will change the stop price variable to 0 so the final set stops being true, on the next bar update any active orders like targets would then be expired.

            JesseNinjaTrader Customer Service

            Comment


              #7
              thanks for the reply. it's a little over my head. i'll get an ecosystem developer to dial it in. unless, you can make a tutorial video

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by DJ888, Today, 10:57 PM
              0 responses
              5 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by MacDad, 02-25-2024, 11:48 PM
              7 responses
              158 views
              0 likes
              Last Post loganjarosz123  
              Started by Belfortbucks, Today, 09:29 PM
              0 responses
              7 views
              0 likes
              Last Post Belfortbucks  
              Started by zstheorist, Today, 07:52 PM
              0 responses
              7 views
              0 likes
              Last Post zstheorist  
              Started by pmachiraju, 11-01-2023, 04:46 AM
              8 responses
              151 views
              0 likes
              Last Post rehmans
              by rehmans
               
              Working...
              X