Broker/Data: Equities: Through my work (firm.) Spot FX: Oanda, Pepperstone
Favorite Futures: US / Canadian Stocks, Spot FX
Posts: 23 since Jan 2013
Thanks: 3 given,
Using ZeroMQ within Ninjatrader 7
Having a dilly of a pickle trying to use ZeroMQ from within a Ninjatrader script/indicator. I'm a python programmer and have only just started dabbling with C# and NT in general.
Where I've gotten so far:
- Taken the C# release/bindings for ZeroMQ, and placed the approperate DLL files in the NT's bin/Custom folder. This includes the main ZeroMQ.DLL file and two sub directories as part of the release folder within the download from this link: https://github.com/zeromq/clrzmq4/releases
- Added the ZeroMQ.DLL file as a reference within Ninjatrader.
- Included a "using ZeroMQ;" line. This is accepted without error.
- Wrote in some C# ZeroMQ code into an indicator, which saves and compiles without issue. That is to say, NT seems to get the class references and namespace from the DLL file just fine.
- Added said indicator onto a chart, which starts but fails to plot anything. In NT's output window I get this error:
"""Failed to call method 'Initialize' for indicator 'MyCustomIndicator': Could not load file or assembly 'ZeroMQ, Version=22.214.171.124, Culture=neutral, PublicKeyToken=4a9630883fd6c563' or one of its dependencies. The system cannot find the file specified."""
So it appears to be failing on a dependency somewhere outside the initial DLL import.
Has anyone done this before? Where am I going wrong?
1) I believe there is a limitation, that a DLL you load into the NT7 address space, can not be more recent than .Net framework 3.5. Could that be the issue you are running into ?
2) It is possible that the DLL you have loaded in NT7, at run-time is needed a number of other DLL's (system/third party) that are not found. Two ways to find that out 1) make a small c# stub outside NT and use the same DLL 2) use a tool like filmon to see what exception it is giving when looking for a specific DLL