Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

C# Question For Fellow Programmers...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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.

    #2
    Hi funk101, did you already check into this sample? - http://www.ninjatrader-support.com/H...plication.html
    BertrandNinjaTrader Customer Service

    Comment


      #3
      funk,

      I'm not sure I understand what you're trying to do.

      Are you trying to make an external application that connects to NT via DLL to retrieve quote data?

      Thanks
      mrlogik
      NinjaTrader Ecosystem Vendor - Purelogik Trading

      Comment


        #4
        Yes it is an external app. Just a Windows : Form that displays a DataGridView of MarketData, ie: Bid, Ask, etc. I want to be able to run this stand alone, without being called as an indicator.

        Comment


          #5
          I've been disecting that Sample App. That's how I got thus far, but I don't think that sample app connects to an account and retrieves data, does it?

          Comment


            #6
            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
            mrlogik
            NinjaTrader Ecosystem Vendor - Purelogik Trading

            Comment


              #7
              Hi funk101, unfortunately this is all I can refer you to, as this is not supported.
              BertrandNinjaTrader Customer Service

              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 trilliantrader  
              Started by Davidtowleii, Today, 12:15 AM
              0 responses
              3 views
              0 likes
              Last Post Davidtowleii  
              Started by guillembm, Yesterday, 11:25 AM
              2 responses
              9 views
              0 likes
              Last Post guillembm  
              Started by junkone, 04-21-2024, 07:17 AM
              9 responses
              70 views
              0 likes
              Last Post jeronymite  
              Started by mgco4you, Yesterday, 09:46 PM
              1 response
              14 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Working...
              X