Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

"Immediately Submit Historic Live Orders" - why/when is it relevant and useful

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

    "Immediately Submit Historic Live Orders" - why/when is it relevant and useful

    I've read the HelpGuide and am still confused on why "Immediately Submit Historic Live Orders" is different from WaitUntilFlat when SyncAccountPosition=False, and why they are useful. For example, I have a simple strategy (CalculateOnBarClose=True, 1minute Period, SyncAccountPosition = False because i have another Short strategy running on the same instrument).

    If (Buy Condition), EnterLongLimit(Close[0] - ATR(10)[0]);
    If (Sell Condition), ExitLongLimit(Close[0] + ATR(10)[0]);

    Let's assume the bar data ..
    Previous bar: Close=$100, Close+ATR = $101
    Current bar: Close=$101, Close+ATR = $102

    If I activate my strategy at Current bar with "Immediately Submit Historic Live Orders" setting and it already holds a historic position (from backtesting), what's the behavior - will it
    (A) try to chase the previous bar and place a live Sell order at $101, which would execute immediately because the current price is $101. How many bars back does it go to place a live order?
    (B) place a live order at current bar reference $102.

    2) I believe intra-bar execution required and helpful for this? Is it to "chase" orders only within the current bar?


    3) When SyncWithAccountPosition=False, in what situation is "Immediately Submit" option useful? The strategy will never know if it's in sync with the account and fire off orders immediately once activated, which may always be out-of-sync, leading to account degradation. (With Wait Until Flat option, i may have time to manually reset the Account position if it's out-of-sync, before the strategy places live orders.

    4) Likewise ImmediatelySubmit with SyncAccountPosition=True also seems like a bad idea because it will flatten the account immediately (at a sub-optimal price) and then fire off its orders.

    Overall, it seems like SyncWith AccountPosition=True with WaitUntilFlat is the only safe option where I ensure against Account losses. Is this assessment correct?

    thx
    Kiran

    #2
    Hello Kiran,

    Thank you for your inquiry.

    Can you please clarify what you mean by "If I activate my strategy at Current bar with "Immediately Submit Historic Live Orders" setting and it already holds a historic position (from backtesting), what's the behavior"? As backtesting has no affect on a live strategy, any positions held in a backtest have no standing when running a strategy live.

    For questions 3 and 4:
    I would suggest reading this entry (http://ninjatrader.com/support/helpG..._positions.htm) in the NinjaTrader help guide that will detail how a strategy will behave at startup for the following conditions:
    • Wait until flat before executing live, Sync account position = false
    • Wait until flat before executing live, Sync account position = true
    • Immediately submit live working historical orders, Sync account position = false
    • Immediately submit live working historical orders, Sync account position = true


    I would also suggest reading this entry about the differences between a strategy position and an account position: http://ninjatrader.com/support/helpG..._account_p.htm
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ZacharyG View Post
      Hello Kiran,
      Can you please clarify what you mean by "If I activate my strategy at Current bar with "Immediately Submit Historic Live Orders" setting and it already holds a historic position (from backtesting), what's the behavior"? As backtesting has no affect on a live strategy, any positions held in a backtest have no standing when running a strategy live.
      What i mean is a strategy run also runs through recent history and may hold virtual Strategy Positions and issue virtual Orders (virtual because they're not in the real account. Question is reg the "Immediately Submit Historic Orders" setting
      - does this cause the strategy to re-submit historic virtual orders in the real account? How far back do the re-submissions go - only current bar historic orders or previous bars historic orders?
      - I see this feature as being more harmful than useful as the current price may no longer be valid for submitting stale orders in a real account. In what situations does this feature help vs hurt?

      Originally posted by NinjaTrader_ZacharyG View Post
      For questions 3 and 4:
      I would suggest reading this entry (http://ninjatrader.com/support/helpG..._positions.htm) in the NinjaTrader help guide that will detail how a strategy will behave at startup for the following conditions:
      • Wait until flat before executing live, Sync account position = false
      • Wait until flat before executing live, Sync account position = true
      • Immediately submit live working historical orders, Sync account position = false
      • Immediately submit live working historical orders, Sync account position = true


      I would also suggest reading this entry about the differences between a strategy position and an account position: http://ninjatrader.com/support/helpG..._account_p.htm
      I've read these and my assessment is as follows
      - SyncAccountPosition=False seems dangerous when auto-trading as it requires the userto constantly monitor the account to ensure strategy is in sync
      - SyncAccountPosition=True is also dangerous with Immediately SubmitHistoric Orders based on my argument above, as stale orders are issued against the live account.
      - The only setting that's safe is WaitUntilFlat and SyncAccountPosition=True. But here, the strategy has to wait until the historic position flattens, and it loses trading time.
      1) Are these conclusions correct or am I missing something?
      2) The ideal setting is to have the strategy NOT run historically and set SyncAccountPosition=True. This forces the strategy to start with a Flat position and keep the Account in sync while it runs. The user can also ensure a Flat account position before activating the strategy in this mode. How do i activate a strategy without a historic run?

      Kiran

      Comment


        #4
        Hello Kiran,

        Depending on if sync account position is true or false, immediately submit live working historical orders will:
        • Sync account position = true:
          • If the Account Position matches your Strategy Position, no reconciliatory order will be submitted. The strategy will then begin managing your Strategy Position immediately.
          • If the Account Position does not match your Strategy Position, NinjaTrader will submit a market order(s) at the current price to reconcile the Account Position to match your Strategy Position. The strategy will then begin managing your Strategy Position immediately. For instance, if your strategy position is 1L and your account position is flat, an enter long will be executed on your account so that the account position matches the strategy position.

        • Sync account position = false:
          The strategy will be in a live position without waiting to close a historical position, however, this may not match your current account position.


        Please read this link for further information about syncing account positions: http://ninjatrader.com/support/helpG..._positions.htm

        If you would like a strategy to not run on historical data, you can use the following code:
        Code:
        protected override void OnBarUpdate()
        {
             if (Historical)
                  return;
             else
             {
                  // strategy logic
             }
        }
        For more information about the Historical boolean, please take a look at this link in the NinjaTrader help guide: http://ninjatrader.com/support/helpG...historical.htm

        I would suggest running a strategy on the Sim101 account with the various sync account position / wait until flat before executing live / immediately submit live working historical orders options to experiment.
        Zachary G.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by zstheorist, Today, 07:52 PM
        0 responses
        3 views
        0 likes
        Last Post zstheorist  
        Started by pmachiraju, 11-01-2023, 04:46 AM
        8 responses
        149 views
        0 likes
        Last Post rehmans
        by rehmans
         
        Started by mattbsea, Today, 05:44 PM
        0 responses
        5 views
        0 likes
        Last Post mattbsea  
        Started by RideMe, 04-07-2024, 04:54 PM
        6 responses
        33 views
        0 likes
        Last Post RideMe
        by RideMe
         
        Started by tkaboris, Today, 05:13 PM
        0 responses
        5 views
        0 likes
        Last Post tkaboris  
        Working...
        X