Need to Plot Historical Market Data

Discussion in 'App Development' started by Money Trust, Apr 18, 2022.

  1. I'm not sure where this thread goes and I apologize in advance if it's in the wrong section.

    I have a set of historical market data going back to the year 1900. Data for stock market indices, commodities, financials, etc. However, I'm not sure how to use this data in order to create a chart. I've tried with NinjaTrader with no luck. The data comes in Excel files, by the way.

    Would someone be willing to look over the data files and suggest what I could potentially do?
     
  2. ph1l

    ph1l

  3. easymon1

    easymon1

  4. SunTrader

    SunTrader

    I can plot Dow back to 1900 in TradeStation but there are some issues for some reason with weeks (start/end points) not matching the calendar.

    Data is in ASCII comma delimited text form. Try converting it and see.
     
    murray t turtle and Money Trust like this.
  5. Thanks guys.
     
  6. NinjaTrader_Ray

    NinjaTrader_Ray ET Sponsor

    easymon1 likes this.
  7. I tried that but it didn't work. I'm guessing that the format of the data itself is incompatible with NT.
     
  8. easymon1

    easymon1

    Can you load a data file into notepad and copy and paste the first dozen lines and post them in this thread?
     
  9.  
  10. ph1l

    ph1l

    The format of the file would need to be something like
    https://ninjatrader.com/support/helpGuides/nt8/?importing.htm#UnderstandingImportFileAndDataFormats
    For example, I created the attached Grains.Last.txt with
    Code:
    cat Grains.txt | perl -n -e 'use warnings; use strict;
    our @mmDays; our $prevCl; BEGIN { @mmDays = qw/0 31 28 31 30 31 30 31 31 30 31 30 31/; }
    my $iline = $_; $iline =~ s/[",]//g;
    my ($mm, $yyyy, $hi, $lo, $cl) = $iline =~ qr#^(\d\d)/(\d\d\d\d)\s+(\S+)\s+(\S+)\s+(\S+)\s+$#;
    if ( !defined($cl) ) { next; }
    if ( ! defined($prevCl) ) { $prevCl = $cl; }
    print "$yyyy$mm$mmDays[$mm];$prevCl;$hi;$lo;$cl;0\n";
    $prevCl = $cl;' > Grains.Last.txt
    
    I don't have NinjaTrader installed, so I just looked at the output.
     
    #10     Apr 20, 2022
    easymon1 and Money Trust like this.