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.

                          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 jaybedreamin, Today, 05:56 PM
                              0 responses
                              3 views
                              0 likes
                              Last Post jaybedreamin  
                              Started by DJ888, 04-16-2024, 06:09 PM
                              6 responses
                              18 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Started by Jon17, Today, 04:33 PM
                              0 responses
                              1 view
                              0 likes
                              Last Post Jon17
                              by Jon17
                               
                              Started by Javierw.ok, Today, 04:12 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post Javierw.ok  
                              Started by timmbbo, Today, 08:59 AM
                              2 responses
                              10 views
                              0 likes
                              Last Post bltdavid  
                              Working...
                              X