• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MarketData()

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

    MarketData()

    Can someone provide a sample file to demo how to use MarketData() and UnsubscribeMarketData() in eSignal + NT DLL?

    double MarketData(string instrument, int type)

    int UnsubscribeMarketData(string instrument)

    The sample EFS coming with NT installed does not use these two functions.

    Thanks in advance.

    - Clearpicks

    #2
    Also is it possible to retrieve a series of OHLC data from NT DLL instead of only the last, bid and ask prices?

    - Clearpicks

    Comment


      #3
      Demo file -I will put on our list but for now I suggest trying it via trial an error
      OHLC - This is not possible
      RayNinjaTrader Customer Service

      Comment


        #4
        I have tried and could not get them working. The EFS just silently stop at where SubscribeData() is called and no error message is shown.

        Comment


          #5
          You must first call

          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.
          RayNinjaTrader Customer Service

          Comment


            #6
            I called SubscribeMarketData() but EFS stops working there. I wrote the function name wrong in my previous post. I will post an example file later.

            Comment


              #7
              It works now. The problem was caused by typos in my source code.

              Comment


                #8
                When using marketdata() to retrieve streaming data from IB through NT DLL, do I need to open a corresponding chart in NinjaTrader? I don't think it is necessary, but I am not sure.

                Also it seems I can never get NT DLL to retrieve data of "YG Z8" correctly. It always shows the last price is 881.0, while for other symbols such as "GC Z8" and "6E U8", it works flawlessly.

                Comment


                  #9
                  What would happen if I don't explicitly unsubscribe market data before I change chart symbol or reload the EFS in which some market data are subscribed and is actively receiving streaming data from NT?

                  Comment


                    #10
                    It seems it was because the connection between NT and IB TWS for "YG Z8" was broken, so that not only the market retrieved by NT DLL is not correct, the "YG Z8" in NinjaTrader was frozen also. Is it because "YG Z8" is so lightly traded and for some minutes there is no trades at all. Was the chart freezing caused by such "no trade" bars?

                    - Clearpicks

                    Comment


                      #11
                      You state the connection was broken and this would cause the chart to freeze.

                      Also since IB filters there ticks, and the charts are built off of last there could be some freezing as there may not be any "Last" reported for some time on a very lightly traded instrument.
                      JessicaNinjaTrader Customer Service

                      Comment


                        #12
                        Can someone answer the question below? Thanks in advance.

                        Originally posted by clearpicks View Post
                        What would happen if I don't explicitly unsubscribe market data before I change chart symbol or reload the EFS in which some market data are subscribed and is actively receiving streaming data from NT?

                        Comment


                          #13
                          The subscription would keep running until you unsubscribe.
                          DierkNinjaTrader Customer Service

                          Comment


                            #14
                            Originally posted by clearpicks View Post
                            It works now. The problem was caused by typos in my source code.
                            clearpicks, i've been trying for a while to do the same thing you initially posted about, but have been unsuccessful. could you please share your code to get me started in the right direction? even a PM would be greatly appreciated, but i think you should post it in this thread to help others out as well.

                            thank you,
                            auspiv

                            Comment


                              #15
                              A simple efs file to demo how to retrieve market data from NT.
                              Attached Files

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by StevenNelson, 11-19-2019, 05:39 AM
                              3 responses
                              14 views
                              0 likes
                              Last Post brucerobinson  
                              Started by guidoisot, Today, 03:01 AM
                              0 responses
                              2 views
                              0 likes
                              Last Post guidoisot  
                              Started by rontronimous, Yesterday, 05:55 PM
                              0 responses
                              9 views
                              0 likes
                              Last Post rontronimous  
                              Started by bcgeek, Yesterday, 03:43 PM
                              2 responses
                              8 views
                              0 likes
                              Last Post bcgeek
                              by bcgeek
                               
                              Started by Mberg, Yesterday, 04:05 PM
                              1 response
                              17 views
                              0 likes
                              Last Post NinjaTrader_ChrisSch  
                              Working...
                              X