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.

Usage

The tool operates in two modes.

  1. System Mode : This is the default mode. The orders sent are agnostic of the specific protocol or its version used by the broker. Orders sent in this mode can be sent to any broker that the Server is connected to.
  2. FIX Mode : In this mode, the orders are sent in as FIX messages, encoded in a specific FIX Version. Orders sent in this mode can only be sent to a specific broker that the Server is connected to. Moreover, the messages need to contain all the fields that the targeted broker needs the message to have in order to process it.

Syntax

    runOrderloader [-m {sys|fix_version_num }] [-b broker ID ] [-u username ] [-p password ] csv_file_path

The options have the following purpose:

CSV Input Syntax

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.

System Mode

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 HeaderRequired/Optionaldata type
AccountOptionaltext
OrderCapacityOptionalEnumeration. See {@link org.marketcetera.trade.OrderCapacity}
OrderTypeRequiredEnumeration. See {@link org.marketcetera.trade.OrderType}
PositionEffectOptionalEnumeration. See {@link org.marketcetera.trade.PositionEffect}
PriceOptionaldecimal
QuantityRequireddecimal
SideRequiredEnumeration. See {@link org.marketcetera.trade.Side}
SymbolRequiredtext
SecurityTypeOptionalEnumeration. See {@link org.marketcetera.trade.SecurityType}
TimeInForceOptionalEnumeration. See {@link org.marketcetera.trade.TimeInForce}
ExpiryOptional, required for Option.Expiry date in format: YYYYMM or YYYYMMDD or YYYYMMwN
StrikePriceOptional, required for Option.decimal
OptionTypeOptional, 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

FIX Mode

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