PDA

View Full Version : Strategy Account vs. Brokerage Account


mgbloomfield
05-13-2008, 12:21 AM
Josh wrote a nice primer on the difference between the Strategy Account vs. Brokerage Account.

http://www.ninjatrader-support.com/vb/showthread.php?t=4033&highlight=strategy+account+brokerage

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?

NinjaTrader_Josh
05-13-2008, 01:09 AM
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.

mgbloomfield
05-13-2008, 01:20 AM
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.

NinjaTrader_Josh
05-13-2008, 02:27 AM
In that case you will unfortunately need to resync it manually.

nintra
05-13-2008, 05:25 AM
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?

NinjaTrader_Ray
05-13-2008, 06:52 AM
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.

nintra
05-13-2008, 07:07 AM
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!

NinjaTrader_Ray
05-13-2008, 07:43 AM
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.

mgbloomfield
05-13-2008, 11:28 AM
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.

NinjaTrader_Josh
05-14-2008, 12:36 AM
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.

mgbloomfield
05-14-2008, 07:40 AM
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.

nintra
05-14-2008, 11:40 PM
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.

:mad:

mgbloomfield
05-15-2008, 12:04 AM
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%.

nintra
05-15-2008, 01:20 AM
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.
:(

FireFly
05-15-2008, 05:02 AM
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.

mgbloomfield
05-15-2008, 05:44 PM
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.

mgbloomfield
02-09-2009, 12:01 PM
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).

NinjaTrader_Bertrand
02-09-2009, 12:54 PM
Hi mgbloomfield, unfortunately I cannot provide additional info, but improvement in this area will be made with NinjaTrader 7. Thanks!

skynetman
02-19-2009, 10:30 AM
@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.

mgbloomfield
02-19-2009, 11:24 AM
@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.


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.


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.

r2kTrader
02-20-2009, 03:57 PM
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.

http://www.ninjatrader-support2.com/vb/showthread.php?t=7329&highlight=first+trade


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.

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.
:(

skynetman
02-20-2009, 05:51 PM
@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....

r2kTrader
02-20-2009, 06:03 PM
Skynetman,

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

http://www.ninjatrader-support2.com/vb/showthread.php?t=7329&highlight=first+trade

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/vb/showthread.php?t=14410&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.

@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....

skynetman
02-21-2009, 02:16 AM
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. :p
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/vb/showthread.php?p=78133 )


If the weren't so good, why do you think i bought a lifetime license? ;)

r2kTrader
02-21-2009, 07:03 AM
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

r2kTrader
02-22-2009, 08:44 AM
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 (http://www.ninjatrader-support2.com/vb/showthread.php?t=14410&goto=newpost)

skynetman
02-24-2009, 06:08 AM
@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.....

r2kTrader
02-24-2009, 06:47 AM
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

@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.....

r2kTrader
02-24-2009, 06:57 AM
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.

@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.....

NinjaTrader_Bertrand
02-24-2009, 08:21 AM
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.

r2kTrader
02-24-2009, 09:40 AM
Bertrand,

Attended, or unattended, we clearly need a solution to manage strategies and connections. That goes without saying.

Obviously, one of the key features with NT is the fact that it can do things "automatically" and "programmatically". So having to write vbscripts and run hot key macros is so 1990's.

Is there any further insight you can offer in regards to how to programmatically manage a strategy so they can be "restarted/rebooted" if they are taken offline for any reason?


Thank you,


r2kTrader




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.

NinjaTrader_Bertrand
02-24-2009, 10:30 AM
Bertrand,

Is there any further insight you can offer in regards to how to programmatically manage a strategy so they can be "restarted/rebooted" if they are taken offline for any reason?


Thank you,


r2kTrader

Hi r2kTrader, unfortunately not more than already discussed or below.

Here's a reference how to halt a strategy - http://www.ninjatrader-support2.com/vb/showthread.php?t=4804

For order rejection handling, you could check this link - http://www.ninjatrader-support.com/HelpGuideV6/RealtimeErrorHandling.html

Other then working with those, I would suggest waiting for NinjaTrader 7 which will adress strategy persistence issues as mentioned.

skynetman
02-24-2009, 11:07 AM
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.



If someone can be at his pc 24/7 then he is a PRO, then he probably uses some other pro software and does not need NT

If someone has a work and can't be at his pc 24/7, then he needs a "black box auto trading solution" that he can trust else he has to go back to old end_of_day/night chart analysis, but then he would be more than happy with a free service as stockcharts as real time strategies are out of question.

In both scenarios there would be no market for NT.

Hoping in v7 ;)

NinjaTrader_Josh
02-24-2009, 11:15 AM
skynetman,

As we have discussed, NinjaTrader was never designed to be a black box system and we never recommend you leave a strategy unattended. If this is your requirement then unfortunately NinjaTrader simply may not be the best software for your needs.

