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

Trading a Live Account with 2 Different Strategies on the Same Instrument

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

    Trading a Live Account with 2 Different Strategies on the Same Instrument

    I want to trade my live account with 2 different strategies using the same instrument.

    i have one setup that works really well with going long on a 1 minute chart.
    i have another setup that works well going short on a 2 minute chart.

    I want to run them the same time on the MES (micro ES) WITHOUT them interfering with one another. Is this possible? If so, how?

    i know I could run the long strategy on the ES, and the short strategy with 10 MES contacts without them conflicting, but both of these strategies are statistically better on the MES, and I’m not sure how it works when both are running on the same contact at the same time in potentially opposite directions.

    Please advise. Thanks!
    Last edited by rjsjr64; 08-06-2020, 04:30 PM.

    #2
    Originally posted by rjsjr64 View Post
    i have one setup that works really well with going long on a 1 minute chart.
    i have another setup that works well going short on a 2 minute chart.
    Going long and short in the exact same instrument in the exact same account
    is not advisable -- uh, actually, it's simply not possible.

    Consider this:
    Strategy #1 goes LONG 10 contracts, your broker gets the order 'Buy 10'.
    After 'Buy 10' is executed you are LONG 10 at your broker.

    A few minutes later,
    You have an open position LONG 10 at your broker from Strategy #1.
    Strategy #2 goes SHORT 10 contracts, your broker gets the order 'Sell 10'.
    After 'Sell 10' is executed you are FLAT at your broker.

    See that?
    Your account at the broker is now FLAT!

    Why?
    Because Strategy #1 thinks it is LONG 10 while Strategy #2 thinks
    it is SHORT 10. But, at your broker, a 'Buy 10' followed by 'Sell 10'
    equals no position.

    This is what is known as the Account Position vs the Strategy Position.
    It's a classic conundrum experienced by newcomers to auto trading.

    Each Strategy maintains a position that only it knows about -- so when
    running 2 strategies you'll have 2 separate Strategy Positions, and when
    these positions are in the same instrument in the same account these
    orders may 'oppose' each other when executed by your broker.

    Your broker doesn't know a darn thing about your strategies. To them,
    your Buy and Sell orders all look the same, whether manual or automated.

    All the broker sees is one order connection to the one account -- so having
    two Strategy Positions LONG 10 and SHORT 10 in the same instrument
    for the same account makes no sense for one account -- your broker simply
    won't be able to do that -- since BUY 10 followed by SELL 10 means you
    are FLAT in that one account(*).

    The solution is simple:
    If you want to be LONG and SHORT in the same instrument, you will
    need to use two different accounts.

    (*) Perhaps some brokers have special mechanisms to compensate and
    might allow this -- but most do not -- ask your broker to confirm "Am I able
    to hold a long position and short position in the same instrument at the same
    time in the same account?"
    Last edited by bltdavid; 08-07-2020, 12:53 AM.

    Comment


      #3
      Thank you for the detailed explanation! I kinda figured that was the case.

      The strategies I’m using are usually not in play at the same time, but there are times when they do overlap, so that was why I was asking. In any event, the answer is to use separate accounts or separate instruments. Thanks again

      Comment


        #4
        The only way to trade the same instrument in the same account with two
        Strategy instances (same or different Strategy, doesn't matter) is this:

        You add some special code to each Strategy, such as a lock or other singular
        resource, so that neither Strategy enters a position until it first acquires the
        lock -- then it holds the lock for the entire duration of the open position --
        and releases the lock only when it exits the position.

        This would mean Strategy #2 would not be able to acquire the lock during
        the times Strategy #1 has an open position, and vice versa.

        I have used such a locking technique to do exactly what you are wanting
        to do -- and it works fine -- this locking technique prevents both strategies
        from holding a position at the same time, but allows both strategies to
        at least run at the same time. The point is: start both strategies, and
        the first Strategy to find it's trade setup is allowed to take it. The other
        Strategy is forced to skip all of it's trade setups as long as the lock is
        unavailable. This is a 'first-come, first-serve' locking technique -- when
        the lock is unavailable, a strategy cannot wait for it to become available,
        it simply forfeits that setup and returns.

        Unless you know how to code that kind of locking mechanism, you are
        best advised to open two accounts at the same brokerage. The goal
        is: one set of login credentials at one broker, but you open two different
        accounts that physically share the same login credentials. This is a
        critical organizational detail.

        You want two different accounts in NT's account dropdown list, and the
        easiest way to do that is open two accounts at the same broker. But
        you must realize this detail, and this is critical: You want these two
        accounts at the same broker exactly because you want these two
        accounts to share the same login credentials.

        Why do it that way?
        Because that kind of setup would not require a Multi Broker License,
        since this is still, technically, a single connection to a single broker.

        EDIT: The corollary is this:
        If you open two accounts at the same broker and they give you two
        different login credentials to access these two different accounts,
        you are hosed, and the MB license can't un-hose that. So, when
        you open those two accounts, do it at the same broker but also do
        whatever is necessary to make sure they're both accessible from
        the same login credentials. (Ie, two different account numbers is
        fine, but you only want one username/password for the connection
        setup -- after you connect, you'll then see your two accounts in the
        Account dropdown listbox -- allowing you to run the same Strategy
        in two different accounts without a Multi-Broker License.)
        Last edited by bltdavid; 08-07-2020, 12:59 AM.

        Comment


          #5
          Amazing! Thank you so much!

          Comment


            #6
            For the sake of clarity, one can have a strategy for 1 ES contract long, and another strategy for 10 MES contracts short, and they will not flatten each other out because they are different instruments, correct?

            Comment


              #7
              Hello rjsjr64,

              Thank you for your post.

              You may run a strategy that enters 1 long for the ES instrument and a second strategy that enters 10 short for the MES instrument. The instruments are not the same so the orders will not flatten each other out.

              Please let us know if we may be of further assistance.
              Brandon H.NinjaTrader Customer Service

              Comment


                #8
                Hmm, my father also started trading before his accounts were blocked for violating the rules of using the service. I do not understand what exactly this violates and we still could not appeal this decision and were left without 15,000 euros that the father had to withdraw from the account. As a result, we came to the conclusion that it is not worth spending time working on any dubious instruments and decided to use only fbs trading instruments. This is one of the leaders in the world of trading and I am very glad that my father came across this service and started working on it. I would advise you to try it too, but the choice is yours anyway.
                Last edited by NathanHartTGa; 12-14-2020, 05:03 PM.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by nandhumca, Today, 03:41 PM
                0 responses
                4 views
                0 likes
                Last Post nandhumca  
                Started by The_Sec, Today, 03:37 PM
                0 responses
                3 views
                0 likes
                Last Post The_Sec
                by The_Sec
                 
                Started by GwFutures1988, Today, 02:48 PM
                1 response
                5 views
                0 likes
                Last Post NinjaTrader_Clayton  
                Started by ScottWalsh, 04-16-2024, 04:29 PM
                6 responses
                33 views
                0 likes
                Last Post ScottWalsh  
                Started by frankthearm, Today, 09:08 AM
                10 responses
                36 views
                0 likes
                Last Post frankthearm  
                Working...
                X