Asset Lists and Account Lists

Any asset used in a trading script takes its parameters and symbols from an entry in an asset list in the History folder (unless the asset was added by script). This entry determines all 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 and symbols, different asset lists are 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 are used for training and testing. In live trading, asset parameters are not read from the list, but taken directly from the broker API. However if parameters are not provided by the broker API, they are also taken from the asset list. Since broker API parameters are not always reliable, the SET_PATCH command can be used to override the API and enforce the asset list parameters.

The asset parameters need not be 100% precise. A backtest with an asset list for a different broker or account will normally also produce a useful result. But the parameters should not be totally off, especially not leverage and lot amount. If asset list parameters appear suspicious or deviate strongly from live parameters, a warning is issued at start of a live trading session.

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 semit-automatically from Log\Assets.csv as described below. For adding a new asset to the scroll box, edit AssetsFix.csv with the script editor and add a new line with the asset name and parameters.

The first line is the header line. A line is ignored when its Name begins with "#"; this way assets can be temporarily 'commented out'. Names should contain no special characters except for '_' and '/', but their assigned symbols can contain special characters except for blanks, commas, and 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 it is recommended to set up your PC regional settings that it's a comma and the decimal is a point, otherwise Excel cannot read standard csv files.

The asset parameters are to be set up as described below. In the description, a contract is 10,000 units for forex pairs, and a single unit for all other assets (brokers can have different individual contract sizes, see examples!). A lot is defined as the minimum tradeable number of units for forex pairs, and the minimum tradeable number of units or fraction of a unit for all other assets. Some parameters have a slightly different meaning when negative, f.i. a percentage instead of an absolute value. For most parameters exist an equivalent script variable, which is set in live trading from the broker API if available, and from the asset list otherwise.

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 appears in the Asset scrollbox and is used in the script, f.i. by the asset function. It also determines the names of the historical data files (f.i. "EURUSD_2020.t6"). The name is the same for all brokers, while the asset symbol can be different for any broker. The asset is ignored when the name begins with a hash character "#".
Price Ask price per unit, 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). For digital coins it's usually another coin, such as Bitcoin The Price parameter is normally for information only and not used in the backtest.
Spread The current difference of ask and bid price, in counter currency units. Accessible with the Spread variable. Used for backtests with constant spread. If at 0, ask/bid spread must be determined by script.
RollLong
RollShort
Rollover fee (Swap) in account currency units for holding overnight a long or short position per calendar day and per 10000 units for currencies, or per unit for all other assets. 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 per-10000 for forex pairs. Zorro multiplies the fees with the trade duration in days for determining the total rollover cost of a trade. Use the SOFTSWAP flag for continuous swap costs.
  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. Equivalent to the traditional smallest increment of the price. The usual pip size is 0.0001 for forex pairs with a single digit price, 0.01 for stocks and for forex pairs with a price between 10 and 200 (such as USD/JPY), and 1 for CFDs with a 4- or 5-digit price. Prices in the log are normally displayed with as many decimals as given by 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 trade profits or losses. When the asset price rises or falls by x, the equivalent profit or loss in account currency is x * Lots * PIPCost / PIP. For assets with pip size 1 and one contract per lot, the pip cost is the conversion factor from counter currency to account currency. For calculating it manually, multiply LotAmount with PIP; if the counter currency is different to the account currency, multiply the result with the counter currency exchange rate. Example 1: AUD/USD on a micro lot EUR account has PipCost of 1000 * 0.0001 * 0.9 (current USD price in EUR) = 0.09 EUR. Example 2: AAPL stock on a USD account has PipCost of 1 * 0.01 = 0.01 USD = 1 cent. Example 3: S&P500 E-Mini futures (ES) on a USD account have PipCost of 12.5 USD (1 point = 25 cent price change of the underlying is equivalent to $12.50 profit/loss of an ES contract). This paramter is affected by LotAmount.
