Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
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=4.1.0.21, 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?
Can you help answer these questions from other members on NexusFi?
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
Not building it at all, just taking the binary release from the package provided in that link.
Another poster in another forum mentioned that NT7 is based on .NET 3.5, yet this package is for .NET 4.. I think that might be the source of the issue and I'm digging deeper.
You will not be able to install a .NET .4 depedant package,
i am sure about that,
i have run into that issue before
Two options :
1) take the source and compile for 3.5 (provided that the source does not use specifics
that only exist in 4.0
2) find a binary that is compiled for the target platform 3.5 or lower
A user on EliteTrader got me in the right direction. It totally was the NT7 using .NET 3.5 being incompatible with the .NET 4.0 compiled ZMQ binary I was using.
I cut over to NT8, which was built using .NET 4.0, and after some minor troubleshooting I got it working as expected.