Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Connecting NT8 and Python

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

    Connecting NT8 and Python

    Hi everybody
    I hope you are doing well


    I was wondering if you could help me on connecting NT8 and python, to have the data (specially volume data) as a variable in python. I did searched for similar topics, however, I was not able to find a straight path into this.

    These are those that I have found! If anything is wrong in these, please let me know:
    There is a DLL file which seems to have some data in it. This file could be "requested" in python and by using functions pre-defined in NT8 documentation, a number of tools become available.
    However, as I have found out, these information do not include volumes. I can get OHLC using Metatrader5 package, but we all know that it is not what we are looking for.

    So, help me on this please, if there is a way, or if you have found one. A simple useful hint would be more than enough for me to dig in.

    Be well and keep safe.

    #2
    Hello shahabkabiri,

    Thanks for your post.

    NinjaTrader uses the C# programming language for developing custom NinjaScript AddOns. Using the Python programming language for NinjaScripts is not documented or supported and we would not be able to provide assistance with using Python.

    That said, this thread will be open for other community members to share their insight on this topic.

    Let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Dear Brandon
      Hi again and thanks for your reply.
      I might ask my question a bit different to express what I need. Is there any place (a URL or a file on my local hard drive or anywhere) that I can get the volume-price data in any format? I can easily arrange and organize them, once provided. there should be a place where these data are stored and viewed in the NT8 program. Where is it? Is it possible to have access to it?

      Comment


        #4
        Hello shahabkabiri,

        Thanks for your note.

        You could export historical data using the Export feature (Tools > Export > Historical Data).

        See this help guide page for more information: https://ninjatrader.com/support/help.../exporting.htm

        Or, you could consider using a StreamWriter to write the data to a text file.

        See this reference sample which demonstrates using a StreanWriter: https://ninjatrader.com/support/help...o_write_to.htm

        Let us know if we may assist further.
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          Dear Brandon
          Hi again and thanks for your data.
          May you be so kind and tell me a couple of things? I do apologize if these are quite clear but I don't know them.

          It seems that the data I am looking for is the tick data.
          the downloaded data have a format like below:
          20220208 100001 3560000 1.1414 210
          The first column is the date and the second is the time. what is the third column?
          The fourth column is the price (ask or bid)
          I suppose the last column is the volume. is that right? if so, what is the unit? Or it is just all the orders, including those that were not executed? if these data also include those that were not executed, how can I filter those that WERE executed? In other words, real executed volume.

          Can you help me on that?
          Thanks in advance.
          Last edited by shahabkabiri; 02-11-2022, 11:10 AM.

          Comment


            #6
            Hello shahabkabiri,

            Thanks for your note.

            The format for Tick Data would be yyyyMMdd HHmmss fffffff; price; volume. Note that fffffff refers to milliseconds.

            For information about data formats, see this help guide page: https://ninjatrader.com/support/help...AndDataFormats

            Let us know if we may assist further.
            Brandon H.NinjaTrader Customer Service

            Comment


              #7
              Dear Brandon
              Hi again and thanks again
              Could you please be more specific regarding the data that the NT8 platform exports?
              As I saw, there are three types of data that I can export based on tick. one is the last, one is the ask and one is the bid. All these three come with a volume. However, the volume for last, seems to add up to what is seen in NT8 , however, I cannot find the other two volumes; ask and bid volumes. Can you tell me what they are?

              I do appreciate that.

              Comment


                #8
                Hello shahabkabiri,

                Thanks for your note.

                When exporting historical Tick data from the Tools > Export > Historical Data window, you could choose if you want to export data with the Last, Ask, or Bid price. If you want to print the Ask or Bid, you would need to set the Data Type field to 'Ask' or 'Bid' when exporting the data.

                Note that the Volume will be included when exporting the Last data type. If you choose to export Ask or Bid data type, the Ask or Bid Volume would not be included and would read 0 or be blank in the export file. This could be seen by exporting each data type for the same instrument and comparing those export files.

                See this help guide page for information about using the Tools > Export > Historical Data window: https://ninjatrader.com/support/help.../exporting.htm

                Let us know if we may assist further.
                Brandon H.NinjaTrader Customer Service

                Comment


                  #9
                  hi Shahab I have find some way to extract data
                  please call me on whatsapp : 00989335283564

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by algospoke, 04-17-2024, 06:40 PM
                  6 responses
                  49 views
                  0 likes
                  Last Post algospoke  
                  Started by arvidvanstaey, Today, 02:19 PM
                  4 responses
                  11 views
                  0 likes
                  Last Post arvidvanstaey  
                  Started by samish18, 04-17-2024, 08:57 AM
                  16 responses
                  61 views
                  0 likes
                  Last Post samish18  
                  Started by jordanq2, Today, 03:10 PM
                  2 responses
                  11 views
                  0 likes
                  Last Post jordanq2  
                  Started by traderqz, Today, 12:06 AM
                  10 responses
                  21 views
                  0 likes
                  Last Post traderqz  
                  Working...
                  X