r2kTrader
02-24-2009, 12:14 PM
Josh,

I am going to respectfully call you out on this. As per your website:

http://www.ninjatrader.com/webnew/futures_trading_platform_solutions_automatedtradin g.htm

Battle tested live order execution capabilities ?

Whether you run external strategies in TradeStation or want the added performance of running native NinjaScript® strategies, you can rest assured that NinjaTrader is a reliable, battle-tested, and industry proven execution platform to automate any strategy in both live and simulated real-time market environments.

---and---
We fully understand the need to have a stable platform that can automate strategy execution and handle live operation realities such as high frequency tick processing, order rejections, connection loss and unexpected broker API behavior all of which NinjaTrader addresses reliably.

---

I will stop there as I could cherry pick the whole page and paste it here. I am going to accept that NT7 will address the majority of the concerns being raised here and elsewhere in this forum.

You can't advertise that you are an autotrading solution that is battle tested when you can't fire up a strategy after the system crashes, lol. I mean let's be honest about this.

All in all, I love the support, the product and the rest of what NT offers. I can even accept the frequent crashes and bugs, etc. because once everything is setup and ready to go I don't think it will be a critical issue. Furthermore, I can script this to reboot at certain times and give it a nice clean slate at a pre-determined time (but not without being able to automatically load a strategy etc.)

Is there any namespace or methods you could refer us to that are not documented? Is there a command line sequence we can call that will load ninjatrader.exe with a certain strategy? Surely there has to be some way to automatically start a trade strategy.

Keep up the good work. I don't mean to be a pain in the arse, but I also can't accept the answers I have been reading in regards to this issue. NT's team is better than that I and I hold them to a higher level of accountability. Let's get this strategy piece right in NT7 and you can hold me to no less than 2 lifetime licenses (I would like to run two boxes and have the be redundant. Perhaps that could be an option? Just like you can talk to TS, why not have to NT boxes in sync so if one goes down, the other will manage the trade account. This would be great for many reasons. It would also allow NT a great opportunity to offer a hosting service on a VPS based system using something like VMware or the like?? This way I could have my system running at my office and have it tethered, synced with the hosted version and I can make one master one slave and have a much higher level of reliability.)

This way I could buy the lifetime licenses and pay a month service fee. If you are not interested in provided this service, please contact me directly and I would like to discuss how we could provide it in cooperation with NT and in within the proper licensing guidelines.




Thank you,


r2kTrader

skynetman,

As we have discussed, NinjaTrader was never designed to be a black box system and we never recommend you leave a strategy unattended. If this is your requirement then unfortunately NinjaTrader simply may not be the best software for your needs.

NinjaTrader_Josh
02-24-2009, 01:06 PM
Running automated and running as a black box are completely separate things. Automation does not imply and has never been advertised as a black box solution.

NinjaTrader handles high frequency data and strategy algorithms exactly the way it was designed. Syncing your strategy to your account position is something you need to manually ensure. We have already linked you to the information that explicitly outlines how you can do these procedures. We have also already mentioned that NT7 will provide additional features to further help in the syncing process. To wrap things up, NinjaTrader never recommends running strategies unattended.

