Asset Lists and Account Lists

Any asset used in a script needs an entry in an asset list in the History folder (unless the asset is added by script). This entry determines all parameters and properties of the asset. The default asset list, AssetsFix.csv, also determines the assets that initially appear in the [Asset] scrollbox. Since any broker has his individual asset parameters, different asset lists can be used for different brokers and accounts. The asset list can be selected either by script through the assetList command, or automatically with an account list (see below). If no asset list is selected, the default list is used.

The parameters in the asset list affect training and testing. In live trading, asset parameters are normally not read from the list, but loaded from the broker API in real time. Only parameters not provided by the broker API are taken from the asset list. Since parameters from some broker APIs are not always reliable, the SET_PATCH command can be used to enforce the asset list parameters. If live parameters deviate strongly from list parameters, a warning is issued.

Asset lists are simple comma separated spreadsheet files (CSV files) that can be edited with Excel or with a text editor for adding new assets, or for modifying parameters. Every asset is represented by a line in the CSV file. New assets can be added either manually - by editing the file and entering a new line - or automatically as described below. For quickly adding a new currency pair to the asset scroll box, edit AssetsFix.csv with the script editor and copy the currency pair line over from the multi-currency list AssetsCur.csv. For adding a stock, copy a line from a stock list such as AssetsSP250.csv.

Example of an asset list:

Name Price Spread RollLong RollShort PIP PIPCost MarginCost Leverage LotAmount Commission Symbol AssetVar...
AUD/USD 0.77311 0.00005 0.05 -0.07 0.0001 2.2 0 33 25000 0.5   1
EUR/CHF 1.20104 0.00005 -0.23 0.1 0.0001 2 0 33 20000 0.5 EUR.CHF 2
EURCHF_FXCM 1.20012 0.00007 0 0 0.0001 0.1 0 100 1000 0.6 FXCM_Real:EUR/CHF 3
EUR/USD 1.13795 0.00005 0 0 0.0001 1.8 0 33 20000 0.5   4
GBP/USD 1.51364 0.00003 0 0 0.0001 1.5 0 33 17000 0.5   5
USD/CAD 1.24466 0.0001 0 0 0.0001 2.5 0 33 25000 0.5   6
USD/CHF 0.92203 0.00022 0 0 0.0001 2.5 0 33 25000 0.5   7
USD/JPY 117.489 0.004 0 0 0.01 1.7 0 33 25000 0.5   8
SPX500 2081.43 0.25 0 0 1 0.9 0 20 1 0.02 IBUS500-CFD-SMART  
US30 17703.2 3 0 0 1 0.9 0 20 1 0.02 IBUS30-CFD-SMART  
NAS100 4654.34 0.5 0 0 1 0.9 0 20 1 0.02 IBUST100-CFD-SMART  
UK100 6869 1 0 0 1 0.9 0 20 1 0.02 IBUK100-CFD-SMART-GBP  
GER30 10767.8 1 0 0 1 0.9 0 20 1 0.02 IBDE30-CFD-SMART-EUR  
XAG/USD 15.863 0.013 0 0 0.01 0.009 0 20 1 0.02 XAGUSD-CMDTY-SMART-USD  
XAU/USD 1156.25 0.07 0 0 0.01 0.009 0 20 1 1.6 XAUUSD-CMDTY-SMART-USD  

The first line is the header line. A line is ignored when it begins with "#". Names and symbols must contain no blanks, commas, or semicolons. Zorro also accepts semicolon separated csv files with commas instead of decimal points, but not a mix of both in the same file. Excel uses your local separation character, so make sure in your PC regional settings that it's a comma and the decimal is a point, otherwise Excel can not read standard csv files.

The asset parameters have the following meanings:

Name Name of the asset, f.i. "EUR/USD" (up to 15 characters, case sensitive, with no blanks and no special characters except for slash '/' and underline '_'). This name is used in the script and in the Asset scrollbox. The asset is ignored when the name begins with "#"; this way assets can be temporarily 'commented out'.
Price Ask price per contract, in counter currency units. Accessible with the InitialPrice variable. For non-Forex assets the counter currency is usually the currency of the exchange place, such as USD for US stocks, or EUR for the DAX (GER30). This parameter is for information only and not used in the backtest.
Spread The difference of ask and bid price of the asset, in counter currency units. Accessible with the Spread variable. Used in the backtest. If at 0, spread must be simulated in the script.
RollLong
RollShort
Rollover fee ("swap") for long or short trades per calendar day and contract, or per 10000 contracts for currencies, in account currency units. Accessible with the RollLong/Short variables. This is normally the interest that is daily added to or subtracted from the account for holding positions and borrowing margin. Some brokers have a three times higher rollover cost on Wednesdays or Fridays for compensating the weekend. When manually entering rollover fees, make sure to convert them to 10000 contracts for currency pairs. Zorro multiplies the fees by the trade duration in days for determining the total rollover cost of a trade.
  If rollover is unknown, it can be estimated from the current interest rate of the counter currency divided by 365 and multiplied with asset price*(1-1/leverage). If the broker charges a flat interest fee on margin loan, set RollLong/RollShort to 0 and use the Interest variable.
