Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order Handling within a Strategy

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

    Order Handling within a Strategy

    I have a strategy that I want to place a BuyStopLimit order above the current price at a stop equal to the prior bar's high and also place a SellStopLimit below the current market with a stop price at the low of the prior bar's (I am actually using a slight offset from these prices).

    The intention is to have these orders placed upon FirstTickOfBar---I am able to get the stop and limit prices to run correctly--and they are being placed upon the FirstTickOfBarr, etc. but only one of the 2 entry orders seems to be showing up.

    I happen to list the long entry order first in the code--and for some reason it seems to be placing only the long orders. I have a DOM open at the same time and can see the LongEntry Order sitting there but not the Short Order--is this the predicted behavior?

    Is it allowed by the order handling logic ("the under the hood" logic) to place 2 opposing stoplimit entry orders at the same time?

    Should both be showing in the DOM?

    Lastly will one be cancelled if the other executes?

    Since I can't seem to get both to be placed at the same time I can't test this....
    Jim-Boulder
    NinjaTrader Ecosystem Vendor - Elephant Tracks

    #2
    Hello Jim-Boulder,

    Yes, your observations are correct. In a managed automated strategy, you cannot place opposing orders at the same time. Internal order handling rules are available at this link:


    You can avoid the internal order handling rules by using the unmanaged approach to order submission.

    The order is ignored, so never actually submitted. If you use the unmanaged approach, SubmitOrder() method allows you to specify OCO. If you use the same value for this field in both orders, then the outstanding order cancels when the other fills.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      After I posted this, I moved the Short Entry order to be first--now only the short order is showing--so I assume this means the 2nd order (whichever is last) is ignored...is there a way around this?

      Just to be clear--I do NOT intend to be long and short at the same time---however, I would prefer the order persist until a new bar forms --in other words if the long is triggered first, the short entry order would remain active until a new bar is formed (at which time revised stop&limit prices would enter new orders)

      thx
      Jim-Boulder
      NinjaTrader Ecosystem Vendor - Elephant Tracks

      Comment


        #4
        Ok thanks Ryan--I was posting my 2nd posting at the same time you were posting yours--no need to respond to my 2nd post. thanks.
        Jim-Boulder
        NinjaTrader Ecosystem Vendor - Elephant Tracks

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by judysamnt7, 03-13-2023, 09:11 AM
        4 responses
        57 views
        0 likes
        Last Post DynamicTest  
        Started by ScottWalsh, Today, 06:52 PM
        4 responses
        36 views
        0 likes
        Last Post ScottWalsh  
        Started by olisav57, Today, 07:39 PM
        0 responses
        7 views
        0 likes
        Last Post olisav57  
        Started by trilliantrader, Today, 03:01 PM
        2 responses
        19 views
        0 likes
        Last Post helpwanted  
        Started by cre8able, Today, 07:24 PM
        0 responses
        9 views
        0 likes
        Last Post cre8able  
        Working...
        X