JTOOLS TIME SALES FILE GENERATOR


JTools Table of Contents


Project Location: \JTools_TSFileGenerator



One of the more common requests I've gotten at Nanex is for a command line, argument driven application that could be scripted easily and will export time and sales data (for a single issue) to a file. As such, here is an application that does just that.

The JTools_TSFileGenerator is a command line console application driven by the arguments passed into it. It allows you to dump time and sales reports for any single symbol in almost any fashion you desire. Every field available for NxCore Trade, ExgQuote and MMQuote messages is offered as possible output. Fields generated and field order are determined by the usage strings passed into the application arguments (see below for a complete list of possible fields). It will dump the output to the console (if specified to) and to a text file, the name of which is also passed in as an argument.

Below is the output as the TS Generator starts up:




And as it starts generating data for the time frame specified:




Output is exported to a text file for easy viewing or importing:


USAGE:
(This format is fixed. Arguments must be in the order specified. All arguments must be present).

JTools_TSGenerator
Arg1 - NxCore Filename (examples: E:\NxCoreData\20100506.IV.NXC, E:\NxCoreStateFiles\20100506.0940.NXS) If "0" is given as the filename, then the system will try and launch into the NxAccess real time buffers.
Arg2 - Symbol (example: eAAPL) Symbols may use wildcards but only for one symbol class. For instance "e*" will generate data for all equities.

Arg3 - Trade Usage/Output String ("0" for no trades) possible values:
(s) Symbol (e) Listed Exg (r) Reporting Exg (d) Date (q) Sequence (t) Exg Time (n) Nx Time (p) Price (m) Size (x) Tick (a) Trade Condition (b) Price Flag (c) Condition Flag (f) Volume Type (g) BATE Code (1) Open (2) High (3) Low (4) Last (5) NetChg (6) Total Volume (7) Tick Volume (8) NxFilter Level (u) UserData (i) Index (z) Stream Code
Example: "serdqtpmabcf"
Usage letters can be in any order and output is based on the order entered.
Arg4 - Exg Quote Usage/Output String ("0" for no exg quotes) possible values:
(s) Symbol (e) Listed Exg (r) Reporting Exg (d) Date (t) Exg Time (n) Nx Time (b) Bid Price (a) Ask Price (c) Bid Size (f) Ask Size (g) Refresh (h) Quote Condition (x) NASDQ Bid Tick (1) Best Bid, (2) Best Ask, (3) Best Bid Size (4) Best Ask Size, (5) Best Bid Exg, (6) Best Ask Exg (7) Best Bid Cond (8) Best Ask Cond (9)BBO Change Flags (0) Closing Quote Flag (u) UserData (i) Index (z) Stream Code
Example: "serdtbacfh1234"
Usage letters can be in any order and output is based on the order entered.
Arg5 - MM Quote Usage/Output String ("0" for no exg quotes) possible values:
(s) Symbol (m) MarketMaker (e) Listed Exg (r) Reporting Exg (d) Date (t) Exg Time (n) Nx Time (b) Bid Price (a) Ask Price (c) Bid Size (f) Ask Size (g) Refresh (h) Quote Condition (x) NASDQ Bid Tick (1) MarketMakerType (2) QuoteType (u) UserData (i) Index (z) Stream Code
Example: "smerdtbacfh"
Usage letters can be in any order and output is based on the order entered.
Arg6 - Start Time (HHMMSS). Example - "093000"
Arg7 - Stop Time (HHMMSS). Example - "160000"
Arg8 - Desired Listing Exchange ("0" for all)
Arg9 - Desired Reporting Exchange ("0" for all)
Arg10 - Exchange Codes as Text ("1" for yes,"0" for no)
Arg11 - Condition Codes as Text ("1" for yes, "0" for no)
Arg12 - Decimal precision ("0" - "5")
Arg13 - Display prints to console as well as output to file ("1" for yes,"0" for no)
Arg14 - Print headers in output file ("1" for yes, "0" for no)
Arg15 - Output filename (if '0' is given then "output.txt" will be used) example - "MyCrazyOutput.txt"
Arg16 - If you would like the output to be dispayed in an editor when complete, specify the full path of the editor, such as "C:\i386\notepad.exe". If no argument is given then no editor is launched.



I have included 3 batch files that are pre-coded to request eAAPL from 9:41:30 to 9:45:30. One requests trades only, one trades plus quotes, and one trades, quotes and market maker (depth) quotes. The batch files are titled as:
  • TradesOnly.bat
  • TradesAndQuotes.bat
  • TradesQuotesMMQuotes.bat
You MUST modify the files to correspond with an NxCore file you have. Once that is done, simply click on one of these batch files from Windows explorer or run them from the command line. Output will be displayed in the console and output files will be built containing the data requested.



I have also written a GUI for this application that spawns the command line TS File Generator with the appropriate arguments:




Once "SpawnTime/Sales File Generator" is pressed, the command line TS File Generator goes into action:



Project Location: \JTools_TSFileGenerator\JTools_TSFileGeneratorGUI



Taking the GUI launcher one step further I have included another project which looks for/reads from state files the same way the JTools_StateFileReader application does. Just enter the date, times and symbol desired and spawn the generator. If the state files are present you will get immediate feedback from the TSFileGenerator:



Like the JTools_StateFileReader, it is very important that you first set the StateFileSettings to match that of the JTools_StateFileWriter:




As with all applications your settings are saved to an INI file so you only need to do this once.



Project Location: \JTools_TSFileGenerator\JTools_TSFileGeneratorGUI_II



While the JTools_TSFileGenerator is a powerful took on it's own. Combining it with the JTools_StateFileWriter applications gives you immediate feedback, and combining both with a GUI to drive it all means easy, immediate access to tick data for anyone. With a little imagination the possibilities are endless:






JTools Table of Contents