PIP Size of 1 pip in counter currency units; accessible with the PIP variable. Normally in the range of ~1/10000 of the asset price. The usual pip size is 0.0001 for assets (such as currency pairs) with a single digit price, 0.01 for assets with a price between 10 and 200 (such as USD/JPY and most stocks), and 1 for assets with a 4- or 5-digit price. Prices in the log are displayed with as many decimals as the pip size.
PipCost Value of 1 pip profit or loss per lot, in units of the account currency. Accessible with the PipCost variable and internally used for calculating the trade profit. When the asset price rises or falls by x, the equivalent profit or loss of an unleveraged trade in account currency is x * Lots * PIPCost / PIP. For assets with pip size 1 and one contract per lot, the pip cost is just the conversion factor from counter currency to account currency. For calculating it manually, multiply LotAmount with PIP and divide by the price of the account currency in the asset's counter currency. Example 1: AUD/USD on a micro lot EUR account has PipCost of 1000 * 0.0001 / 1.11 (current EUR/USD price) = 0.09 EUR. Example 2: AAPL stock on a USD account has PipCost of 1 * 0.01 / 1.0 = 0.01 USD = 1 cent. Example 3: S&P500 E-Mini futures on a USD account have PipCost of 50 USD (1 point price change of the underlying is equivalent to $50 profit/loss of an S&P500 E-Mini contract).
MarginCost Margin required for purchasing and holding 1 lot of the asset, in units of the account currency. Depends on account leverage, account currency, and counter currency; if the broker has different values for initial, maintenance, and end-of-day margin, enter the highest value. Accessible with the MarginCost variable. Internally used for the conversion from trade Margin to Lot amount: the number of lots that can be purchased with a given trade margin is Margin / MarginCost. Also affects the Required Capital and the Annual Return in the performance report. Can be left at 0 when Leverage (see below) is used for determining the margin.
Leverage Account leverage for the asset, f.i. 100 for 100:1 leverage, or 1 for unleveraged accounts. Accessible with the Leverage variable. Equivalent to a margin given in percent, f.i. a 50% end-of-day margin is equivalent to 2:1 leverage.
  MarginCost and Leverage are alternative methods for determining the margin for a given trade volume. If the price is known, they can be converted into each other: MarginCost = Asset price / Leverage * PipCost / PIP. When the broker uses Leverage, the margin per purchased lot depends on the current price of the asset. When the broker uses MarginCost, the margin is independent of the asset price, therefore the broker will adapt MarginCost from time to time when the price has moved far enough. When only Leverage is entered in the asset list, the MarginCost variable is calculated from the Leverage value and the current price. When MarginCost is nonzero, Leverage is ignored and the Leverage variable is calculated from MarginCost and the initial price.
LotAmount Number of contracts or units for 1 lot of the asset; accessible with the LotAmount variable. It's the smallest amount that you can buy or sell without getting the order rejected or a "odd lot size" warning. For currencies the lot size is normally 1000 on a micro lot account, 10000 on a mini lot account, and 100000 on standard lot accounts. Some index CFDs or crypto currencies can have a lot size less than one contract, such as 0.1 NASDAQ contracts, or 0.0001 Bitcoins. For most assets it's normally 1 contract per lot.
Commission Roundturn commission in account currency units for opening and closing one contract, or 10000 contracts for currency pairs. Accessible with the Commission variable. When manually entering the commission, double it if was single turn. For currency pairs make sure to convert it to 10000 contracts. Whether an asset is a currency can be determined with the assetType function.
  If the commission is a percentage of the asset value, enter the negative percent value, f.i. -0.25 for 0.25% of the asset value. The commission is then automatically calculated from the percentage using the formula Commission = -Percent/100 * Price * PIPCost / PIP.
