NexusFi: Find Your Edge


Home Menu

 





Using ZeroMQ within Ninjatrader 7


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Jack Larkin with 3 posts (0 thanks)
    2. looks_two rleplae with 2 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 sam028 with 1 posts (0 thanks)
    1. trending_up 2,071 views
    2. thumb_up 0 thanks given
    3. group 3 followers
    1. forum 6 posts
    2. attach_file 0 attachments




 
Search this Thread

Using ZeroMQ within Ninjatrader 7

  #1 (permalink)
Jack Larkin
Toronto Ontario
 
Posts: 27 since Jan 2013
Thanks Given: 3
Thanks Received: 44

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?

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
Cheap historycal L1 data for stocks
Stocks and ETFs
ZombieSqueeze
Platforms and Indicators
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
  #3 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 3,003 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863


What .net version is the library dependant on ?

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

good luck !

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629

@Jack Larkin, did you build it from the source using .Net 3.5 and not 4.0 which is the default target?

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
  #5 (permalink)
Jack Larkin
Toronto Ontario
 
Posts: 27 since Jan 2013
Thanks Given: 3
Thanks Received: 44


sam028 View Post
@Jack Larkin, did you build it from the source using .Net 3.5 and not 4.0 which is the default target?

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.

Reply With Quote
  #6 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 3,003 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863


Jack Larkin View Post
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

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #7 (permalink)
Jack Larkin
Toronto Ontario
 
Posts: 27 since Jan 2013
Thanks Given: 3
Thanks Received: 44

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.

Details here:
https://www.elitetrader.com/et/index.php?threads/using-zeromq-from-within-ninjatrader-assistance-bitte.299842/

(If linking to another trading forum is a no-no, mods feel free to delete the link.. just posting what worked and how I resolved it.)

Reply With Quote




Last Updated on May 11, 2016


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts