Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

sync account position

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

    sync account position

    Is there a way to code "if long order with label X is open and (condition is met on chart), then close X"?
    Right now my code only says if there is an open long and condition is met, then close X.
    Last edited by werido; 03-11-2013, 08:46 PM.

    #2
    werido, yes you can tie for example an exit order to a specific entry signal via the signal names provided in the method overloads - http://www.ninjatrader.com/support/h...tlonglimit.htm
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      werido, yes you can tie for example an exit order to a specific entry signal via the signal names provided in the method overloads - http://www.ninjatrader.com/support/h...tlonglimit.htm
      Is there a way to code a market order exit for order X that triggers only when order X is open? I could only see limit orders in that link.

      Comment


        #4
        That was just an example, any order type would offer 'listening' to signal name, such as ExitLong / ExitShort Market orders as well.

        BertrandNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          That was just an example, any order type would offer 'listening' to signal name, such as ExitLong / ExitShort Market orders as well.

          http://www.ninjatrader.com/support/h...htsub=ExitLong
          The problem I'm having is that I have many exit orders for many entry orders but I only want the exit order for the specific entry order that is live to be triggered. Although having all the exit orders triggered will also close the specific entry order, I have an email signal sent out when the exit gets triggered and I'm getting many emails when the one live entry gets closed. So is there away to code a parameter that only if order X is live (or Long) then exit and send email?

          Comment


            #6
            werido, the SendMail() calls you do would be realtime only, so historical orders / executions would not be 'hit' then. Do you send yourself an email on each incoming execution then? That could be multiple ones for a given order. You could move that to an update in the Position state for example to send only a single confirmation.

            If you wanted to check for a specific order and it's properties / state, then the IOrder objects would be needed to reveal this level of detail - http://www.ninjatrader.com/support/h...ightsub=IOrder
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by funk10101, Today, 09:43 PM
            0 responses
            6 views
            0 likes
            Last Post funk10101  
            Started by pkefal, 04-11-2024, 07:39 AM
            11 responses
            37 views
            0 likes
            Last Post jeronymite  
            Started by bill2023, Yesterday, 08:51 AM
            8 responses
            44 views
            0 likes
            Last Post bill2023  
            Started by yertle, Today, 08:38 AM
            6 responses
            26 views
            0 likes
            Last Post ryjoga
            by ryjoga
             
            Started by algospoke, Yesterday, 06:40 PM
            2 responses
            24 views
            0 likes
            Last Post algospoke  
            Working...
            X