NexusFi: Find Your Edge


Home Menu

 





Interact with NinjaTrader through c# windows form


Discussion in NinjaTrader

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




 
Search this Thread

Interact with NinjaTrader through c# windows form

  #1 (permalink)
Aziz
delhi india
 
Posts: 13 since Aug 2017
Thanks Given: 2
Thanks Received: 1

Are there any sample code which suggests how to interact with ninja trader i.e. without ninja script. I have a windows form and I want to send the bid/ask values to ninja trader in c# form. I have added the NinjaTrader.Client.dll in my project so what would be the next step?

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Cheap historycal L1 data for stocks
Stocks and ETFs
Better Renko Gaps
The Elite Circle
REcommedations for programming help
Sierra Chart
 
  #2 (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


Aziz View Post
Are there any sample code which suggests how to interact with ninja trader i.e. without ninja script. I have a windows form and I want to send the bid/ask values to ninja trader in c# form. I have added the NinjaTrader.Client.dll in my project so what would be the next step?

You will have to call the functions :

int Connected(int showMessage)

Returns a value of zero if the DLL has established a connection to the NinjaTrader server (application) and if the ATI is currently enabled or, -1 if it is disconnected. Calling any function in the DLL will automatically initiate a connection to the server. The parameter showMessage indicates if a message box is displayed in case the connection cannot be established. A value of 1 = show message box, any other value = don't show message box.


int Ask(string instrument, double price, int size)
Sets the ask price and size for the specified instrument. A return value of 0 indicates success and -1 indicates an error.


int Bid(string instrument, double price, int size)
Sets the bid price and size for the specified instrument. A return value of 0 indicates success and -1 indicates an error.

int AskPlayback(string instrument, double price, int size, string timestamp)
Sets the ask price and size for the specified instrument for use when synchronizing NinjaTrader playback with an external application playback. A return value of 0 indicates success and -1 indicates an error. The timestamp parameter format is "yyyyMMddhhmmss".

int BidPlayback(string instrument, double price, int size, string timestamp)
Sets the bid price and size for the specified instrument for use when synchronizing NinjaTrader playback with an external application playback. A return value of 0 indicates success and -1 indicates an error. The timestamp parameter format is "yyyyMMddhhmmss".

and at the end of the process

int TearDown()
Disconnects the DLL from the NinjaTrader server. A return value of 0 indicates success and -1 indicates an error.



Don't forget to enable ATI interface inside NT

good luck !

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #3 (permalink)
yawaniga
chennai/india
 
Posts: 155 since Sep 2015
Thanks Given: 111
Thanks Received: 149



Aziz View Post
Are there any sample code which suggests how to interact with ninja trader i.e. without ninja script. I have a windows form and I want to send the bid/ask values to ninja trader in c# form. I have added the NinjaTrader.Client.dll in my project so what would be the next step?

Hello Aziz,
Happy to see u here from India. As a NT User, very eager to learn automate our trade thru NT, If Possible Pls Share the Possibilities, BTW I 'm trying to trade on Indian MCX Segment, and no idea about programming knowledge of NT and Any API. But active PI Chart from concern broker.

Reply With Quote




Last Updated on August 9, 2017


© 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