A tool to send orders based on a CSV (Comma Separated Values) File input. The tool accepts a CSV file that specifies the orders that need to be sent, one per row, and sends those orders out to the Server.
The tool operates in two modes.
runOrderloader [-m {sys|fix_version_num }] [-b broker ID ] [-u username ] [-p password ] csv_file_path
The options have the following purpose:
FIX.4.0, FIX.4.1, FIX.4.2, FIX.4.3, FIX.4.4
.
The brokerID has to be supplied in this mode. The expected input is a csv (comma separated values) file. The file can have any number of blank or commented lines. It is expected to have one header row that identifies the order in which various order field values exist within the file, followed by any number of lines, each specifying one order per line.
A blank line is a line that only has whitespace characters. A comment line is a line that has '#' as the first character on the line.
The fields on each line are separate by commas. Whitespace is significant, ie. all the text between commas is interpreted as field value including surrouding whitespace.
Each line of the file is expected to have the same number of fields as the header. It's an error if a line does not have the same number of fields as the header.
The system mode supports a pre-defined set of fields for every order and any number of custom fields. A custom field is a field that is not a pre-defined field and has a numeric header value.
The pre-defined fields can be identified as the values of constants with
the prefix FIELD
in the class
{@link org.marketcetera.orderloader.system.SystemProcessor}.
Here is a list of pre-defined field headers.
Field Header | Required/Optional | data type |
Account | Optional | text |
OrderCapacity | Optional | Enumeration. See {@link org.marketcetera.trade.OrderCapacity} |
OrderType | Required | Enumeration. See {@link org.marketcetera.trade.OrderType} |
PositionEffect | Optional | Enumeration. See {@link org.marketcetera.trade.PositionEffect} |
Price | Optional | decimal |
Quantity | Required | decimal |
Side | Required | Enumeration. See {@link org.marketcetera.trade.Side} |
Symbol | Required | text |
SecurityType | Optional | Enumeration. See {@link org.marketcetera.trade.SecurityType} |
TimeInForce | Optional | Enumeration. See {@link org.marketcetera.trade.TimeInForce} |
Expiry | Optional, required for Option. | Expiry date in format: YYYYMM or YYYYMMDD or YYYYMMwN |
StrikePrice | Optional, required for Option. | decimal |
OptionType | Optional, required for Option. | Enumeration. See {@link org.marketcetera.trade.OptionType |
Here's a sample csv input for system mode.
Symbol,Side,Quantity,Price,OrderType,TimeInForce,Account AAPL,SellShort,4000,4.26,Limit,Day,Account1 GOOG,Buy,2000,,Market,Day,Account2 GOOG,SellShort,4000,408.18,Limit,Day,Account1 MSFT,Sell,2000,22.81,Limit,Day,Account2 IBM,Buy,5000,77.65,Limit,Day,Account1
The FIX mode supports any FIX field supported by the FIX data dictionary. The header name for every FIX field is the same as the its simple class name in the package {@link quickfix.field} (that is, without the package name).
The value supplied for each FIX field in each row is directly set as the value of the FIX field. Following fields have special interpretation.
The valid values for Side field are: B, S, SS, & SSE that stand for Buy, Sell, Sell Short and Sell Short Exempt respectively.
Price should be a valid decimal value greater than zero.
The sentinel value MKT
can be specified as price for Market
orders.
Quantity should be a valid integer value greater than zero.
Time in Force values should be the same as the name of char constant fields specified in the class {@link quickfix.field.TimeInForce} to represent the valid time in force enum values. For example, DAY, FILL_OR_KILL, etc.
Here's a sample csv input for FIX mode.
Symbol,Side,OrderQty,Price,TimeInForce,Account IBM,B,100,12.1,DAY,123-ASDF-234 IBM,SS,100,12.22,DAY,123-ASDF-234 EFA,SSE,100,MKT,DAY,9182379812 EFA,SSE,100,MKT,FILL_OR_KILL,9182379812