Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get StopLoss/ProfitTarget from order

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

    Get StopLoss/ProfitTarget from order

    When my strategy enters SetStopLoss/ProfitTarget are set for this specific order. I do safe IOrder from Enter...() and every order has a specific SignalName.

    How can I get the associated SetStopLoss/ProfitTarget from the IOrder object I safe?

    Is there no way, not even while in OnExecution(), to find the original order?
    Last edited by symphys; 05-23-2010, 05:42 PM.

    #2
    Hello,

    I think what you are after is detailed in this link:


    If that isn't what you want, can you explain? Thanks.
    DenNinjaTrader Customer Service

    Comment


      #3
      I don't want to track this stuff. Doing it will reduce performance and blow the code unnecessary.

      Since stoploss and profittarget are associated with the original order is there no way to find them?

      Also I like to change the name of the stoploss. Can that be done?

      Comment


        #4
        If you don't want to track them as Ben pointed out, please don't work with the Set methods then, as for example the Exit ones would offer you IOrder returns to simplify this.

        Comment


          #5
          Ah, thanks. That may be a solution.
          Can I use ExitLongLimit and ExitLongStop as OCO since they represent StopLoss and Profit Target?


          One question about the help:
          This method is ignored if a long position does not exist

          Can the Exit order be used right after EnterShort/LongStop?
          Or do I need to wait for execution and code it in OnExecution?
          Last edited by symphys; 05-24-2010, 11:21 AM.

          Comment


            #6
            You would need to supply the OCO functionality via your own coding, you can attach those right after the execution, please see our sample on this -

            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()

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            648 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            369 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            108 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            572 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            573 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X