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,292 / 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)

  #21 (permalink)
Elite Member
Atkinson, NH USA
 
Futures Experience: Intermediate
Platform: NinjaTrader 8/TensorFlow
Broker/Data: NinjaTrader Brokerage
Favorite Futures: Futures, CL, ES, ZB
 
NJAMC's Avatar
 
Posts: 1,925 since Dec 2010
Thanks: 2,962 given, 2,294 received


supermht View Post
I got an indicator, it includes dll and cs...

is it safe to use it? I mean somebody might track my system?

thanks

@supermht,

You have already stated most of the risk, make sure you know who make the DLL and what their intension is with the program. If you just download random DLLs, you are at risk. futures.io (formerly BMT) generally doesn't allow DLLs for download except in rare circumstance because of the safety/security issues.

Nil per os
-NJAMC [Generic Programmer]

LOM WIKI: NT-Local-Order-Manager-LOM-Guide
Artificial Bee Colony Optimization
Reply With Quote
The following 2 users say Thank You to NJAMC for this post:
 
  #22 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,357 given, 83,238 received

It is possible any DLL can steal any information from your computer, network, bank, trades, install a key logger, steal passwords, or anything else. You wouldn't know it if you can't view the source code.

Sent from my phone

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
The following 2 users say Thank You to Big Mike for this post:
 
  #23 (permalink)
Market Wizard
Sarasota FL
 
Futures Experience: Intermediate
Platform: NinjaTrader, Sierra Chart
Favorite Futures: ES
 
Posts: 3,642 since Jan 2013
Thanks: 26,780 given, 11,135 received
Forum Reputation: Legendary



supermht View Post
I got an indicator, it includes dll and cs...

is it safe to use it? I mean somebody might track my system?

thanks


NJAMC View Post
@supermht,

You have already stated most of the risk, make sure you know who make the DLL and what their intension is with the program. If you just download random DLLs, you are at risk. futures.io (formerly BMT) generally doesn't allow DLLs for download except in rare circumstance because of the safety/security issues.


Big Mike View Post
It is possible any DLL can steal any information from your computer, network, bank, trades, install a key logger, steal passwords, or anything else. You wouldn't know it if you can't view the source code.

Sent from my phone

@supermht, all the above responses are correct. I would just add that either most or all commercial indicators will come in the form of dll files, as will some non-commercial ones. The reason is that the creator of the indicator does not want you -- or any competitor! -- to be able to read his original source code, and see just what the indicator does and so be able to copy it.

This puts you in the bind of having to trust the original author, and his or her motivations. It does not mean the dll's are inherently dangerous, just that you cannot know if they are or if they are not.

So, if you are going to buy an indicator, you are probably going to get a dll. You will need to decide whether the provider of the indicator is trustworthy, which you have to do every time you install any software on your computer anyway (essentially all commercial software will come as either exe or dll files, neither of which show the source code). You will need to be very careful who you trust if you are downloading indicators.

You will almost never see a dll allowed on futures.io (formerly BMT), which is about sharing, not hiding.

Bob.

Reply With Quote
The following user says Thank You to bobwest for this post:
 
  #24 (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,507 since Sep 2013
Thanks: 1,710 given, 3,722 received
Forum Reputation: Legendary

locked


symphys View Post
Thanks for the detailed tutorial.
Quick question about the usage: If the dll is recompiled and overwritten does NT need to be restarted or is a simple reload strategy enough to load the updated dll?

when a program (exe) is running, or when a library (dll) is loaded in memory, you will not be able to compile and overwrite the file (exe/dll), visual studio will give you a error it can not output to the locked file.

when you recompile a dll, make sure you unload the old version and reload the new version, it's a good habit to put a version number in your DLL, increment that number every time you modify and recompile, and output that to your output window, that way you can be sure the right version is loaded and you are testing against what you want to test


Last edited by rleplae; December 28th, 2014 at 09:20 AM. Reason: typo's
Reply With Quote
 
  #25 (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,507 since Sep 2013
Thanks: 1,710 given, 3,722 received
Forum Reputation: Legendary

analysis


supermht View Post
I got an indicator, it includes dll and cs...

is it safe to use it? I mean somebody might track my system?

thanks

If you have software (exe/dll) with uncertain/doubtful origin and you absolutely want to test it
(if it comes from a non respectful vendor i would strongly discourage you to install exe/dll, unless
you see the source code and are able to recompile it correctly, never take executables from
hacking site, they always include stuff you don't want on your system)

you can do a few things to limit your risk
1) you can always install software in a sandbox/virtual machine environment, if the software contains
a virus or other unwanted things, you will be able to contain the hazardeous behaviour to that sandbox
there are a lot of those environments out there. (vm ware, etc..)
2) if you don't have access to the source code and want to see what the software is doing, there a
few tools out that you can use :
- sniffer, is a program that allows to capture and visualize all packets that go in and out of your machine
this allows to see some of the network activity at least. (eg : ethereal, ..)
- you must of course always have a good end-node security product (anti-virus, malware detection)
- you can use a tool like filmon (system internals) to see what activity the module is generating on your
hard disk, if it is reading all files and directories on your disk, you might question what it's intent is)

Reply With Quote
The following 2 users say Thank You to rleplae for this post:
 
  #26 (permalink)
Trading Apprentice
morocco
 
Futures Experience: None
Platform: ninjatrader
Favorite Futures: Currency futures
 
Posts: 8 since Jun 2016
Thanks: 1 given, 0 received

NinjaTrader _8 and personal DLL

Hi;
I want integrate my own DLL file to an indicator in NinjaTrader 8. But NT crashed when I compile my code.

