Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Account vs. Brokerage Account

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

    #16
    My workaround solution... I'm going to describe my workaround solution for scenarios where your automated trading strategy holds overnight positions.

    In my case, at the end of the day, when the strategies are shut down, it doesn't remember the last position. So, when the strategies are added to the charts the next morning, the initial position is empty (rather than 2S or 2L, etc.)

    I split my long/short strategy into two strategies: MyStrategyLong and MyStrategyShort

    MyStrategyLong executes long orders and MyStrategyShort executes short orders.

    There's a text file that contains an integer to indicate the current position. It is either -2 | 0 | 2

    My strategy trades a fixed 2 contracts per long/short side.

    Each strategy reads the text file. Depending the current position and the strategy signals, it will or will not execute orders. After each order is executed, it writes the new current position. The position in each strategy will increase during the day, each strategy never gets a realized PnL but my brokerage account has realized PnL.

    So far, it has worked for the past two days.

    It's not ideal. There's still a risk that my client-side current position is different than the brokerage-side current position. Otherwise, the trades have executed as expected with the correct positions on both sides (client and server).

    I couldn't sit around waiting for NinjaTrader to fix this problem. I need to make money so this is the solution I came up with.

    I join others in requesting NinjaTrader to fix this.

    Comment


      #17
      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.
      Do we have a confirmation that the upcoming NT7 will programmatically synchronize between the Strategy account and the Brokerage/Clearing account?

      I hope NinjaTrader agrees that this is a very high priority.

      If I use the patsystems API directly, I can get real-time position updates. If I trade using NinjaTrader's strategies, the strategy position will be out of sync when the paysystems data feed is disconnected (and reconnected when the strategy is restarted).

      Comment


        #18
        Hi mgbloomfield, unfortunately I cannot provide additional info, but improvement in this area will be made with NinjaTrader 7. Thanks!

        Comment


          #19
          @mgbloomfield: Can you use patsystem api inside NT?

          I already told developers that as it is NT can't be used for "pro" trading.
          What if i have a power failure, i need to reboot my pc, some hardware breaks?
          And daily pats disconnection?
          You can only work intraday as it is (There is not yet an auto reconnect on pats!! You need to restart NT manually or you lose all data feed and the next day your indicators will go mad).

          Automated trading is just that. You can come back without problems 99.99% of times.

          Comment


            #20
            Originally posted by skynetman View Post
            @mgbloomfield: Can you use patsystem api inside NT?

            I already told developers that as it is NT can't be used for "pro" trading.
            Correct. NinjaTrader never claimed to be a platform for 100% hands-free automated trading. And they should not.

            Originally posted by skynetman View Post
            What if i have a power failure, i need to reboot my pc, some hardware breaks?
            Exactly. But NinjaTrader is not designed to reboot your pc, not designed to notify the Geek Squad. And it should not.

            Originally posted by skynetman View Post
            And daily pats disconnection?

            You can only work intraday as it is (There is not yet an auto reconnect on pats!! You need to restart NT manually or you lose all data feed and the next day your indicators will go mad).
            The forced disconnection is Patsystem's problem. Not NinjaTrader's. However, I agree that an auto-reconnect feature is greatly desired.

            Comment


              #21
              Harsh! But he has a point

              I think your points are valid, but your disposition seems a bit harsh.

              Nothing is perfect and while this is a CRITICAL area of concern (no doubt and I can understand your frustration), you also have to consider that many platforms (I have used a few) have both good and bad.

              Anyway, this is a thread that might be of help to you in the meantime. Let's try to be more supportive. I for one and very grateful to have a platform that I can develop on without having to shell out a small fortune. Furthermore, I am not stuck with a signal broker. I can move my system to any broker (just about as Ninja is widely supported and increasing brokers annually if not more) and that has a value to me. Anyway, check out this link as it might help.




              Also, I'm new, but maybe there is a command/console command that will let you fire up Ninja and preload a script/strategy? If you build one master strategy or something of the like, that loaded all your strategies, and it could be called from the console, then that might be key. Not sure about the re-connect though, that is a MAJOR bummer. You really need to look at the box quite often and that (for me) could hurt performance and I might want to make changes discrectionarily, lol. Ideally, set and forget is ideal once you get your strategy tweaked. Let's give Ninja some support as they are doing their best. Your tone just seemed hostile, albeit I can understand your frustration. Anyway, I hope that code from the thread above leads somewhere. Heck, if you REALLY wanted to do what you are talking about, you could just do some keyboard macros that fire via an email. Poll an IMAP box looking for certain code in subject or whatever and then fire keyboard macro that would reconnect your connection.

              Yes, it's ugly, but it will get you where you need to go. NT will address this and account syncing, just be patient.

              Originally posted by nintra View Post
              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 r2kTrader; 02-20-2009, 05:04 PM.

              Comment


                #22
                @r2KTrader: i've used ninjatrader for real live trading with my VERY real money for a year, and i can tell you that i don't sleep well knowing that i can't trust it and that i need to be in front of my pc at least EVERY day at the same hour. Else i will suffer data loss and my indicators for the next day will be wrong.

                Another software i bought (for less than NT) has something called "disconnect at" "reconnect at". It automagically shuts down pats connection at the time i want and reconnects it half an hour later without need for restart. And is a lot simpler than NT as is used to execute trading systems on collective2 (something a lot simpler than creating strategies and indicators locally as NT does).

                I even lost money for a connection problem that NT could not solve leaving my trades open with no data to manage them. And it was not a DSL or pc problem cause this other software managed to restore the feed (and they use both pats API!!)
                IT should check for incoming data feed and restart itself if something is wrong....
                Besides when you restart it you have to manually tell your strategy how many contracts you are long or short because it can't know.

                All problems known for over a year now, waiting for 7....
                Last edited by skynetman; 02-20-2009, 07:02 PM.

                Comment


                  #23
                  Skynetman,

                  thanks for the reply. As per my last post and regarding your concern with account/strategy sync, please see:



                  You will find it interesting. I would also appreciate your findings.

                  I started a new thread for this issue.
                  DIV P { MARGIN: 0px } http://www.ninjatrader-support2.com/...0&goto=newpost

                  My idea is to have a service running which polls either a local file, or IMAP account or something of the like. We could then run a keyboard macro of some kind to manually reset an account that is not connecting. Ugly, absolutely. Do they need to resolve this, absolutely. Are your points well taken? Absolutely. Do we need to bash a company that is providing a tremendous resource for a tremendous value, absolutely not.

                  Let's be constructive and work with what we have. From what I can tell, the support team is very responsive and I am sure they don't brag among themselves about the connection and sync issues, lol. I am sure they understand the importance of this and I am sure it's a priority. Regarding real money and trading with NT, obviously it's providing some level of value for you, so please try to be constructive.

                  Listen, don't get me wrong. I get furious every time I try to search on the forums and I have to wait 20 secs. I feel like a child being punished, lol. Or I can't use a search with 3 letters. Nothing is perfect. But your concerns are spot on. I'm just looking for more constructive solutions than bashing the platform and those who are trying to help us. I figure that for what I am getting, the least I could do is be constructive and courteous. When I go live (soon, very soon) and I have money on the line, then perhaps I won't be a gentle in my requests or suggestions, lol. From that perspective, I hear you. Anyway, check out that post I put on, and please feel free to join us on the thread regarding connectivity issues and a service/keyboard macro solution. It's clunky, but if it saves you some hours of sleep, then maybe it's worth it until we get to the next level on NT.

                  Thanks for the reply and your interest in this issue. Your input is invaluable in that you are working with real capital. So thanks.

                  Originally posted by skynetman View Post
                  @r2KTrader: i've used ninjatrader for real live trading with my VERY real money for a year, and i can tell you that i don't sleep well knowing that i can't trust it and that i need to be in front of my pc at least EVERY day at the same hour. Else i will suffer data loss and my indicators for the next day will be wrong.

                  I even lost money for a connection problem that NT could not solve leaving my trades open with no data to manage them.
                  IT should check for incoming data feed and restart itself if something is wrong....
                  Besides when you restart it you have to manually tell your strategy how many contracts you are long or short because it can't know.
                  All problems known for over a year now, waiting for 7....

                  Comment


                    #24
                    I know that we have one of the best customer care around.
                    Never found some guys so prompt and kind to reply to everything we throw at them.
                    In fact i'm not talking about people but only about tech issues....
                    But "I will forward this on to development for further consideration." means nothing if you don't specify a bug ticket # or a date for the fix or who it has been assigned to....
                    Boys we want a BUG TRACKER!!! (See http://www.ninjatrader-support2.com/...ad.php?p=78133 )


                    If the weren't so good, why do you think i bought a lifetime license?
                    Last edited by skynetman; 02-21-2009, 03:44 AM.

                    Comment


                      #25
                      Skynetman,

                      Lifetime license = best deal going. I fully intend to do same. My primary concerns as of this writing are:

                      1. Connections dropping while a strategy is running.

                      2. Strategy positions syncing with broker positions.

                      It is my belief, and understanding, that these are both high priority issues with NT and I believe that they will have these issues resolved.

                      NINJA - Idea for you. Consider setting up a VPS (Virtual Private Server) service which is dedicated to hosting Ninja platform.

                      I would be more than happy to pay a monthly fee for a VPS solely dedicated to my NT system. By doing this as a VPS service, you could house many clients on one box. You could also design the software to be more hosted specific and structure for multiple system development by sharing certain code that may now be loading mulitple times.

                      So picture clients running their NT on a windows VPS and supported with multiple and redundant fees.

                      Additionally, NT could offer support services to help debug systems for an additional fee. A hosted solution would be a great recurring revenue source and help build the all to important cash flow model upon which any successful depends.


                      Regards,


                      R2Ktrader

                      Comment


                        #26
                        HotAutoKey - Reconnects Flawlessly!

                        Skynetman,

                        I have good news regarding the reconnect issue. I downloaded and played with HotAutoKey. It is amazingly simple.

                        I just did my first script and saved it to a file. It worked FLAWLESSLY.

                        This is the code it auto generated for me and it worked straight away even when control was minimized:

                        IfWinNotActive, Control Center - Default, Limit Price:, WinActivate, Control Center - Default, Limit Price:
                        WinWaitActive, Control Center - Default, Limit Price:
                        Send, {ALTDOWN}f{ALTUP}db{ALTDOWN}f{ALTUP}cb


                        The db is the first letter for Disconnect and b is the first letter for Barcharts (my connection). So I did a disconnect/reconnect. WORKED PERFECT! So now I just need to setup a loop in HotKey to poll a file religiously and then I can streamwrite to that file in the event I want to trigger a reconnect.

                        One thing I can say right off the bat is this. If you are a serious trader who is using NT with real money, you will probably want a dedicated box running and as such I would recommend renting a windows based server from a hosting provider. You get bullet proof connectivity and all the benefits of a power reliability and backups. You then have your box setup so that NOTHING runs except Ninja and your AutoHotKey program. This way you can be assured less complications when you need your macro to run. You can get a dedicated box as a VPS for like 39.00 per month and that includes huge bandwidth, etc. This also assures you don't have to have that system used for anything other than NT. And finally, you can access your box from anywhere and do so conveniently. I would have it set to close all ports and then use a port-knocking sequence to open the remote port for access (this if you want to know about port knocking, let me know. What it does is close your box to the outside world unless a certain sequence is dialed. I recommend this as I would not leave money hanging by my front window just because the door is locked. Rather I would only let the money hang by the window if I was the only one who could see the window, copy??).


                        This will be a big help for you. Please join us in the thread and share your scripts.

                        http://www.ninjatrader-support2.com/...0&goto=newpost
                        Last edited by r2kTrader; 02-22-2009, 10:00 AM.

                        Comment


                          #27
                          @r2ktrader: With patsystem it's quite different. You have to restart the whole ninjatrader if you disconnect manually (NT limitation with pats).
                          And you can't simply close and start NT with a script, because you don't know how much it takes to shut down (even minutes sometimes) so you would have to check if the process in memory is gone before starting it again.
                          Besides if something goes wrong and you do not disconnect properly, you have to call the broker for an account reset, else you can't login anymore.....
                          Last edited by skynetman; 02-24-2009, 07:13 AM.

                          Comment


                            #28
                            Well, so much for trying to centralize this issue under a common thread :-(

                            Anyway, this type of feedback would have been helpful under the other thread I started.

                            This is a cause for yet another level of additional concern. While one could setup the macro to completely shutdown NT and restart it and load the system and actually have it load an order, it is not "simple" by any stretch. There are then things that can go wrong when the macro fires. Sure, one could send screenshots as to where NT is at after the macro runs and alert the programmer/manager if assistance was needed and how the macro facilitated said, but at some point NT needs to face up to the fact that if it is truly an auto-trading platform, that it needs to address these issues as its number one priority (in my opinion, which means little to the rest of the world I'm sure ;-)

                            So Skynetman, I am afraid I have come to realize that much of what you were saying is more than true. As I spend more time digging into this issue, I see no straight forward or well thoughout kludge for dealing with this issue. So let me be the first to applaud you for your patience in your posts. Had I been live and trading with real money, I think I would have been far harsher than you ever were.

                            Be that as it may. I started another thread about this and I want to know if ANYONE is trading round the clock without major issues. Anyone. This morning I watched my macro fire up and reset Barchart.com, but then I had to manually redo the Strategy. Then consider that even if I recorded a macro, the screen has to be set perfect as the mouse is all based on xy coords. Thus one little shift of the screen would not allow the macro to run properly. In other words, there is no pure keystroke sequence (that I know of) that will let me start a strategy, it can only be done with the mouse generally speaking. So if I had to do a complete shutdown and restart of NT, then I am screwed for the most part.

                            1. can you fire up a strategy with parameters feed from the command line / in a shortcut?

                            2. is there a way to fire up a strategy using just keystrokes. (more reliable for a macro / automated kludge solution.

                            3. Does NT consider itself a "black box" capable trading solution? Does it consider itself ready for fund level management?

                            The more I dig into this issue, the more taken back I am by the lack of artificial intelligence to deal with these most critical of issues.

                            So what am I missing? Constructive replies only. Please convince me I am missing something. If it's just that NT is not really a true auto trading solution and it's priced right for the value you receive, etc., that's fine. I'm already sold on that. Rather I want to know if this should be considered for autotrading real money for real periods of time and IF SO, who is doing so now and how can we get feedback regarding how they have overcome these obsticles.

                            Sorry in advance if I have offended anyone.

                            thanks again,


                            r2kTrader

                            Originally posted by skynetman View Post
                            @r2ktrader: With patsystem it's quite different. You have to restart the whole ninjatrader if you disconnect manually (NT limitation with pats).
                            And you can't simply close and start NT with a script, because you don't know how much it takes to shut down (even minutes sometimes) so you would have to check if the process in memory is gone before starting it again.
                            Besides if something goes wrong and you do not disconnect properly, you have to call the broker for an account reset, else you can't login anymore.....

                            Comment


                              #29
                              Yes, I believe you can script it to shutdown and restart. That's actually easy. you just put in a do while loop until the window is there then you feed the keystrokes. That's not my primary concern. Rather it's restarting the strategy after you go live. From what I can tell, it can only be done with the mouse as there is no direct keyboard sequence (that I know of) that will let you start a strategy, like you can connect/disconnect a broker feed/data connection.

                              [UPDATE]
                              Regarding re-starting strategies:
                              I am looking into the OIF feature where it appears you can automate some of the order placement and strategy control. Also exploring COMMANDS, etc. and examining how to interface with VB, etc.

                              ALSO:
                              See "Automated Trading OIF Builder"

                              The Automated Trading OIF Builder is a utility that will generate correctly formatted OIF based on user input. This utility will help you become familiar with the OIF formats that NinjaTrader expects to see. You can also test these files in real-time by ensuring that "AT Interface" is enabled via the Control Center's File menu and checking "Write file" in the Automated Trading OIF builder.

                              [UPDATE 2]
                              I investigated OIF, etc. and it seems it lets you work with orders and ATM templates/etc., but does not seem to allow you to directly load a strategy. I will look into the nt dll dilio.

                              But yes, AutoHotKey will start and stop and start the program. Not an issue nor that difficult to do.

                              I started a thread to get feedback and consolidate this very conversation, but everyone keeps replying here, so I am not going to try to organize any sort of community effort anymore. Little to no feedback from NT nor forum members, so I feel like I am wasting my breath. From what I have read on the forums, there has been little proposed in regards to restarting connections and strategies other than what might happen in NT7 (not clear) or (this is not supported at this time). This leads me to believe few people are trading with real money. Clearly the people who would be concerned about such an issue would be trading real money, no? Skynetman is a great example.

                              I'm not even trading live yet and I am frustrated to a point where I may have to look for something else. That would really stink because I like (really really really like) everything about NT up until this point. I was even willing to tolerate its resource hogging and bugginess as I felt that once I cleaned everything up and just let it do it's one thing, it would be less stress on the system. In other words, once the development was completed, I was going to put it on a dedicated box all tweaked and just run the strategies from Strategies tab with nothing else cooking. All reports via email, etc.

                              Ok, it's a dead horse. I will wait for feedback.

                              Originally posted by skynetman View Post
                              @r2ktrader: With patsystem it's quite different. You have to restart the whole ninjatrader if you disconnect manually (NT limitation with pats).
                              And you can't simply close and start NT with a script, because you don't know how much it takes to shut down (even minutes sometimes) so you would have to check if the process in memory is gone before starting it again.
                              Besides if something goes wrong and you do not disconnect properly, you have to call the broker for an account reset, else you can't login anymore.....
                              Last edited by r2kTrader; 02-24-2009, 08:24 AM.

                              Comment


                                #30
                                Hi, I can understand your desire for a black box auto trading solution, but we generally advise that NinjaScript strategies should not be left unattended for various reasons.

                                We will make a continued effort to provide infrastructure allowing for black box trading in the future, information about upcoming features will be made public when available.

                                Thanks for your understanding and patience.

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by argusthome, 03-08-2026, 10:06 AM
                                0 responses
                                110 views
                                0 likes
                                Last Post argusthome  
                                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                                0 responses
                                59 views
                                0 likes
                                Last Post NabilKhattabi  
                                Started by Deep42, 03-06-2026, 12:28 AM
                                0 responses
                                37 views
                                0 likes
                                Last Post Deep42
                                by Deep42
                                 
                                Started by TheRealMorford, 03-05-2026, 06:15 PM
                                0 responses
                                41 views
                                0 likes
                                Last Post TheRealMorford  
                                Started by Mindset, 02-28-2026, 06:16 AM
                                0 responses
                                78 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Working...
                                X