NinjaTrader and DLL's (creating and loading how-to) - NinjaTrader Programming | futures io social day trading
futures io futures trading


NinjaTrader and DLL's (creating and loading how-to)
Updated: Views / Replies:9,166 / 44
Created: by rleplae Attachments:18

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 18  
 
Thread Tools Search this Thread
 

NinjaTrader and DLL's (creating and loading how-to)

  #41 (permalink)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,571 given, 3,982 received


laadari View Post
Think you Sam;

When I tried it, I get the error message:


And when I use "try catch", I get:


I hope you have a solution to that.

These errors are too generic, it's impossible to debug without the sources and the .dll.

If your goal is to upload Ninja data to your own DB from an indicator it might be quicker to write something which is reading the Ninja SQLCE database...

Success requires no deodorant! (Sun Tzu)
Reply With Quote
 
  #42 (permalink)
Trading Apprentice
hartford, ct
 
Futures Experience: None
Platform: MetaTrader
Favorite Futures: Emini ES
 
Posts: 2 since Dec 2016
Thanks: 2 given, 0 received

building on your tutorial?

Thank you rleplae for the great tutorial! I searched online for hours before I found your post from 2014! Just what I was looking for. Two questions I hope you're still around to help with

1. Is there anyway to use a DLL without putting it in C:/Documents/NinjaTrader 7/bin/Custom? I want my ninjascript to run a function without making it "part" of ninjatrader.

2. Lets say that in your example, ClassLibraryBMT was written in C++. Would it still be possible to use as you outline? Maybe with something involving interopservices?

Reply With Quote
 
  #43 (permalink)
Elite Member
Omer עומר / Israel י
 
Futures Experience: Master
Platform: NinjaTrader, Proprietary,
Broker/Data: Ninjabrokerage/IQfeed + Synthetic datafeed
Favorite Futures: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
 
rleplae's Avatar
 
Posts: 2,470 since Sep 2013
Thanks: 1,695 given, 3,661 received
Forum Reputation: Legendary



MD855 View Post
Thank you rleplae for the great tutorial! I searched online for hours before I found your post from 2014! Just what I was looking for. Two questions I hope you're still around to help with

1. Is there anyway to use a DLL without putting it in C:/Documents/NinjaTrader 7/bin/Custom? I want my ninjascript to run a function without making it "part" of ninjatrader.

2. Lets say that in your example, ClassLibraryBMT was written in C++. Would it still be possible to use as you outline? Maybe with something involving interopservices?

1. What is the type of service your module needs to do deliver ?

I have built for example algo services that i call from an indicator container through a JSON call, then service then delivers a chunk of data, so inside NT i can use that data to draw on the screen. Another example is call that back-end where i pass orderIDs and the back-end is then managing the stops in an intelligent way or rejects the order simply if it does not pass the rules of my risk engine

2. Yes that is possible, you can have external libraries that are not c# and not inside the NT directory, and example is this piece of code :

 
Code
			
[DllImport("user32")]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool EnumChildWindows(IntPtr window, EnumWindowProc callback, IntPtr lParam);

Reply With Quote
 
  #44 (permalink)
Trading Apprentice
hartford, ct
 
Futures Experience: None
Platform: MetaTrader
Favorite Futures: Emini ES
 
Posts: 2 since Dec 2016
Thanks: 2 given, 0 received

I have a lot of computational stuff I've done in C++, and want to use the functions in NT.

For simplicity, let's pretend ClassLibraryBMT.dll was in C++ and has the path 'C:\ClassLibraryBMT.dll'. If I simply wanted to call BMTmethod() in my NT script without re-writing it in C# and without copying to the /Bin/Custom folder, how would I do that?

Reply With Quote
 
  #45 (permalink)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,571 given, 3,982 received


MD855 View Post
I have a lot of computational stuff I've done in C++, and want to use the functions in NT.

For simplicity, let's pretend ClassLibraryBMT.dll was in C++ and has the path 'C:\ClassLibraryBMT.dll'. If I simply wanted to call BMTmethod() in my NT script without re-writing it in C# and without copying to the /Bin/Custom folder, how would I do that?

See How to call C++ DLL in C# - Stack Overflow for your first question.
See .net - How to set C# library path for an application? - Stack Overflow if you don't want to put your .dll in the GAC nor in the NT directory.

Success requires no deodorant! (Sun Tzu)
Reply With Quote
The following 2 users say Thank You to sam028 for this post:

Reply



futures io > > > > > NinjaTrader and DLL's (creating and loading how-to)

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use NTDirect.dll or NinjaTrader.Client in NinjaScript? vantojo NinjaTrader Programming 7 January 15th, 2014 06:39 AM
Interactive Brokers Gateway / Ninjatrader not loading weekly and monthly charts? luvs321 NinjaTrader 3 January 10th, 2014 02:05 PM
How-to remove .dll files from NinjaTrader PandaWarrior NinjaTrader 7 October 1st, 2012 08:21 AM
Please help creating a NinjaTrader Indicator jjl1753 NinjaTrader Programming 4 June 13th, 2011 10:26 PM
External DLL from Ninjatrader ehlaban NinjaTrader Programming 11 June 13th, 2010 12:42 PM


All times are GMT -4. The time now is 02:45 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-11 in 0.09 seconds with 20 queries on phoenix via your IP 54.226.172.30