Symbol Sources and symbols of the asset (up to 128 characters, case sensitive, no blanks, but dot, minus, hash, and underscore are allowed). The same asset can use up to 3 different brokers or price sources for trading, for live prices, and for historical prices. For this, up to 3 symbols can be entered, separated by exclamation marks '!'. They are accessible in the script under the names SymbolTrade, SymbolLive, SymbolHist.
- A symbol can begin with the name of the source, followed by a colon and the symbol name (like STOOQ:AAPL). The source can be either an online source (QUANDL, AV, STOOQ, BITTREX, etc), or a broker/account name from the account list (like FXCM_Real:GER30; see below). This way, assets can be traded with broker A based on prices from broker B, or vice versa (see also broker arbitrage).
- Additional broker-specific information such as the asset type, exchange name, or expiration date can be coded in a symbol separated by minus characters (f.i. AAPL-STK-NYSE-USD, see IB API).
- If the Symbol field is empty, the asset name is used. If it contains no source, the selected broker is used. If it contains 2 symbols, the first is used for trading and the second for live and historical price data. Of 3 symbols, the first is used for trading, the second for live prices, the third for historical prices. Example: TNOW-STK-SMART-USD!TNOW-STK-SMART-USD!YAHOO:TNOW.L uses the selected broker for trading and live prices and Yahoo for price history.
- If a symbol for live and/or historical prices is blank or empty (f.i. AAPL! !), the prices of that asset are not downloaded or retrieved from the broker. This is for special cases when prices are retrieved by script f.i. with the assetHistory or priceQuote functions.
- If the symbol is "DUMMY", a flat price curve is generated for test purposes.
- If a '*' appears in the symbol, it is replaced with the asset name (f.i. *!*!STOOQ:*.US).
AssetVar Up to 8 optional asset specific variables or strings, for evaluation in the script through AssetVar[0]..[7] or AssetStr[0]..[7]. They can contain multipliers, asset types, trading hours, or similar parameters. Text strings must not exceed 7 characters.

Remarks:

Some asset lists - with no guarantee of completeness or correctness - have been included and can be used as templates for own asset lists:

AssetsFix.csv - The default asset list that determines the assets available with the scrollbox. Based on an Oanda™ 100:1 USD account with lot size 1000.

AssetsCur.csv - About 35 currency pairs, including all pairs of the 7 major currencies EUR, USD, AUD, GBP, CHF, NZD, CAD. For trading with a multitude of currencies. Based on an FXCM 100:1 EUR account.

AssetsArb.csv - 3 Forex pairs from different brokers as an example of broker arbitrage.

AssetsOanda.csv - 15 Forex/CFD assets on an Oanda™ 100:1 USD account with lot size 1.

AssetsOandaEUR.csv - 15 Forex/CFD assets on an Oanda™ 30:1 EUR account.

AssetsFXCM.csv - 15 Forex/CFD assets on a FXCM™ 100:1 EUR account.

AssetsGP.csv - 15 Forex/CFD assets on a Global Prime™ 100:1 USD account.

AssetsIB.csv - Forex pairs, CFDs, and 40 major stocks on an Interactive Brokers™ USD account.

AssetsSP30.csv - Top 30 stocks from the S&P500 index, for downloading historical prices from the broker.

AssetsSP50.csv - Top 50 stocks from the S&P500 index, with symbols for downloading historical prices from Stooq or Yahoo.

AssetsSP250.csv - Top 250 stocks from the S&P500 index.

AssetsCFD200.csv - 200 stock CFDs with 10:1 leverage for trading with IB™.

AssetsBittrex.csv - 100 cryptocurrencies on a Bittrex™ Bitcoin account.

AssetsZ8.csv - 20 stocks and ETFs for a Markowitz portfolio rotation strategy, prices from Stooq™, trading with IB™.

AssetsZ9.csv - 10 US sector ETFs and bonds for a momentum portfolio rotation strategy, prices from Stooq™, trading with IB™.

AssetsZ9E.csv - 10 European sector ETFs and bonds for a momentum portfolio rotation strategy, prices from Yahoo™, trading with IB™.

AssetsZ10.csv - 15 major cryptocurrencies, prices from Cryptocompare™, trading with Binance™.

Please note that all brokers change their asset parameters and trading costs all the time. We do not observe brokers permanently for updating the asset lists. Many can be, and probably are, out of date. For an up-to-date simulation of your broker account, get the current parameters from the broker API or the broker's website and enter them in your asset list.

The account list

