Step 3: Get the Appropriate Script File
Previous  Top  Next

At this point, you need to put a script file in the folder that will give the TradeMatcher the direction it needs to process your files. If you don't give it a script file, when you run the program and click the button it is simply going to tell you that it doesn't have a script file and halt.

While you can create a script file yourself, in most cases it isn't necessary. The download when unzipped contains a folder of supplied scripts for various brokerages. Simply copy the one that applies to your account to the project folder and rename it "script.txt" [please note that depending on your operating system the ".txt" extension may or may not show for text files. If you name it script.txt and you get an error message saying the script file does not exist, drop the .txt characters as your file is actually named script.txt.txt and your operating system is simply not showing the extension].

You may also use a script from this document or visit the www.tradematcher.com website and pick out the appropriate script text. If you choose to create your own scripts, simply open up Notepad or other text editor and type in script commands and save the file with the name "script" and make sure the file type is set to text (such that the actual and full file name is "script.txt").

NotePad is found on virtually every computer with the microsoft Windows operating system, and is usually accessible from the Accessories menu from the Programs choice accessible from the Start button. You can also do a Search or Find operation to locate it on your machine.

Feel free to contact Sapphire Bay Software if we don't have a script for your account and you would be willing to send us your data. It's in our interest to add to our library of scripts for the convenience of our users. We are always willing to expand our selection! You may reach us by email at wdurden@sapphirebay.com or by phone at (912) 897-0435 during business hours for the eastern time zone.

Here are three common scripts that we know will apply to our largest customer base. NOTE: These scripts are commented and are larger than need be because of the comments included therein. They also do not apply the wash filtering. To apply wash filtering read carefully the section that applies to wash sales below!. Simply open Notepad on your computer, copy the script text below and paste it into Notepad. Then save the document with name "script" with the document type set to text such that the full name is "script.txt" to the project file.

A script to preprocess and match Datek style data: [to use this file as is, your data file should be named "2003transactions.txt" which is the default download name]
 
'this works with Datek style data
'captures the needed fields
'strips out lines that are not buys or sells
'matches then deletes intermediate files
'it uses the name "2003transactions.txt" for input which
'is the default download file name
reorder|2003transactions.txt|reordered.txt|,|,|11,5,9,6,8
striplines|reordered.txt|mergedfile.txt|strippedlines.txt|2|,|b|s
match|mergedfile.txt
delete|reordered.txt
delete|matchedfile.csv
delete|matchedfile2.csv
delete|mergedfile.txt

SPECIAL NOTE: Most Datek style accounts have been moved to Ameritrade now, and the data is captured from the advanced transactions list at the bottom of the history page. This format differs from the standard Ameritrade format and the following script applies: [to use this file as is, your data file should be named "inputfile.txt"]

'this works with datek data moved to ameritrade
'it reduces multiple spaces to single spaces
'captures the needed fields
'strips out lines that are not buys or sells
'matches then deletes intermediate files
replace|inputfile.txt|outputfile.txt| |
reorder|outputfile.txt|reordered.txt| |,|2,3,5,4,7
striplines|reordered.txt|mergedfile.txt|strippedlines.txt|2|,|bought|sold
match|mergedfile.txt
delete|outputfile.txt
delete|reordered.txt
delete|reversed.txt
delete|matchedfile.csv
delete|matchedfile2.csv
delete|mergedfile.txt

A script to process and match native Ameritrade data: [requires the trade data file named "inputfile.txt"]
 
'this works with ameritrade data
'it reduces multiple spaces to single spaces
'captures the needed fields
'reverses chronological order
'strips out lines that are not buys or sells
'matches then deletes intermediate files
replace|inputfile.txt|outputfile.txt| |
replace|outputfile.txt|outputfile2.txt|BUY TO COVER|BUY
replace|outputfile2.txt|outputfile.txt|SELL SHORT|SELL
reorder|outputfile.txt|reordered.txt| |,|1,7,8,10,13
reverse|reordered.txt|reversed.txt
striplines|reversed.txt|mergedfile.txt|strippedlines.txt|2|,|buy|sell
match|mergedfile.txt
delete|outputfile.txt
delete|outputfile2.txt
delete|reordered.txt
delete|reversed.txt
delete|matchedfile.csv
delete|matchedfile2.csv
delete|mergedfile.txt
 
And a script to process Scottrade data:[requires the trade data file named "inputfile.txt"]

'this works with scottrade data
'it replaces tabs with commas
'captures the needed fields
'reverses chronological order
'strips out lines that are not buys or sells
'matches then deletes intermediate files
replace|inputfile.txt|outputfile.txt|tab|,
reorder|outputfile.txt|reordered.txt|,|,|5,4,2,1,9
replace|reordered.txt|outputfile.txt|equity|
reverse|outputfile.txt|reversed.txt
striplines|reversed.txt|mergedfile.txt|strippedlines.txt|2|,|buy|sell
match|mergedfile.txt
delete|outputfile.txt
delete|reordered.txt
delete|reversed.txt
delete|matchedfile.csv
delete|matchedfile2.csv
delete|mergedfile.txt