I tried to do like explained in this tuto: "https://futures.io/ninjatrader-programming/32855-ninjatrader-dll-s-creating-loading-how.html"]https://futures.io/ninjatrader-programming/32855-ninjatrader-dll-s-creating-loading-how.html" , but that didn't work. I tried also to use AddOns section and that didn't resolve the problem.

This is my code:


#region Using declarations
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data;
using System.Data.SqlClient;
using System.Runtime.InteropServices;

using MyLibrary;

using NinjaTrader.Cbi;
#endregion

namespace NinjaTrader.NinjaScript.Indicators
{
public class MyIndicator : Indicator
{
private Export export = new Export();
private List<string> symbolDetails;

protected override void OnStateChange()
{
if (State == State.SetDefaults)
{

}
else if (State == State.Configure)
{
Log("_____________---------------State = State.Configure---------------_____________", LogLevel.Information);

symbolDetails = new List<string>();
symbolDetails.Add(Instrument.MasterInstrument.Name);
symbolDetails.Add("CASH");
symbolDetails.Add("IDEALPRO");
symbolDetails.Add(Instrument.FullName.Substring(3, 3));
}
}

protected override void OnBarUpdate()
{

}

#region Properties
[Range(1, int.MaxValue)]
[NinjaScriptProperty]
[Display(Name="Period", Order=0, GroupName="Parameters")]
public int Period
{ get; set; }
#endregion

}
}


I need your help.

Reply With Quote
 
  #27 (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,507 since Sep 2013
Thanks: 1,710 given, 3,722 received
Forum Reputation: Legendary


laadari View Post
Hi;
I want integrate my own DLL file to an indicator in NinjaTrader 8. But NT crashed when I compile my code.

I tried to do like explained in this tuto: "https://futures.io/ninjatrader-programming/32855-ninjatrader-dll-s-creating-loading-how.html"]https://futures.io/ninjatrader-programming/32855-ninjatrader-dll-s-creating-loading-how.html" , but that didn't work. I tried also to use AddOns section and that didn't resolve the problem.

This is my code:


#region Using declarations
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data;
using System.Data.SqlClient;
using System.Runtime.InteropServices;

using MyLibrary;

using NinjaTrader.Cbi;
#endregion

namespace NinjaTrader.NinjaScript.Indicators
{
public class MyIndicator : Indicator
{
private Export export = new Export();
private List<string> symbolDetails;

protected override void OnStateChange()
{
if (State == State.SetDefaults)
{

}
else if (State == State.Configure)
{
Log("_____________---------------State = State.Configure---------------_____________", LogLevel.Information);

symbolDetails = new List<string>();
symbolDetails.Add(Instrument.MasterInstrument.Name);
symbolDetails.Add("CASH");
symbolDetails.Add("IDEALPRO");
symbolDetails.Add(Instrument.FullName.Substring(3, 3));
}
}

protected override void OnBarUpdate()
{

}

#region Properties
[Range(1, int.MaxValue)]
[NinjaScriptProperty]
[Display(Name="Period", Order=0, GroupName="Parameters")]
public int Period
{ get; set; }
#endregion

}
}


I need your help.

The example was created at the time that NT 8.0 was not yet out.
First thing that comes to my mind, is to check the .NET framework version.
To my knowledge NT 8.0 is using .net 4.5
For which version did you compile your DLL ?
Can you please check, correct and circle back if it solves ?

Reply With Quote
 
  #28 (permalink)
Trading Apprentice
morocco
 
Futures Experience: None
Platform: ninjatrader
Favorite Futures: Currency futures
 
Posts: 8 since Jun 2016
Thanks: 1 given, 0 received

Thinks for your replay,

I already check it and my library has for target .NET framework 4.5. And it's compiled with VS 2015.
I think that the problem have relation with the instantiation of the object export: private Export export = new Export();. Because sometimes when I comment this line, the indicator works.

Reply With Quote
 
  #29 (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,507 since Sep 2013
Thanks: 1,710 given, 3,722 received
Forum Reputation: Legendary

can you please post that object ?

I would suggest you comment out the maximum of the logic inside that object
and get also a try/catch in place if some stuff is there
make sure that the container works, purely the object without anything else

Do you rely on any other DLL's inside your object ?

Can you post a screen shot when exactly it crashes ?
Is there something in the event log ?
something in other log files ?

Reply With Quote
 
  #30 (permalink)
Elite Member
Atkinson, NH USA
 
Futures Experience: Intermediate
Platform: NinjaTrader 8/TensorFlow
Broker/Data: NinjaTrader Brokerage
Favorite Futures: Futures, CL, ES, ZB
 
NJAMC's Avatar
 
Posts: 1,925 since Dec 2010
Thanks: 2,962 given, 2,294 received



laadari View Post
Thinks for your replay,

I already check it and my library has for target .NET framework 4.5. And it's compiled with VS 2015.
I think that the problem have relation with the instantiation of the object export: private Export export = new Export();. Because sometimes when I comment this line, the indicator works.

Is the issue when you compile or when you try to execute the Indicator?

Your DLL needs to be in the /bin/custom/ folder and usually requires a restart of NT8 for NT8 to link to the code for use so make sure you have restarted. This could be a simple "can't find DLL". Please check your Log & Trace files for any hints, if you post them we might be able to help better.

Nil per os
-NJAMC [Generic Programmer]

LOM WIKI: NT-Local-Order-Manager-LOM-Guide
Artificial Bee Colony Optimization
Reply With Quote

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)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

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 04:43 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-18 in 0.16 seconds with 20 queries on phoenix via your IP 54.221.136.62