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 nicthe, Today, 07:38 AM
        3 responses
        17 views
        0 likes
        Last Post nicthe
        by nicthe
         
        Started by samish18, Yesterday, 12:20 PM
        1 response
        12 views
        0 likes
        Last Post WaleeTheRobot  
        Started by Lancer, 01-29-2020, 10:15 PM
        6 responses
        460 views
        1 like
        Last Post neveral0n3  
        Started by Rogers101, Today, 11:30 AM
        1 response
        13 views
        0 likes
        Last Post WaleeTheRobot  
        Started by AndreiBig, Yesterday, 12:30 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_Eduardo  
        Working...
        X