Please if you have suggestions on how to implement this better, or can tell me how to add "listener" capabilities to my Strategy, please tell me here.
For Ninja 8, I have written generic Trade Server" that runs as a Strategy in Strategy Analyzer. It places orders and then manages positions similar to the Ninja ATM.
I want this trade server to listen for trade signals from one or more Indicators (Trade Trigger)...I do not want to couple an indicator to the Trade Server, but have the Trade Server be able to listen for signals from one or more Trade Trigger Indicators at the same time.
(Once an order has been received, the Trade Server would not act on another incoming order, until the order / trade was completed.)
So, in Strategy Analyzer there would be one Trade Server executing for one instrument. Each Trade Server (for a specific instrument, such as FDAX, CL, ES, UB) ) would be listening for signals from one or more Trade Trigger indicators (for the same instrument).
So, there needs to be a way that when a specific Trade Server starts up for it to publish a handle so that when a corresponding Trade Trigger (Indicator) starts up, it can find the Trade Server and send messages to it.
I've been able to do a lot in Ninjascript C#, but this is beyond my current skill set.
In other work I've implemented XMPP iand MSMQ interfaces into my code....as senders, but not as listeners
Because of the thread locking when listening and receiving MSMQ (or I suppose Named Pipes also) messages have found that it did not mix well in a Ninja process, which needs to not be locked for any reason.
(I have MSMQ listeners working well outside of Ninja, for other processes, such as logging, external published alerts, etc)
Is there a way for a running strategy to publish an external interface to one of its internal methods (i.e. a listener/receiver method), so that an external process can pass information to it and trigger it?
Or, do you have other ideas that you have proven works?
Many thanks
Comment