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

best practices in implementing bracket orders

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

    best practices in implementing bracket orders

    Hi experts

    Right now I am using this approach to implement bracket orders

    1a) EnterLongLimit() or 1b)EnterShortLimit()
    2) Wait for execution
    3) (1a) or (1b) executed
    4) In overloaded OnExecutionUpdate(), place the following bracket orders:
    4a) i) ExitLongLimit() + ii) ExitLongStopMarket() or
    4b) ii) ExitShortLimit() + ii) ExitShortStopMarket()
    5) Wait for execution of (4ai/ii) or (4bi/ii) for either profit taking or stoploss hit

    I am thinking what if at (2) my hard-disk crashed and I am not able to get back in the next 2 hours. (1a) or (1b) will be executed since order has been placed, but not (4a) or (4b) because my PC died and my Ninjascript strategy is no longer running. Ultimately I might face huge loss if market moves against me.

    Is my thought process correct? Would like to hear your input please.
    Or should I send in (4a) and (4b) together with (1a) and (1b) ? Is that a preferred approach ?
    Last edited by elirion; 01-02-2024, 09:25 PM.

    #2
    Hello elirion,

    Thanks for your post.

    Yes, that would be the best practice for submitting a profit target and stop loss order when the entry order is filled.

    Here is a reference sample demonstrating submitting protective orders using OnExecutionUpdate() and OnOrderUpdate(): https://ninjatrader.com/support/help...and_onexec.htm

    If this pertains to live orders and you see the behavior you noted, please always reach out to your broker's Orders Desk immediately to confirm and manage your live orders and positions.

    If your trade(s) are with NinjaTrader Brokerage, you can contact NinjaTrader Brokerage Order Desk by emailing orders[at]ninjatrader.com.​
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the help NinjaTrader_BrandonH

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by jxs_xrj, 01-12-2020, 09:49 AM
      6 responses
      3,290 views
      1 like
      Last Post jgualdronc  
      Started by Touch-Ups, Today, 10:36 AM
      0 responses
      8 views
      0 likes
      Last Post Touch-Ups  
      Started by geddyisodin, 04-25-2024, 05:20 AM
      8 responses
      61 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by Option Whisperer, Today, 09:55 AM
      0 responses
      8 views
      0 likes
      Last Post Option Whisperer  
      Started by halgo_boulder, 04-20-2024, 08:44 AM
      2 responses
      24 views
      0 likes
      Last Post halgo_boulder  
      Working...
      X