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 charlesugo_1, 05-26-2026, 05:03 PM
            0 responses
            59 views
            0 likes
            Last Post charlesugo_1  
            Started by DannyP96, 05-18-2026, 02:38 PM
            1 response
            143 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 05-11-2026, 05:56 AM
            0 responses
            161 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 05-10-2026, 08:12 PM
            0 responses
            97 views
            0 likes
            Last Post CarlTrading  
            Started by Hwop38, 05-04-2026, 07:02 PM
            0 responses
            276 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Working...
            X