I'm trying to communicate between strategies in NinjaTrader and I don't want to use IO. I'd like something faster and a bit easier to implement in other strategies later. I'm thinking of a parent console application that manages the communication between them all, but I'm wondering what other solutions you've come up with.
To date I've tried communicating via windows messages, which didn't work because of the limitations of NinjaTrader as well as cross thread communication and IPC, but the threads aren't Thread Pool and IPC won't work for the same reasons windows messages won't work.
So before I go balls to the wall with my console manager, I was wondering if anybody had come up with something better or just an alternative, as I'd rather not do this. At this point, it may be my only option though.
you could use .net remoting, or any of the open source message bus programs for .net.. there are several of them on codeplex and/or googlecode, most include a console message host, no need to roll your own =)
Nice sefstrat; precisely what I was looking for. And the ability to make it a background process is awesome!
I am finding it incredibly difficult to get setup with Mass Transit, I can't even get their samples to work. Their documentation is sparse to put it best, and there seems to be no correlation between the documentation they do have and their actual source code available for download. Can you provide an abstract version of how you're doing it? I don't want to steal your code or anything, but maybe just give an idea of how to even get started with it?
I found a better implementation, at least for me, that I seem to be having some luck with. NServiceBus, I was able to get up and running in about 2 minutes compared to the all day event that was Mass Transit. There's another good looking service bus implementation called Rhino. Anyway, just because it didn't work for me doesn't mean it won't work for someone else, I'm just including these others so people will know their options. Thanks again, sefstrat.
Last edited by zwentz; September 29th, 2009 at 12:12 AM.
Reason: Added more stuff
The following user says Thank You to zwentz for this post:
Though just what I need, I am finding these programs incredibly difficult to use.
I have been trying to develop a method to run two strategies at once.
One strategy is to calculate the signal. (Calculate on Bar Close = true) It then sends the Close price to the 2nd strategy once the signal = true. The 2nd strategy (Calculate on Bar Close = false) places a limit order 2 ticks +- the Close. So if the price moves away from the order without being filled, a cancel order can be initiated.
Now I have looked at the DataTransfer Class and am completely lost as to how to setup communication. As I recall, it simply calculated PnL figures.
Using these 3rd party programs with VS seems a little difficult.