skynetman
02-24-2009, 01:12 PM
Josh saying that is like saying that i should keep my computer speaker on while watching TV and run to the pc everytime a strategy executes an order or NT loses a connection....
And that is exactly what i had to do :(

NinjaTrader_Josh
02-24-2009, 01:21 PM
skynetman,

Unfortunately I do not know of any clearer way to present this information. NinjaTrader NEVER recommends running a strategy unattended. Automation and unattended are not the same. Unattended implies the use of automation while on the other side, automation does NOT imply being unattended. There is a very distinct and clear line differentiating the two.

r2kTrader
02-24-2009, 03:22 PM
Lol, ok, let's drop the word "Black box". Let's just say autotrading. The same issues still stand.

Running automated and running as a black box are completely separate things. Automation does not imply and has never been advertised as a black box solution.

NinjaTrader handles high frequency data and strategy algorithms exactly the way it was designed. Syncing your strategy to your account position is something you need to manually ensure. We have already linked you to the information that explicitly outlines how you can do these procedures. We have also already mentioned that NT7 will provide additional features to further help in the syncing process. To wrap things up, NinjaTrader never recommends running strategies unattended.

NinjaTrader_Josh
02-24-2009, 03:31 PM
r2kTrader,

There is no more information I can provide you guys.

r2kTrader
02-24-2009, 03:39 PM
Josh,

Skynetman has a point. Obviously, the benefit of an auto strategy is that it will working automatically and hence reduce or remove human involvement. This forum is a good example. I am sure you have hiccups, but generally it runs and performs a service as expected.

NT7. Got it.

Also, any comments regarding redundancy (multiple NT boxes running in master/slave mode to offer another layer of protection?)

Also, XMPP protocol integration? Please consider.

I'll drop it but keep the thread alive to design a work around. From what I have found, the best option we have right now is some vbscript and some mouse macros while keeping the screen consistent. I tried it and was able to start a strategy.

1. We have vbscript done that can make sure thread/ninjaTrader.exe service is completely killed.

2. We can force a disconnect / reconnect with AutoHotKey.exe

3. We can fire up a strategy using AutoHotKey.exe, while being careful to make sure the screen placement is the same. Ideally, it would make sense to have a fixed workspace that is stripped down and opens the control panel the same way every time for your autotrading box.

4. We call into action said solution using a streamwriter method to fire messages to a file that AutoHotKey.exe polls.

5. Need help to get syncing for strategy in order. I have not addressed this yet. I'm sure Skynetman is willing to test as am I. I want to go live. I don't mind leaving unattended if I know I can get feedback out of band (outside of ninja).




Josh saying that is like saying that i should keep my computer speaker on while watching TV and run to the pc everytime a strategy executes an order or NT loses a connection....
And that is exactly what i had to do :(

NinjaTrader_Josh
02-24-2009, 03:47 PM
There is no master/slave mode. I do not know what XMPP protocol is and is likely not supported.

r2kTrader
02-24-2009, 03:47 PM
Ray,

Would we be able to sync price if we did something like this?

We made a text file, put in a single line and set it up as historical data. Perhaps we make a MarketReplay file with just a single line or something like that. For lack of a better explanation, could we setup a dummy feed with exact dummy data that we want to get filled at and then INITIALLY ONLY connect to the dummy feed, fire the market order, then have our strategy set to original price.

1. We can get original fill price.
2. We can streamwrite to a file with said price in format that will be seen as a datafeed.
3. We can set dummy datafeed to have backup feed which would be our real primary feed. Upon getting our fill, we kill the dummy feed after loading our real primary feed.

What do you think, is this technically possible or close to possible? If so, it would give us a way to sync completely. A bit ugly, but if it works, a solution none-the-less.


Thanks,


r2kTrader

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.

NinjaTrader_Josh
02-24-2009, 03:52 PM
r2kTrader,

Text files are not seen as data feeds. If you want to feed some data you can try External Data Feed. NinjaTrader will not distinguish your "dummy" data from real data. Whatever it gets is what it considers as real data.

r2kTrader
02-24-2009, 03:57 PM
Josh,

So theoretically, this would work then?

Can you give me syntax, format for an external data feed? I will do homework in the meantime.


Thanks for the prompt reply. I don't care if it's pretty, I just want to have it automated. I don't mind having a failsafe shutoff (which I can do via my broker with a daily loss limit) and monitoring remotely as I will have this on a hosted server.

XMPP btw is aka the Jabber protocol. Ninja could benefit greatly from including an API for this. Presence detection, etc. and ability to communicate with any Instant Messaging system would be great for indicator and strategy developers. I am sure NT has own protocal for said communications, but XMPP would allow a nice layer of features, particularly for notification and perhaps for redundancy.

A slave / master model would be an interesting idea.


thanks, going to do homework on a dummy data feed. First glance tells me it might be easier to build a dummy market replay with a dummy date. But then it probably won't hold the fill as it will be linked to the market replay connection.

I don't know where to begin on building an External Feed. Is there a generic protocol I can use? I could pound out a simple tcp dilio that would spit back a tick after polling a file to get the fill I am looking for. I just don't know where to begin building an external datafeed.




r2kTrader,

Text files are not seen as data feeds. If you want to feed some data you can try External Data Feed. NinjaTrader will not distinguish your "dummy" data from real data. Whatever it gets is what it considers as real data.

NinjaTrader_Josh
02-24-2009, 04:01 PM
r2kTrader,

I cannot comment on if it will work or not. http://www.ninjatrader-support.com/HelpGuideV6/ExternalDataFeedConnection.html

sourcem
06-14-2009, 06:03 PM
Josh,

It would also allow NT a great opportunity to offer a hosting service on a VPS based system using something like VMware or the like?? This way I could have my system running at my office and have it tethered, synced with the hosted version and I can make one master one slave and have a much higher level of reliability.)

This way I could buy the lifetime licenses and pay a month service fee. If you are not interested in provided this service, please contact me directly and I would like to discuss how we could provide it in cooperation with NT and in within the proper licensing guidelines.
Thank you,


r2kTrader

There is a VPS service provided by Expert Advisors for a monthly fee which can work well with Ninja for automated trading. You might want to check it out.

Here is the link:

http://www.expert-advisors.com/EA-VPS.php?hop=download6

Also, can you Ninja support guys confirm if there can be any problem in using this third party source for hosting the platform and trading off of it?

I think this reliable connectivity solves all the connection lost issues and syncing manually etc.

Thanks,
sourcem