Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

minute conversion tool

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

    minute conversion tool

    Hi,

    In histo data under instrument there's minute data.
    Is there a way with nt we can get those data to appear in 5, 10, 15 minutes for exemple instead of one minute?

    If not there should be a tool to convert otherwise is there some free software that allow data conversion from nt hist data?

    Frank
    TY

    #2
    Hello frankduc,

    Thanks for your post.

    You can create a chart with bars of your choice then use a script to export those bar values. You can find an example of a script that does this here: http://ninjatrader.com/support/forum...ead.php?t=3475

    As is, the script will export the Open, High, Low, Close, and Time stamp of each bar.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      not sure how script works

      Thank you Paul,

      But i am not sure how it works.
      I did the installation, i got the sample stream writer from indicator in my chart.
      Now how do i get the data to export into excel format spreadsheet.
      Its a 10 minute chart of ES 09-17.

      Does it export volume as well?

      Frank
      ty

      Comment


        #4
        Hello Frank,

        Thanks for your reply.

        Once you add it to a chart it will immediately write all the existing data to a file. In the code file it advises that it will output to a text file called MyTestFile.txt which I believe will be located in Documents>NinjaTrader8 The data in each line is separated by a space so when you import to a spreadsheet you can select space as the column seperator.

        The purpose of the working reference file is to demonstrate how through C#/Ninjascript you can have an indicator write data to a file. It is provided as is for educational purposes for those that want to learn how to do this for their own code.

        You are more than welcome to use as is. If you want to modify for your purposes you are welcome to do so.

        To modify the indicator to output volume, you would need to open the script in the Ninjascript editor (New>Ninjascript Editor find the indicator file in the indicators folder). Once the code is open you change the line:

        From:
        sw.WriteLine(Time[0] + " " + Open[0] + " " + High[0] + " " + Low[0] + " " + Close[0]); // Append a new line to the file

        To:

        sw.WriteLine(Time[0] + " " + Open[0] + " " + High[0] + " " + Low[0] + " " + Close[0]+" "+Volume[0]); // Append a new line to the file

        Once changed, right mouse click on the code file and select "compile". Close the NS editor window, then remove the indicator from the chart and then re-add the indicator.
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Paul,

          Thank you everything is working fine. It just saved me hours of work.

          Comment


            #6
            Hi Paul,
            I edited it also to save time, not only date, and volume. It works fine. Could you please suggest how to edit the script to save several time series next to each other while matching the date and time for each line if there would be any data for any time series (or only when there would be all, both options would work for me)? I struggle to pair OHLC data across several time series with different dates and times to get them in a row next to each other for any available date and time. Since I work with minute data, it is problematic to do that in Excel as there are many more than 1 million rows. I am trying to put together SP500,VXTLT, and VIX.
            Petr

            Comment


              #7
              Hi nicknamed, thanks for posting. Unfortunately, this goes outside of the scope of support we are able to provide as it's going more into the territory of how to write C# to write to the file. One behavior of multi time frame scripts is that the primary series will always be called first, see the documentation here:

              Chris L.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by bsbisme, Yesterday, 02:08 PM
              1 response
              15 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by prdecast, Today, 06:07 AM
              0 responses
              3 views
              0 likes
              Last Post prdecast  
              Started by i019945nj, 12-14-2023, 06:41 AM
              3 responses
              60 views
              0 likes
              Last Post i019945nj  
              Started by TraderBCL, Today, 04:38 AM
              2 responses
              18 views
              0 likes
              Last Post TraderBCL  
              Started by martin70, 03-24-2023, 04:58 AM
              14 responses
              106 views
              0 likes
              Last Post martin70  
              Working...
              X