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 Brevo, Today, 01:45 AM
      0 responses
      6 views
      0 likes
      Last Post Brevo
      by Brevo
       
      Started by aussugardefender, Today, 01:07 AM
      0 responses
      3 views
      0 likes
      Last Post aussugardefender  
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      242 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Started by TraderG23, 12-08-2023, 07:56 AM
      9 responses
      384 views
      1 like
      Last Post Gavini
      by Gavini
       
      Started by oviejo, Today, 12:28 AM
      0 responses
      6 views
      0 likes
      Last Post oviejo
      by oviejo
       
      Working...
      X