MarginCost Margin required for purchasing and holding 1 lot of the asset, either in units of the account currency or in percent of the position value. Depends on account leverage, account currency, counter currency, and LotAmount. If the broker has different values for initial, maintenance, and end-of-day margin, use the highest of them. Accessible with the MarginCost variables. 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.
   Negative MarginCost is interpreted as a percentage of the position value, and internally converted to a leverage accessible with the Leverage variable. For instance, a 25% end-of-day margin is entered as -25 and equivalent to leverage 4. For no leverage, enter -100.
  MarginCost and Leverage can be converted to each other with the formula MarginCost = Asset price / Leverage * PipCost / PIP. When the broker uses a leverage or margin percentage, the margin per purchased lot depends on the current price of the asset. When the broker uses positive MarginCost, the margin is independent of the current asset price, therefore the broker will adapt MarginCost from time to time when the price has moved far enough. This is typical for Forex/CFD brokers.
Market
(Leverage)
Time zone and market hours in the format ZZZ:HHMM-HHMM, for instance EST:0930-1545. Available to the script in the variables AssetMarketZone, AssetMarketStart, AssetMarketEnd, for skipping data series or preventing orders outside market hours. Old Zorro versions prior to 2.29 had the leverage in this field.
Multiplier /
LotAmount
Number of units for 1 lot of the asset; accessible with the LotAmount variable. Smallest amount that you can buy or sell with your broker without getting the order rejected or an "odd lot size" warning. For forex the LotAmount is normally 1000 on a micro lot account, 10000 on a mini lot account, and 100000 on standard lot accounts. Index CFDs or crypto currencies can have a LotAmount less than 1, such as 0.1 CFD contracts. For stocks and most other assets the lot amount is normally 1. The lot amount affects PipCost and MarginCost.
   Cryptocurrency broker APIs often support the SET_AMOUNT command. You can then set any desired lot amount in this field, such as 0.0001 Bitcoins. 10000 Lots are then equivalent to 1 Bitcoin. 
   A negative value in this field is interpreted as a multiplier for option or future contracts, and accessible with the Multiplier variable. The LotAmount is then set to 1.
Commission Roundturn commission amount in account currency units for opening and closing one contract, per 10000 units for currencies, per unit for other assets, per underlying unit for options, or as percent of the trade value when negative. Accessible with the Commission variable. When manually entering the commission, double it if was single turn. For forex pairs make sure to convert it to per-10000. If an asset is a forex pair can be determined with the assetType function. A forex commission in pips is converted by Commission = CommissionInPips * 10000 * PIP.
  If the commission is a percentage of the trade value, enter the negative percent value, f.i. -0.25 for 0.25%. A percentage can be converted to commission amount with the formula Commission = -Percent/100 * Price / LotAmount * PIPCost / PIP.
Symbol Broker symbol(s) of the asset. Up to 3 sources and symbols can be entered for trading, receiving live prices, and receiving historical prices, separated by '!' exclamation marks in the form trade!live!history. Leave this field empty or enter '*' when the symbol is identical to the asset name or is automatically converted by the broker plugin. Up to 128 characters, case sensitive.
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, portfolio weights, or similar parameters. Text strings must not exceed 7 characters.

Remarks:

Parameter calculation examples (EUR account, EUR/USD at 1.15):

Broker website: Ticker EURUSD, Spread 0.3 pips, Margin 3.33%, LotSize 0.01 contracts, ContractSize 100000 EUR, PipValue 10 USD, SwapLong -5.70 USD, SwapShort -2.50 USD, OrderCommission 2.5 EUR. All parameters per 100000 EUR contract.
 
=> Asset list: Name EUR/USD, Price 1.15, Spread 0.00003 (= 0.3 pips * PIP), RollLong -0.4956 (= -5.70 * 10000/100000 / 1.15), RollShort  -0.2174 (= -2.50 * 10000/100000 / 1.15), PIP 0.0001 (= 10 / 100000), PIPCost 0.087 (PIP * LotAmount / 1.15), MarginCost -3.33, LotAmount 1000 (= 0.01 * 100000), Commission 0.5 (= 2 * 2.5 * 10000/100000), Symbol EURUSD.

