Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

StopLoss/Profit Targets for Unmanaged Orders

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

    StopLoss/Profit Targets for Unmanaged Orders

    Hello, I can successfully place OCO limit orders using the unmanaged methods. However, I'm now working on applying stoploss and profit target orders in place after one of the OCO orders is triggered.

    First, how do I determine which of the two OCO limit orders was triggered? One is call AlphaLong and the other is called AlphaShort.

    Second, what is the proper syntax for submitting a stoploss and profit target OCO order for my current position?

    Thanks

    #2
    Hello,

    You can use an IOrder object to read the name of the order and also check the state of the order:



    You can check these orders states in OnOrderUpdate() or OnExecution() to get the most current state of the order.

    Please also see our Reference Sample on Using OnOrderUpdate() and OnExecution() methods to submit protective orders:

    The OnOrderUpdate() and OnExecution() methods are reserved for experienced programmers. Instead of using Set() methods to submit stop-loss and profit target orders, you can submit and update them manually through the use of IOrder and IExecution objects in the OnOrderUpdate() and OnExecution() methods. The OnOrderUpdate()


    Please let me know if you need further assistance.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Thanks. This solved my problem.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      86 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      48 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      29 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      32 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      67 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X