I'm working on a standalone Form in C# Express Edition IDE which needs to access my NT/ZenFire account to pull in OnMarketData(); I have the proper NT libraries imported/referenced and am able to get my app to display, however, I don't know how to get a connection to my datafeed. Does someone have an answer to this? Thank you in advance.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
C# Question For Fellow Programmers...
Collapse
X
-
C# Question For Fellow Programmers...
NT support does not support this type of question, so I'm relying on the NT Programming community:
I'm working on a standalone Form in C# Express Edition IDE which needs to access my NT/ZenFire account to pull in OnMarketData(); I have the proper NT libraries imported/referenced and am able to get my app to display, however, I don't know how to get a connection to my datafeed. Does someone have an answer to this? Thank you in advance.Tags: None
-
Hi funk101, did you already check into this sample? - http://www.ninjatrader-support.com/H...plication.html
-
Well,
The best way to do this would be to setup an event handler which is fed by NT, but I'm not sure that NT supports this. You have two options
1. According to the DLL functions, we have the following relevant calls.
int SubscribeMarketData(string instrument)
Starts a market data stream for the specific instrument. Call the MarketData() function to retrieve prices. Make sure you call the UnSubscribeMarketData() function to close the data stream. A return value of 0 indicates success and -1 indicates an error.
int UnsubscribeMarketData(string instrument)
Stops a market data stream for the specific instrument. A return value of 0 indicates success and -1 indicates an error.
double MarketData(string instrument, int type)
Gets the most recent price for the specified instrument and data type. 0 = last, 1 = bid, 2 = ask. You must first call the SubscribeMarketData() function prior to calling this function.
You could setup some soft of Thread to constantly call MarketData, although this may be taxing and inconsistent with fast moving price data.
2. You can run this form from an indicator (I know you said you didn't want to; maybe use the Market analyzer rather than a chart). In this manner, you can setup an event handler that simply passes through the OnMarketData() function to source your external app. This would be an engine that sources data every time new data is available, rather than constantly checking "hey, is there new data", "hey, is there new data", etc.
This is the method I would recommend.
I hope this is helpful
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
93 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
48 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
31 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
34 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
70 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment