Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Reverse a bracket order

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

    Reverse a bracket order

    Hi Team...,

    I have developed a strategy wich places an entry order and after it is filled I place the embracing Stop and Target orders via OnExecution.

    By the strategy it is possible that the entry is filled or not while a reverse trigger is rising. How should I develop the reverse algo that the order cancelation and new order placement will be working perfectly?

    My current solution is that:
    1. Place an entry order as liveUntilCancel....
    2. Wait for excecution
    3. OnExecution place stop/target order....
    4. Wait for stop or target

    5 The reverse trigger raises (old entry is filled)
    --> cancel stop/traget order
    --> Exit...() closing the current entryOrder
    --> Place a new entry order
    --> Wait for a fill...

    Or is there a better way? Sometimes I get a wrong quantity, espacially if
    the close an the reverse trigger will be raising at the same time.

    NOTE: It is not a common revers system because I'M not always in the market, only if the limit orders were touched, the I'm reacting.

    Thanks for your help.
    cicondo

    PS: After reading forum comments I'm really surprised, that there is no template that shows how the ordering works for reversals. Some guy here are certainly very expirienced programmers, which doens't help in understanding the order flow in NT. And obviously there is a lack of documentation.

    #2
    cicondo, thanks for the post - this is unfortunately expected as you run into the 'Internal Order Handling Rules' when not working with market orders for your reversals - http://www.ninjatrader-support.com/H...verview36.html (*bottom section of this link*)

    So your approach is the correct one - for the false quantities at times, are you waiting for the 'Cancelled' orderstate confirmation before placing your new order set?

    For NinjaTrader 7 we'll introduce a feature called 'Unmanaged Order Submission', this will allow you to implenment your strategy in a more direct way - http://www.ninjatrader.com/webnew/NT7/NinjaTrader7.html

    New Unmanaged Order Submission
    In 6.5 some users were burdened with our "Internal Order Handling" rules. We have introduced unmanaged order submission which bypasses the convenience of our order handling layer. This lower level of programming allows you to do what you want relative to order submission/management without any limitations other than any imposed by your broker. There are only three methods, SubmitOrder(), ChangeOrder() and CancelOrder(). You then get the flexibility of managing your orders how you see fit and optionally handling rejections.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hi Betrand,

      thank's for your answer. This is helpfull.
      I think that I have to check all the states of my 3 order objects.
      At the moment I check only the stop order that this will be canceled. I think this is not enough.

      cicondo

      Originally posted by NinjaTrader_Bertrand View Post
      cicondo, thanks for the post - this is unfortunately expected as you run into the 'Internal Order Handling Rules' when not working with market orders for your reversals - http://www.ninjatrader-support.com/H...verview36.html (*bottom section of this link*)

      So your approach is the correct one - for the false quantities at times, are you waiting for the 'Cancelled' orderstate confirmation before placing your new order set?

      For NinjaTrader 7 we'll introduce a feature called 'Unmanaged Order Submission', this will allow you to implenment your strategy in a more direct way - http://www.ninjatrader.com/webnew/NT7/NinjaTrader7.html

      New Unmanaged Order Submission
      In 6.5 some users were burdened with our "Internal Order Handling" rules. We have introduced unmanaged order submission which bypasses the convenience of our order handling layer. This lower level of programming allows you to do what you want relative to order submission/management without any limitations other than any imposed by your broker. There are only three methods, SubmitOrder(), ChangeOrder() and CancelOrder(). You then get the flexibility of managing your orders how you see fit and optionally handling rejections.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Tin34, Today, 03:30 AM
      1 response
      6 views
      0 likes
      Last Post brucerobinson  
      Started by ETFVoyageur, Today, 12:52 AM
      1 response
      9 views
      0 likes
      Last Post Leeroy_Jenkins  
      Started by lollers, Today, 03:26 AM
      0 responses
      7 views
      0 likes
      Last Post lollers
      by lollers
       
      Started by aliyahany, Today, 03:16 AM
      0 responses
      1 view
      0 likes
      Last Post aliyahany  
      Started by mariajvillarrealr, Today, 02:57 AM
      0 responses
      1 view
      0 likes
      Last Post mariajvillarrealr  
      Working...
      X