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.htmlBertrandNinjaTrader Customer Service
-
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 trilliantrader, 04-18-2024, 08:16 AM
|
5 responses
22 views
0 likes
|
Last Post Today, 12:32 AM | ||
Started by Davidtowleii, Today, 12:15 AM
|
0 responses
3 views
0 likes
|
Last Post
by Davidtowleii
Today, 12:15 AM
|
||
Started by guillembm, Yesterday, 11:25 AM
|
2 responses
9 views
0 likes
|
Last Post
by guillembm
Yesterday, 11:58 PM
|
||
Started by junkone, 04-21-2024, 07:17 AM
|
9 responses
70 views
0 likes
|
Last Post
by jeronymite
Yesterday, 11:51 PM
|
||
Started by mgco4you, Yesterday, 09:46 PM
|
1 response
14 views
0 likes
|
Last Post Yesterday, 09:56 PM |
Comment