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 Spiderbird, Today, 12:15 PM
      2 responses
      8 views
      0 likes
      Last Post Spiderbird  
      Started by WHICKED, Today, 12:45 PM
      0 responses
      3 views
      0 likes
      Last Post WHICKED
      by WHICKED
       
      Started by FrazMann, Today, 11:21 AM
      2 responses
      6 views
      0 likes
      Last Post NinjaTrader_ChristopherJ  
      Started by rjbtrade1, 11-30-2023, 04:38 PM
      2 responses
      80 views
      0 likes
      Last Post DavidHP
      by DavidHP
       
      Started by lorem, Yesterday, 09:18 AM
      5 responses
      18 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X