NexusFi: Find Your Edge


Home Menu

 





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


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one rleplae with 16 posts (87 thanks)
    2. looks_two laadari with 10 posts (0 thanks)
    3. looks_3 NJAMC with 6 posts (15 thanks)
    4. looks_4 sam028 with 3 posts (5 thanks)
      Best Posters
    1. looks_one rleplae with 5.4 thanks per post
    2. looks_two ratfink with 2.7 thanks per post
    3. looks_3 NJAMC with 2.5 thanks per post
    4. looks_4 sam028 with 1.7 thanks per post
    1. trending_up 29,803 views
    2. thumb_up 121 thanks given
    3. group 23 followers
    1. forum 45 posts
    2. attach_file 18 attachments




 
Search this Thread

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

  #11 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425

@rleplae,

Thank you for excellent presentation of really good information, superb! Link bookmarked.

I currently build all my other classes just under Ninja, inside or outside it's own namespaces, but this makes using VS look very cool.

Cheers!

Travel Well
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Increase in trading performance by 75%
The Elite Circle
Exit Strategy
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
Better Renko Gaps
The Elite Circle
MC PL editor upgrade
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
27 thanks
Tao te Trade: way of the WLD
23 thanks
Diary of a simple price action trader
22 thanks
My NQ Trading Journal
14 thanks
GFIs1 1 DAX trade per day journal
9 thanks
  #12 (permalink)
 Koepisch 
@ Germany
 
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: FDAX
Posts: 569 since Nov 2011
Thanks Given: 440
Thanks Received: 518


rleplae View Post
@Koepisch Thank you for your appreciation
I think we would go too far off-topic to discuss your particular problem in this thread, but I will be happy to brain-storm with you, in a dedicated thread. To my knowledge NT does not have published "api" to scroll the chart or position the chart.

This thread is about how to create a DLL and install and use it in NT.
Any questions and problems encountered, making abstractions of what exactly you want to do in the DLL are welcome on this thread.

Thanks for your answer. The chart scrolling isn't the problem, i've already done that. I thought that enhance the DLL from uni- to bidirectional communication were a good functionality for a common NT AddOn DLL framework. Still happy to follow your thread.

Reply With Quote
Thanked by:
  #13 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425



Koepisch View Post
Hi @rleplae, i very appreciate your contributions. I'm sure that it will help a lot of people having the same tasks. I like the many pictures, because it helps visualize the stuff and then it's far better to understand.

I want to make an suggestion for an issue i'm facing currently. I want to raise an event within NT (execute function within NT) from my dedicated C# solution. In my external solution i have imported the OHLC data from NT and running my trading logik. As results i have the trade setups and backtesting statistics. NOW i want to select single trades in my program and want to control NT to scroll the trade location in the center of the chart view. I could do it via an POLLING pattern at OnBarUpdate but i don't want go this way for various reasons. I'm still searching an BM for related Posts, but i think it will match this thread too.

Thanks Koepisch


Koepisch View Post
Thanks for your answer. The chart scrolling isn't the problem, i've already done that. I thought that enhance the DLL from uni- to bidirectional communication were a good functionality for a common NT AddOn DLL framework. Still happy to follow your thread.

Sorry for also off-topic, let's take it elsewhere, but:

Two thoughts:

1) Would you be interested in sharing the chart scrolling/positioning code? a few of us would find that useful.

2) For your particular problem have you checked out the TriggerCustomEvent Ninja approach? That way you could use the timer event or send Windows events and service them.

Travel Well
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #14 (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


Koepisch View Post
Thanks for your answer. The chart scrolling isn't the problem, i've already done that. I thought that enhance the DLL from uni- to bidirectional communication were a good functionality for a common NT AddOn DLL framework. Still happy to follow your thread.

It is probably good to make the code on the NT side the master in terms of push/pull
for threading and consistency reasons

The code you have running on NT can push things to a method in your DLL
and the code can Poll the external side by call another method, which is a 'poll'.

This allows to communicate both ways, only it's not real-time.

Alternatively you can use 'loose coupling'.
I have done another implementation, where the code could not be linked together, due to .NET 4.0
and i made a stand alone process that was listening on a TCP/IP socket with the .NET 4.0 software,
so i didn't have to load the code in the NT memory address space.

I have a feeling that this second approach is closer to what you want to do.

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #15 (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


ratfink View Post
Sorry for also off-topic, let's take it elsewhere, but:

Two thoughts:

1) Would you be interested in sharing the chart scrolling/positioning code? a few of us would find that useful.

2) For your particular problem have you checked out the TriggerCustomEvent Ninja approach? That way you could use the timer event or send Windows events and service them.

Sounds like a great new thread : NinjaTrader and Event driving (creating and loading how-to)

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #16 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425


rleplae View Post
Sounds like a great new thread : NinjaTrader and Event driving (creating and loading how-to)

Great idea and I'd love someone else to do it, otherwise I will do it when I've got KeyTrader finished, an update for ChartMinder out, a month's trading and 2 week's vacation out of the way. Ok, this primadonna over and out.

Travel Well
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #17 (permalink)
 
NJAMC's Avatar
 NJAMC 
Atkinson, NH USA
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader 8/TensorFlow
Broker: NinjaTrader Brokerage
Trading: Futures, CL, ES, ZB
Posts: 1,970 since Dec 2010
Thanks Given: 3,037
Thanks Received: 2,395


ratfink View Post
Sorry for also off-topic, let's take it elsewhere, but:

Two thoughts:

1) Would you be interested in sharing the chart scrolling/positioning code? a few of us would find that useful.

2) For your particular problem have you checked out the TriggerCustomEvent Ninja approach? That way you could use the timer event or send Windows events and service them.

You might be able to get an example of "TriggerCustomEvent" from the LOM software. I believe I had to integrate that for certain events to work properly.

Nil per os
-NJAMC [Generic Programmer]

LOM WIKI: NT-Local-Order-Manager-LOM-Guide
Artificial Bee Colony Optimization
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #18 (permalink)
symphys
Earth
 
Posts: 18 since Feb 2010
Thanks Given: 3
Thanks Received: 6

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?

Reply With Quote
  #19 (permalink)
 supermht 
Naperville IL
 
Experience: Intermediate
Platform: ninjatrader
Broker: NT broker
Trading: NQ ES 6E GC CL
Posts: 962 since Feb 2010
Thanks Given: 1,189
Thanks Received: 661

I got an indicator, it includes dll and cs...

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

thanks

Reply With Quote
  #20 (permalink)
 
NJAMC's Avatar
 NJAMC 
Atkinson, NH USA
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader 8/TensorFlow
Broker: NinjaTrader Brokerage
Trading: Futures, CL, ES, ZB
Posts: 1,970 since Dec 2010
Thanks Given: 3,037
Thanks Received: 2,395



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?

@symphys,

There are certainly experts that can answer this question, but if you import the DLL I would say it is okay to use. Overwriting seems like you need to force the system to recompile at a minimum as I think it collects the .NET files into cache files. I don't know that you need to restart, but you should recompile. I would say a reload might not even refresh the contents of the strategy, so I would recompile always.

Nil per os
-NJAMC [Generic Programmer]

LOM WIKI: NT-Local-Order-Manager-LOM-Guide
Artificial Bee Colony Optimization
Visit my NexusFi Trade Journal Reply With Quote




Last Updated on December 4, 2020


© 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