Announcement

Collapse
No announcement yet.

Getting FX downloaded TickData to Replay

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

  • Getting FX downloaded TickData to Replay

    After whining all day about Edit Studies being broken, I figured I'd make restitution.

    Wonder why downloaded Forex tickdata won't replay? Each line begins with a 'Q' instread of a 'T'. Go figure.

    I wrote a perl script to fix it (see below).
    -Install perl if you don't already have it.
    -Save the following as a text file <scriptname>.
    -Run it as >perl scriptname downloaded_data.epf
    -Load your fixed tickdata (make sure chart time template is 24 hour, Dynamic 0:00-0:00)

    You can get perl from:
    http://www.activeperl.com/Products/D...?id=ActivePerl

    Don't put spaces in your filenames unless you like wrapping them in quotes.

    Script works as-is in both Windows and Lin/Unix (... depending on your *nix location of perl of course!)

    enjoy,
    -function THEO( Penitent );



    #!/usr/bin/perl -w
    my $a = $ARGV[0];
    my $b;
    my $line;

    if ( $ARGV[0] =~ /(.*)\.[eE][pP][fF]/ ) {
    $b = $1 . "_FIXED.epf";
    print "Processing $a into $b\n";
    } else {
    die "Source file must come from eSignal and have an .epf extension.\n";
    }

    open (INFILE, "< $a");
    open (OUTFILE, ">$b");

    while (<INFILE>) {
    $line = $_;
    $line =~ s/Q,(.*)/T,$1/;
    print OUTFILE "$line";
    }

    close(INFILE) || die "Can't close $a: $!";
    close(OUTFILE) || die "Can't close $b: $!";

  • #2
    eSignal won't let you parse out a single data source (or group) in the FX feed, but you can do whatever you want with the datafile...

    Use this perl script to pull out one source while fixing the file.
    -Edit the file to change "FXCM" with "GAIN" or "BL" or whatever source you are looking for. (Look inside your downloaded data file for options).
    -Run it on the original file.
    -Back test against it.

    -function THEO();



    #!/usr/bin/perl -w
    my $a = $ARGV[0];
    my $b;
    my $c = "FXCM";
    my $line;

    if ( $ARGV[0] =~ /(.*)\.[eE][pP][fF]/ ) {
    $b = $1 . "_FIXED_$c-only.epf";
    print "Processing $a into $b\n";
    } else {
    die "Source file must come from eSignal and have an .epf extension.\n";
    }

    open (INFILE, "< $a");
    open (OUTFILE, ">$b");

    while (<INFILE>) {
    $line = $_;
    $line =~ s/Q,(.*)/T,$1/;
    if ( $line =~ /(.*,$c,$c).*/ ) {
    print OUTFILE "$1\n";
    #print "$line\n";
    }
    }

    close(INFILE) || die "Can't close $a: $!";
    close(OUTFILE) || die "Can't close $b: $!";

    Comment

    Working...
    X