Quote from bridenour:
The problem i have primarily encountered up to this point is NTs inability to "recalculate" open positions accurately due to differences between real time and historical data.
That was less of an issue for me previously... because I was dealing only market orders, it was very rare that my positions would be different. (Now I'm using limit orders, that's more of an issue... NT might disagree with me on whether I filled at all or not!)
But my strategy (as it is written right now at least) is very path dependent... I look at *all* of my previous fills on a particular stock, before deciding how I want to act in the future. So that means it was always important I recreate exactly what my fills were, before. And that was the really hard part.
1) You had only been saving your positions manually for about 3-4 weeks -- how is that working out for you now? Do you still think its a good approach?
Really, really happy about it. It opened up additional perks that I never even considered in advance.
It's another tool for looking at my executions, beyond depending on NT's executions tab + the broker. I can sort/search/filter, and later on do math on slippage, etc, etc...
And the best unexpected perk of all... before, if my code was disconnected for even 5 minutes, I could (potentially) be screwed. Historical data would tell me I should've entered/exited, but in reality.. I hadn't. So I would be left scrambling around, trying to fix my real positions to match the hypothetical.
Now I don't have to do that. If I was disconnected and I didn't trade... no biggie. My hypothetical position will still match actual, and I'll keep going.
(Another side perk: I had been afraid to modify my strategy heavily, because again, the historical positions would mismatch... not an issue any more.)
2) You were using Amazon's service, but said you might approach it differently now. What are your current thoughts on this and what led you to believe a non-amazon approach might be better? What about a simple local DB or even file based storage?
I didn't want a single point of failure, which is why I didn't go with local file or local DBMS. If that computer goes down... how do I startup again? I'll have lost all of my positions.
Now, even if my computer blows up... as long as Amazon itself doesn't blow up, I'll be able to get back up and going again.
Amazon's service is working well enough, but it's not really designed for this sort of application. It's meant to be used for high traffic, high availbility data... one downside: it's not always internally consistent (ACID). If you do a write followed immediately by a read, you might not actually get your previous written value back. That hasn't been an issue in reality, but it's something that's always in the back of my mind.
There's also a lack of good tools for looking at and manipulating SimpleDB data. I use something called SimpleDB Explorer, which works... but is less than ideal.
Based on what I know now, I think I would recommend the Google Data API. They also have a C# wrapper.. you can write data into Google Base if you need to, or even better, right into a Google Docs Spreadsheet. That'd be so cool! Easy manipulation, and you can probably even setup the spreadsheet with your formulas... and just populate the cells with your trade as they happen. And there's visualization tools for Google Docs too...
3) How long did it take you to move away from the built in position management features to implement your own version?
I used the built-in management features for several months. It wasn't until I decided I wanted to think about moving to limit orders that I decided I had to look for an outside version.
The actual implementation was pretty straight-forward, probably only 3-4 days and a week of testing.
Do you open a virtual position during start up while in historical mode, so that you can then manage it using the normal NT functions?
Yep, that's exactly what I do.
I make sure I start my strategy on a historical bar (at least two historical bars, actually). And then I read back my positions... and if I'm long, I EnterLong().
Other than that, I return as long as I'm Historical.
Hope that helps!