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

Different strategies on one instrument

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

    Different strategies on one instrument

    Hello, quick question:
    If I would run 2 different strategies on one instrument, at some point both would be invested and one would close its position with ExitLong()
    Would the open position of the other strategy also be closed?
    Thx



    #2
    Hi fernlicht, thanks for writing in.

    Yes, we do not recommend running two strategies on the same instrument because one strategy can de-synchronize the other. The two strategies should be combined into one strategy to work around this.

    Kind regards.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      The real problem is running the two strategies on the same instrument in the same account.

      If you use two separate accounts, there is absolutely no issue.

      If you use the the same account, when strategy A is LONG 1 contract and then strategy B
      goes SHORT 1 contract, your brokerage account is FLAT. This is because your broker only
      sees BUY and SELL orders.

      Let's break it down.

      *** Strategy A - Open position 'LONG 1' send order 'BUY 1' --> Broker account is now 'LONG 1'
      *** Strategy B - Open position 'SHORT 1' send order 'SELL 1' --> Broker account is now 'FLAT'

      Huh? WTF happened? Let's dig in ...
      Strategy A thinks your account is still 'LONG 1' but you're actually FLAT at your broker.
      How so? Because your broker saw two orders 'BUY 1' and 'SELL 1' and it executes both.
      Remember each strategy manages its own strategy position independently.
      Therefore, neither strategy position truly reflects your account position.
      Because your account is FLAT after the 'BUY 1' and 'SELL 1' orders.

      To recap:
      When Strategy A enters new 'LONG 1' position it sends 'BUY 1' to the broker.
      When Strategy B enters new 'SHORT 1' position it sends 'SELL 1' to the broker.
      Broker sees both orders, executes both, resulting in your account being FLAT.
      The strategy positions are out of sync with your account position.

      Make sense?

      Let's continue executing Strategy A,

      *** Strategy A - Close position 'LONG 1' send order 'SELL 1' --> Broker account is now 'SHORT 1'

      Holy Granola, Batman! Did you see that?

      Strategy A thinks your account is FLAT but you are 'SHORT 1' at your broker!
      Why? Because Strategy A sent order 'SELL 1' to exit its position.
      But since your account was FLAT, your broker opened a new 'SHORT 1' position.

      And finally, Strategy B continues its execution,

      *** Strategy B - Close position 'SHORT 1' send order 'BUY 1' --> Broker account is now FLAT

      Hmm, you say, B closes its SHORT position, and the account position was really SHORT,
      and, so, uh, if the account position is now FLAT and both strategy positions are now FLAT,
      what's the problem?

      The PnL reflected by the two strategies will have no basis in reality -- your account is almost
      certainly poorer because it has been almost assuredly whipsawed into and out of two different
      positions. At the very least, all you've lost (hopefully) is commissions and fees.

      But the real horror happens when strategies A & B use different position sizes.
      I mean, what happens if A opens position 'LONG 2' while B opens position 'SHORT 3'?
      (I'll leave the answer as an exercise for the reader.)

      Moral of the story:
      Don't use two strategies to trade the same instrument in the same account.

      This issue is a known problem, for both manual and automated trading.
      But it's not NinjaTrader's problem, it's a problem you must learn to avoid.
      Carefully study Strategy Position vs Account Position.

      Solution:
      1. Combine both strategies into one.
      2. Or, use two separate accounts.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by ScottWalsh, Today, 04:29 PM
      0 responses
      3 views
      0 likes
      Last Post ScottWalsh  
      Started by rtwave, 04-12-2024, 09:30 AM
      2 responses
      21 views
      0 likes
      Last Post rtwave
      by rtwave
       
      Started by tsantospinto, 04-12-2024, 07:04 PM
      5 responses
      69 views
      0 likes
      Last Post tsantospinto  
      Started by cre8able, Today, 03:20 PM
      0 responses
      7 views
      0 likes
      Last Post cre8able  
      Started by Fran888, 02-16-2024, 10:48 AM
      3 responses
      49 views
      0 likes
      Last Post Sam2515
      by Sam2515
       
      Working...
      X