Broker website: Ticker USDJPY, Spread 0.4 pips, Leverage 30, PIP 0.01, PipValue/Lot 1000 JPY, MinLot 0.01. Variable swap, no commission.

=> Asset list: Name USD/JPY, Price 105, Spread 0.004 (= 0.4 pips * PIP), RollLong/Short -0.01 (some assumed value), PIP 0.01, PIPCost 0.083 (PipValue * MinLot / Price / 1.15), MarginCost -3.33 (-100/Leverage), LotAmount 1000 (PipValue / PIP), Commission 0, Symbol USDJPY.

Broker website: Ticker XAGUSD, Price 17.5, Spread 0.02 points, Margin 10%, LotSize 0.01 contracts, ContractSize 5000 XAG, TickValue 5 USD, SwapLong -3.50 USD, SwapShort -3.00 USD, OrderCommission 0.0025%. All parameters per 5000 XAG contract.
 
=> Asset list: Name XAG/USD, Price 17.5, Spread 0.02, RollLong -0.00061 (= -3.50 / 5000 / 1.15), RollShort  -0.00052 (= -3.00 / 5000 / 1.15), PIP 0.01 (by tradition), PIPCost 0.435 (PIP * LotAmount / 1.15), MarginCost -10, LotAmount 50 (= 0.01 * 5000), Commission -0.005 (= -2 * 0.0025%), Symbol XAGUSD.

Broker website: Ticker DE30, Price 12567, Pip size 1, Avg Spread 0.5 pips, Leverage 1:100, LotSize 0.01 contracts, TickValue 1 EUR, SwapLong -3.0 %, SwapShort -6.0 %, Commission 5 / mio.
 
=> Asset list: Name GER30, Price 12567, Spread 0.5, RollLong -1.03 (= -3,0% / 100% * Price / 365), RollShort  -2.06 (= -6.0% / 100% * Price / 365), PIP 1, PIPCost 1, MarginCost -1.0 (-100 / Leverage), LotAmount 0.01, Commission -0.00005 (= 5 / 1000000 * 100%), Symbol .DE30.

Included asset lists

No guarantee of completeness or correctness! The lists below can be used as examples or templates for your own account specific asset list.

AssetsFix.csv - The default asset list when no different list is specified in the script; determines the assets initially available in the scrollbox. Based on an Oanda™ 100:1 USD account with lot size 1000.

AssetsCur.csv - 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 a 100:1 EUR account.

AssetsFUT.csv - 20 frequently used futures contracts of currencies, commodities, and indexes. Adapt the symbols to the expiration date of the desired contract.

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 20:1 EUR account.

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

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

AssetsDarwinex.csv* - 15 Forex/CFD assets on a Darwinex 100:1 EUR account.

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

AssetsBittrex.csv* - Example cryptocurrencies on a Bittrex Bitcoin 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. Plain list, no symbols or parameters.

AssetsRussell2000.csv* - 2000 small cap stocks from the Russell 2000 index, prices from Yahoo.

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

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 - 10 major cryptocurrencies, prices from Cryptocompare, trading with Binance.

*  !!  Broker-specific asset lists do not necessarily match your account, even with the same broker. Asset parameters and trading costs are often different in different countries and change all the time. We do not permanently observe brokers or stock indices lists for updating the above asset lists. For making sure that your asset list is correct, get the recent parameters from the broker API or the broker's website, compare with your asset list, and adapt it if necessary.
 

The account list (Accounts.csv)

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.

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.
Server Broker name, server URL, or some other info identifying the connection (no blanks). Sent to the API plugin with the SET_SERVER command before login.
AccountId 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. Sent to the API plugin with the SET_CCY command before any account request. Optionally an ANSI currency symbol and the number of digits to display for account values can be added after a decimal point. 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 0 for a demo account, 1 for a real account, or 3 for a real account with no trading. In 'no trading' mode all trades are opened as phantom trades 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.

Remarks

See also:

assetAdd, assetList, symbols, broker arbitrage, TradeMode, Testing

► latest version online