Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Account vs. Brokerage Account

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

    Strategy Account vs. Brokerage Account

    Josh wrote a nice primer on the difference between the Strategy Account vs. Brokerage Account.



    Here's my question. My strategy went live today (Monday). Right now, the overnight position in my brokerage account is 1 long (this is per strategy).

    When I started my strategy again, the strategy position is empty, not 1 long, which means that my strategy account is out of sync with my brokerage account.

    When I add the strategy to the chart, by default, the strategy position is empty, yet I should be able to specify the initial strategy position (e.g. 1 long) so that it will be in sync with the brokerage account (or better yet, NinjaTrader can "remember" the last position). How?

    Otherwise, I have to deal with this sync issue every morning? That's a PITA, isn't it?

    #2
    How are you acquiring the overnight long position? If it was done by the strategy and you reran it the next day it should have a strategy position in sync with your account position assuming your strategy didn't close its open position at exit.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      The strategy did the 1 long trade.

      There's no historical data for the strategy to recalculate it's position.

      For example, some of the volume indicators you've developed have no historical data. It only display volume information going forward.

      In the same way, the custom data feed for this strategy has no historical data.

      Comment


        #4
        In that case you will unfortunately need to resync it manually.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Extreamly common scenario...What can you do in this case?

          If you want your Account Position to match your Strategy Position, you will need to place a manual order into the account the strategy is running on. Continuing from the above example, you would need to place a 1-lot market order for the market being traded into the account the strategy is running on.

          What if I do not submit a manual order to sync my account?

          The resulting behavior when the Strategy Position and Account Position are out of sync is when your strategy (continuing with the example above) closes the long position with a sell order it would bring the Strategy Position to flat and your Account Position to SHORT 1.
          Unfortunately, we can't reply into Tips section, sorry for grabbing this thread, although we are on the same topic...

          1. Aren't manually "synchronizing" will still be out of sync because we can't get exact price and opening time as the strategy assumes for the live broker order?
          2. Why not to check live account and re-set open orders and positions in strategy accordingly? Do we have C# objects for that?
          3. Where is the automation if "automatic" and "automated" strategy needs periodical manual resync?
          Last edited by nintra; 05-13-2008, 05:31 AM.

          Comment


            #6
            1. The position will be in sync but you are correct in that you may have different entry prices
            2 & 3. There are many reasons why automation for synchronization is not optimal which is why we don't do it. Sorry but I don't recall all the reasons but I do recall intense discussions with development in this area.
            RayNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Ray View Post
              1. The position will be in sync but you are correct in that you may have different entry prices
              If prices don't match, how we can call that "in sync", the Size Only Matters?

              2 & 3. There are many reasons why automation for synchronization is not optimal which is why we don't do it. Sorry but I don't recall all the reasons but I do recall intense discussions with development in this area.
              My questions are more related to USER's ability to do that in its custom strategy scripts. So let me re-raise these questions as I see them one of the top priority for anyone wanting to automate NT with custom C# strategy code. If we can't do all those mentioned in my 2nd question from within a strategy code, IMHO we simply have no reliable automation with NT. Disagree? Please, confirm, thanks!

              Comment


                #8
                If you have to enter a position to sync your strategy --> 99% it will not be the price as it may have been calculated historically, this is just how it is.

                Regarding programatically synchronizing, this is on our list for future consideration.
                RayNinjaTrader Customer Service

                Comment


                  #9
                  By default, the strategy will compute the current position based on the data feed, indicators, etc. This should work the majority of the time.

                  Yet, for those of us who don't have a normal data feed or use indicators with no historical data, then we'll need a way to specify (or override) the initial position of a strategy before we start it.

                  Comment


                    #10
                    You may find writing to a text file and reading from the text file your position to work. Obviously this won't allow you to place a trade at the same entry price, but at least you know what your position is and you can make your necessary adjustments and what not.

                    There are reference samples for this. Look for StreamReader/StreamWriter.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      That is exactly what I did last night.

                      The strategy reads the text file for the current position. And writes the new position, if any.

                      Comment


                        #12
                        Wanted: Software Architect for the commercial product

                        Originally posted by NinjaTrader_Ray View Post
                        If you have to enter a position to sync your strategy --> 99% it will not be the price as it may have been calculated historically, this is just how it is.

                        Regarding programatically synchronizing, this is on our list for future consideration.
                        2 & 3. There are many reasons why automation for synchronization is not optimal which is why we don't do it. Sorry but I don't recall all the reasons but I do recall intense discussions with development in this area.
                        Yeah, instead of clean API methods we adviced to use stream reader/writer as ugly workaround...

                        Sorry, the only conclusion I can draw from all that above is just that.
                        Something is wrong and/or left undecided on the application's architecture level with NT accounts idea/implementation. Guys, NT just seems to be not yet ready for the prime time automation, unfortunately.

                        Comment


                          #13
                          nintra,
                          It's not that bad.

                          If my indicator had historical data, then the strategy is able to determine the position (when the strategy is added to the chart).

                          But, in my case, my indicator doesn't have historical data. It's not based on price. It's based on volume going forward.

                          To NinjaTrader's credit, NinjaTrader can handle 99% of the AT scenarios using strategies/indicators. In my case, my scenario is 1%.

                          Comment


                            #14
                            Come on

                            Originally posted by mgbloomfield View Post
                            nintra,
                            It's not that bad.

                            If my indicator had historical data...
                            mgbloomfield,
                            The reliable ATS just shouldn't guess the real live market positions and pending orders from some data feed. Its just plain wrong and stupid. What if one running multiply strategies on the same trading account and also doing some manual scalping or low frequency investor's trades? How do you think a data feed would help to manage anything? Instead, at any time, there has to be the clearly documented programmatical way to query all the trading live account(s) positions and orders. Do you think it's just me spoiled by over expensive competitor's software? (Not!) It's just the straight and logical way for any platform that want to be called as suitable for real world autotrading. I don't asking for bells and whistles, just provide the standard abilities to query trading account and syncronize any strategy, with automatic strategy running and broker connection made on startup... I guess that's not coming with NT 6.5. If the team isn't mentally challenged or lazy to keep the business, they would want NT to survive as the product, they will have to provide those abilities in NT version 7.0 or just drop the word "automatic" with corresponding 80% price cut.
                            Last edited by nintra; 05-15-2008, 01:31 AM.

                            Comment


                              #15
                              Just want to say that I strongly agree with the people here who are asking for a clean way to be able to resync Strategy Account with Brokerage Account.

                              I'm still working on a strategy and have not yet reached the stage of live autotrading, so I have no real live experience yet how likely it would be for the accounts to go out of sync. However, the consequences of that happening could be so severe that this is really my greatest worry.

                              I would simply not use NT for autotrading without some kind of safety net that enables me from within my strategy to correct an out of sync condition as soon as it occurs.

                              Getting this fixed should be top priority for NT.
                              Last edited by FireFly; 05-15-2008, 05:12 AM.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by NullPointStrategies, Today, 05:17 AM
                              0 responses
                              50 views
                              0 likes
                              Last Post NullPointStrategies  
                              Started by argusthome, 03-08-2026, 10:06 AM
                              0 responses
                              126 views
                              0 likes
                              Last Post argusthome  
                              Started by NabilKhattabi, 03-06-2026, 11:18 AM
                              0 responses
                              69 views
                              0 likes
                              Last Post NabilKhattabi  
                              Started by Deep42, 03-06-2026, 12:28 AM
                              0 responses
                              42 views
                              0 likes
                              Last Post Deep42
                              by Deep42
                               
                              Started by TheRealMorford, 03-05-2026, 06:15 PM
                              0 responses
                              46 views
                              0 likes
                              Last Post TheRealMorford  
                              Working...
                              X