Account lists are supported with Zorro S. By default, only a Demo and a Real account is available with the [Account] scrollbox. Individual accounts, with user-defined parameters and separate brokers and price sources, can be added with an account list. It is stored in a spreadsheet file named Accounts.csv in the History folder. This file is a convenient way to manage many broker accounts with different logins, passwords, asset parameters, and special modes. The Accounts.csv file can be edited with Excel or with the script editor. Zorro must be restarted when the file was modified. It contains the account parameters in comma separated spreadsheet format (example):

Name Broker Account User Pass Assets CCY Real NFA Plugin
MTR4_Generic MTR4 0 0 0 AssetsFix USD 0 0 ZorroMT4.dll
FXCM_Demo FXCM 0 D23456789007 1234 AssetsFix EUR.€ 0 0 FXCM
FXCM_Real FXCM 0 27634523001 5678 AssetsFix EUR.€ 1 0 FXCM
FXCM_Phantom FXCM 0 27634523001 5678 AssetsFix EUR.€ 3 0 FXCM
IB_TWS IB 0 101 0 AssetsIB EUR 1 14 IB
IB_Gateway IB 0 1 0 AssetsIB EUR 1 14 IB
Oanda_V1 Oanda 0 987654321 2e3dc54e3090... AssetsOanda EUR 0 0 Oanda1.dll
Oanda_V20 Oanda 0 304-007-345602-001 5c3dc12e309d... AssetsOanda EUR 1 0 Oanda.dll
NxCore NxCore 0 0 0 AssetsSP500 USD 0 0 NxCore.dll
Crypto BitShark 0 0 0 AssetsCrypto BTC.B8 1 0 Btrx.dll
ABC_Demo ABC 0 4009876 n4qw4ert7 AssetsABC CHF 0 0 ZorroMT41.dll
ABC_Real ABC 0 3456789 ab234qrz2 AssetsABC CHF 1 0 ZorroMT42.dll

An example file AccountsExample.csv is contained in the History folder as a template for creating your own Accounts.csv file. Every account in the scrollbox corresponds to a line in the file with the following parameters, separated with commas:

Name Account name (no blanks) that appears in the account scrollbox. A line beginning with '#' is outcommented.
Broker Name of the broker (no blanks). Just for information, not yet used by the software.
Account Account/subaccount identifier sent to the broker, or 0 when no subaccounts are used.
User User ID for the login, or 0 for manually entering the user name.
Pass Password for the login, or 0 for manually entering the password.
Assets Name of the default asset list (see above) for this account, with no blanks and without the .csv extension. This is the list used for live trading and backtesting when the account is selected and no assetList function is called in the script.
CCY Name of the account currency, f.i. EUR or USD. Optionally, after a decimal point, the ANSI currency symbol and the number of digits to display for account values. By default, the currency symbol is '$' and account values are displayed with 2 decimals when less than 100, and without decimals from 100 on.
Real Real account (1), real account with no trading (3) or demo account (0). When at 3, all trades are opened in Phantom Mode and not sent to the broker.
NFA Compliance of the account. Affects default state of NFA flag and Hedge mode: 0 for no restrictions, 2 for Hedge = 0 (no hedging), 14 or 15 for NFA = on (full NFA compliance).
Plugin File name of the broker plugin in the Plugin folder, case sensitive (.dll extension can be omitted). The same plugin can used for several price sources by copying the plugin to a different name (see below). In the example, ZorroMT41.dll and ZorroMT42.dll are both copies of the ZorroMT4.dll. If the field is empty, the broker plugin is selected with the scrollbox.

The first line in the CSV file must be the header line. Names and strings must contain no blanks (check for blanks at the end that may be accidentally added!) and no special characters except for '-' and '_'. Zorro also accepts semicolon separated csv files with commas instead of decimal point, but not a mix of both in the same file. User names and passwords are stored in unencrypted text in the spreadsheet, so leave those parameters at 0 when other people have access to your PC.

In the above example, the account ABC_Real is prepared for trading simultaneously with ABC_Demo, one used as price source, the other for entering trades by setting Asset List / Symbol accordingly (see above). Since two broker connections cannot use simultaneously the same plugin, the Zorro user with the above account list has made two copies of the ZorroMT4.dll, and renamed them to ZorroMT41.dll and ZorroMT42.dll. The connected MTR4 client must also be duplicated this way, since MTR4 can also not handle two different accounts simultaneously.

When the AssetsFix.csv or Accounts.csv lists were changed, Zorro must be restarted for the changes to have an effect.

See also:

assetAdd, assetList, broker arbitrage, TradeMode, Testing

► latest version online