Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Submitting target & stop for existing position

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

    Submitting target & stop for existing position

    My ninjascript strategy uses managed orders and I now wish to adapt it to place a limit and a stop exit orders OCO on positions that exist already.

    I read that I can't use the SetProfitTarget() and SetStopLoss() methods because they only executed at the point when the entry order is filled.

    Can I set the orders as OCO via the ExitLongStop() and ExitLongLimit() functions, if I specify the same, current fromEntrySignal on both?

    I'll be trying it out now, but it would be good to get confirmation.

    Thanks

    #2
    adamus,

    That would be the correct way to proceed, yes.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by adamus View Post
      Can I set the orders as OCO via the ExitLongStop() and ExitLongLimit() functions, if I specify the same, current fromEntrySignal on both?
      While testing my strategies scripted this way, using the fromEntrySignal for placing a bracketed limit exit and stop exit OCO, I thought I would see the OCO status reflected in the OCO column in the Orders tab in the Strategy Analyzer. However the column is totally blank.

      I do see TraceOrders logging stating that one is cancelled when the other is filled and my checks so far bear this out, so shouldn't I see something in the results column?

      Thanks

      Comment


        #4
        No, the behavior you are seeing is the correct behavior. The OCO column is filled out when you do things like Set() methods or use Unmanaged and explicitly define OCO values.
        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
        601 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        347 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        559 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        558 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X