NexusFi: Find Your Edge


Home Menu

 





How to use NTDirect.dll or NinjaTrader.Client in NinjaScript?


Discussion in NinjaTrader

Updated
    1. trending_up 5,772 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 7 posts
    2. attach_file 0 attachments




 
Search this Thread

How to use NTDirect.dll or NinjaTrader.Client in NinjaScript?

  #1 (permalink)
 vantojo 
Vilcabamba, Ecuador
 
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012

It appears that Ninja intended NTDirect.dll and NinjaTrader.Client to be only external interfaces to the NT Trade Engine, and not designed to be used inside NinjaScript.

I have looked through the forums for concrete examples of how to integrate these into my indicator, but it seems that the search is not returning anything on Ninja Forum or futures.io (formerly BMT).

Can anyone point me to indicator code that is able to integrate either of these into a NT indicator?

Thank you.

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
About a successful futures trader who didn´t know anyth …
Psychology and Money Management
Better Renko Gaps
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
  #3 (permalink)
 vantojo 
Vilcabamba, Ecuador
 
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012


my attempts so far to reference NinjaTrader.Client in Ninja Script

Conflict between [AUTOLINK]NinjaTrader[/AUTOLINK].Core.dll and [AUTOLINK]NinjaTrader[/AUTOLINK].Client.dll - [AUTOLINK]NinjaTrader[/AUTOLINK] Support Forum

Started this thread Reply With Quote
  #4 (permalink)
 decs0057 
Munich, Germany
 
Experience: Intermediate
Platform: NinjaTrader, TWS
Broker: IB, NinjaTrader Brokerage
Trading: ES,NQ,6E
Posts: 71 since Feb 2010
Thanks Given: 15
Thanks Received: 25

If you are inside NinjaTrader you don't need to use NTDirect.dll and NinjaTrader.Client. You can use undocumented functionality from NinjaTrader.Core to place/change/cancel orders (also ATM)

Reply With Quote
  #5 (permalink)
 vantojo 
Vilcabamba, Ecuador
 
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012

OK, wonderful, but where do I get the documentation so I can make the calls?

Is that on futures.io (formerly BMT) somewhere?

I need to

1) Place ATM Order
2) Cancel Pending Order
3) Close Active Positions

Have used OIF files with success but prefer another method that does not require writing a file to disk

Thank you!!

Started this thread Reply With Quote
  #6 (permalink)
 vantojo 
Vilcabamba, Ecuador
 
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012

Ok I'm showing my ignorance.

I found the iObject methods in the standard Ninja documentation, was not aware of them before.

Is this what what you refer to decs0057 about NinjaTrader.Core methods?

But, I do not see a way to submit an ATM though these methods...any ideas?

Worst case I can use OIF files, but I imagine they are a bit slower than calling a dll.

Another option might be for Ninja code to call another new dll whose only function was to pass the command string to NinjaTrader.Client or NTDirect.dll, which appear to have the same capability as the OIF files.

Any ideas guys?

Thank you.

Started this thread Reply With Quote
  #7 (permalink)
 decs0057 
Munich, Germany
 
Experience: Intermediate
Platform: NinjaTrader, TWS
Broker: IB, NinjaTrader Brokerage
Trading: ES,NQ,6E
Posts: 71 since Feb 2010
Thanks Given: 15
Thanks Received: 25

I also found no method to directly place ATM order with NT core method.
Other idea you have to send click event to context menu item "Buy/Sell Limit" of ChartControl

To cancel pending order search for order in Account and cancel it

To close Active Positions send click event to "Close" button of chart trader

Reply With Quote
  #8 (permalink)
 vantojo 
Vilcabamba, Ecuador
 
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012

Good idea to trigger the click event the Close button.

It will close both Pending Orders and Active Positions, and is fast with no OIF file...

It looks like NTDirect will submit ATMS, but may need to be called from outside Ninja...not sure yet.

Started this thread Reply With Quote




Last Updated on January 15, 2014


© 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