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 rocketman7, Today, 09:41 AM
|
4 responses
15 views
0 likes
|
Last Post
by rocketman7
Today, 02:56 PM
|
||
Started by selu72, Today, 02:01 PM
|
1 response
9 views
0 likes
|
Last Post Today, 02:17 PM | ||
Started by WHICKED, Today, 02:02 PM
|
2 responses
12 views
0 likes
|
Last Post
by WHICKED
Today, 02:15 PM
|
||
Started by f.saeidi, Today, 12:14 PM
|
8 responses
21 views
0 likes
|
Last Post
by f.saeidi
Today, 01:55 PM
|
||
Started by Mikey_, 03-23-2024, 05:59 PM
|
3 responses
53 views
0 likes
|
Last Post
by Sam2515
Today, 01:47 PM
|
Comment