The 'Z' Algo Trading Systems: Trading for Regular Income

Before starting automated trading with one of the included Z systems on a real money account, please read this page from top to bottom. Make sure that you understood how the system principially works, how it is set up, and how it is adjusted to your capital, broker, and account. At first, some general rules for achieving a regular trading income.

The Z Systems: Overview

The Z systems are prefabricated, ready-to-run algo trading strategies for a wide range of markets. They are not based on 'technical analysis' or 'technical indicators'. Their algorithms are mostly described in the Black Book, some on the Financial Hacker website. To avoid misunderstandings: they should not be the only reason of using Zorro! We encourage you to learn developing your own systems. Strategy development is not trivial: If a market inefficiency were very easy to spot and exploit, many trading systems would do that, and the inefficiency would be leveled soon. This effect keeps the number of successful strategies in check and gives skilled coders a large advantage over code-illiterate traders.

The Z systems are relatively simple. None of the basic algorithms exceeds 25 lines of code. Still, all systems underwent a solid development and test process with the methods described in the Black Book. Early versions of some systems had been in live trading since 2012; all results so far have been consistent with the simulation. We're constantly observing the systems and modify or replace expired algorithms with any Zorro update.

When using a Z system, do not do it blindly, but learn system development, understand how it works, and eventually replace it with your own system. There are five good reasons why you should prefer a self-programmed system. Firstly, you have the opportunity to program better strategies than the relatively simple Z systems. Secondly, systems traded by a lot of people don't work very well - price curves, especially of stocks, can be noticeably affected even by a small number of traders. Third, you can face the inevitable drawdowns in a more relaxed manner when you know precisely what the systems do and why. Fourth, you'll gain experience with programming and statistics - valuable skills not only for trading, but in general life. And finally, you cannot blame us for losses.

If you're now discouraged of the Z systems, but not ready yet to develop your own systems, enter a course such as the Algo Bootcamp. There you can not only learn strategy development in depth, but also get some more proven ready-to-trade systems including their theory, algorithms, and source code.

The Z systems cover a large range of trade methods, win rates, and budgets (as of April 2023):

The metrics are from walk-forward (WFO) tests with the default capital, default asset lists, and virtual hedging enabled. The free Zorro version without virtual hedging produces slightly lower returns. A lower capital setting or a different asset list with higher margins, spreads, and commissions can reduce returns further. Forex and CFD swaps are taken from the rollover values in the asset list; for stock or ETF portfolios, 1.5% margin interest is assumed. 'Test capital' is the initial capital used for the backtest. You can set it up with the Capital slider, up to the limit of the free Zorro version. The smaller the capital, the more trades will be skipped, the less effective is the strategy, and the smaller the returns. Any strategy has therefore a lower limit to the capital that depends on the broker and can be determined with backtesting. There is also an upper limit. If you want to invest millions, you'll need special order types and entry/exit mechanisms. Contact us in that case.

Montly income in the above table is the average monthly return from a backtest with the Test capital. For strategies with rotation or reinvesting, such as Z8, Z9, Z10, Z13, the average monthly income has not much meaning since it is much lower at the begin of the test period and much higher at the end. For long-term investment, the Z8 or Z9 systems are probably the best suited since they have the lowest risk. The other Z systems have higher annual returns, but accordingly higher risk, and can theoretically cause a total loss of the invested capital. Many systems have long drawdown periods that you can see in the table above and in the equity curves below. You're more likely to start in a drawdown than not. Be prepared for that and do not invest what you can't afford to lose.

The Z systems will not start right away, because you need historical data for testing them. If you ask for help on the user forum because "Z1 displays 'history missing' errors", we know that you have not read the manual! Stock trading systems load their data automatically, for the other systems the historical data files must be downloaded from the Zorro download page and unpacked into the History folder. After that, click [Test]. The system then runs either a walk-forward analysis or an out-of-sample backtest for determining its historical performance with the current Capital and asset list. This can take several minutes especially with systems such as Z1, Z2, or Z12 that run through several oversampling cycles. The walk-forward analysis ends at a fixed date, the plain backtests end at the end of the history. The meaning of the performance figures can be found under performance report.

For live trading the Z systems, you normally first have to create an individual asset list with the parameters and symbol names used by your broker (see below). The Z systems do not automatically reinvest profits in live trading. The traded volume depends only on the Capital slider and is unrelated to the account balance. For reinvesting, increase the Capital slider once per month according to accumulated profit (if any), and follow the square root rule for reinvesting in high leverage forex and CFD systems. The InvestCalculator script can be used for determining the optimal investment size. The Z systems use the ACCUMULATE mechanism that allows trading with very small capital exposure.

Training the Z systems is neither necessary nor recommended. We provide strategy updates with new trained rules and parameters with any Zorro update; for this reason use always the latest Zorro release when you trade a Z system. All non-daily Z systems have been trained with oversampling and are thus robust against price curve noise. If you still want to train them on your own risk, you'll need Zorro S; see 'Tips & Tricks' below.

The Z systems can be adapted to your need as described below, but they are not available in source code. They are compiled executables (*.x) only. This is not due to some secret trading system: All basic algorithms are published in the Black Book or elsewhere, so anyone can check them out and write similar strategies. But if we provided the code, one could see precisely when the strategies buy and when they sell. It would then be easy to prey on Z system traders with fore-running methods. For similar reasons, some of the strategies contain a random element in live trading that makes it difficult to predict the trading. This random element has only a small effect on the live performance, but it ensures that many people can trade the strategies without hampering each other.
  If you need a Z system with source code, we can put you in contact with a freelancing programmer for the development of a very similar system.

The same Z system can produce different returns on different accounts, even with the same broker. This is partially caused by the above mentioned random element, but to a larger extent by different start dates and different capital. Because the number of open trades is limited, a different start date leads to a different trade history. Dependent on available capital, trades are skipped. In the long term the returns will equalize, but in short term they can be very different.

Due to the profit limit, the free Zorro version allows to trade only one system - either one of the Z strategies or a system of your own - on a real money account. Z1, Z2, and Z8 are included in the free version. The other systems are included in Zorro S.

Z1

The trend following system from chapter 3 of the Black Book, in several variants for currencies, commodities, and index CFDs. This system is for trading with a Forex/CFD broker. The algorithms are self-adapting to the market within certain boundaries, and can detect unprofitable market periods. OptimalF factors are used for distributing the capital among the components. Trade exits are handled by TMFs. Some of the algorithms control the trade duration by moving the stop loss; this can cause the stop to move in both directions.


The equity curve above is from a walk-forward analysis on an Oanda US account with 100:1 leverage. It is slightly on the optimistic side due to selection bias from generating the OptimalF factors from the whole simulation period. For reducing the expiration risk of single components, an equity curve trading mechanism is implemented. You can deactivate it with the Phantom flag (see below). A table with the current algorithm states is displayed on the trade status page:

EUR/USD VO:LS -198 HU:LS +68
USD/CHF VO:LS +726 LP: +549 HU:S +612 ES:LS +190 LS: +611
GBP/USD LP:LS +610
USD/CAD HU:LS -108 ES:L -73 LS:L +821
USD/JPY VO: +2400 HU: +1178
AUD/USD VO:S -82 LP:LS -0 LS:S +582
NAS100 ES: +886
SPX500 ES:L +318 LS:L +629
US30 LP: +256 ES:L +761
GER30 LP:LS +746 HU:LS +1186
XAU/USD LP:L +420 ES:S +3457 LS: +2020
XAG/USD VO:L +1797 LP:L +89 LS:S +156
UK100 LS:L -47

In the above matrix, active algorithms are displayed with their identifier (VO, LP, etc.) and L and/or S for the currently preferred trade direction, long, short, or both. Algorithms that are currently winning are displayed on a green rectangle. Algorithms that are currently losing and thus temporarily suspended (if equity curve trading was enabled, see below) are displayed on a red rectangle. The displayed numbers are the total win or loss per component, including phantom trades.

Z1 shares its parameter and factor files with Z12. Due to the relatively long lookback period, Z1 should only be traded with brokers that provide sufficient price history. If price data gaps are indicated in the message window at start, it is recommended to use the Preload flag (see below) or trade the system with a different broker. Otherwise the shortened price history can affect the performance in the first weeks.

Z2

A modified version of the Black Book chapter 4 system with a portfolio of mean reversion algorithms. Z2 is intended for trading with a Forex/CFD broker. It is anticorrelated to Z1. The algorithms are self-adapting to the market. OptimalF factors are used for distributing the capital among the components. Trade exits are handled by TMFs. Some of the algorithms control the trade duration by moving the stop loss; this can cause the stop to move in both directions.



The equity curve above was generated in the same way as the Z1 equity curve. Z2 also contains an equity curve trading mechanism that can be deactivated with the Phantom flag (see below). A table with the current algorithm states is displayed in the trade status page:

EUR/USD CT:L -62
USD/CHF CT:LS -130 HP:S +35
GBP/USD BB:LS +634 CY:LS +466
USD/CAD CT:LS -139
USD/JPY CT:L +884 CY:L +3464
AUD/USD HP:S +1076
NAS100 BB:L +797 CY:L +1768 HP: +5861
SPX500 CY:L -120 HP:L +51
US30 CT:L +1110 CY:LS +688
GER30
XAU/USD HP:LS +4231
XAG/USD HP:LS +3347
UK100 CY:LS +325 HP:L +526

Z2 shares its parameter and factor files with Z12. Like Z1, Z2 should only be traded with brokers that provide sufficient price history.

Z12

A combination of Z1 and Z2, exploiting the anticorrelation of their equity curves. By combining Z1 and Z2 to a compound system, drawdowns are reduced. The above remarks about the Z1/Z2 drawdown, equity curve trading, and lookback period also apply to Z12.

Z7

Z7 is a short-term, small-capital forex trading system based on the price pattern detection algorithm described in chapter 6 of the Black Book. It uses time dependent filters to catch matching patterns on the US, European, and Pacific sessions. A 'master algorithm' detects price patterns, algorithm variants with several filters enter the trades. The system passed the reality check described in the book. The results are unrelated to trends and cycles, and uncorrelated to the other systems.

The equity curve above is from a walk-forward analysis on a Oanda US account with 100:1 leverage. All Z7 trades end after at least one market day, most after a few hours. The stop loss is relatively distant and is used for risk limitation only. A trailing mechanism locks profits when the trade goes high into profit in volatile situations.

Z8

Z8 is a long-term trading system based on a modified Markowitz mean/variance optimization (MVO) algorithm. It is a slightly improved version of the MVO system described on Financial Hacker, and should be traded with a stock/ETF broker. Z8 opens a portfolio of ETFs, stocks, or other assets determined by an external asset list, and re-allocates the invested capital among the portfolio components every 5 weeks for achieving a positive balance curve with minimum variance. Since it trades with low leverage, the profit, but also the risk is smaller compared to the other systems.

Z8 equity curve

The balance curve above is from a walk-forward test with the default assets, based on a margin account with 2:1 leverage and $5000 start margin. The backtest reinvests the capital growth to the power of 0.9, and keeps the remaining profit as cash reserve on the account for buffering drawdowns. The assets, account leverage, and price data source must be set up in an asset list named AssetsZ8.csv. By default it contains a set of ETFs that were selected by industry diversity and by their supposed long-term prospects. Z8 can also trade stock portfolios or any other instruments with long-term positive returns. Forex or CFDs are not suited for Z8. For adding a new asset, just duplicate a line in AssetsZ8.csv and edit the asset name in the first column. For temporarily out-commenting a line, add a '#' in front of the asset name. The Symbol column contains also the download source. Up to 300 assets can be contained in the list, but you should have no less than 5 and no more than 30. When you remove an asset from the list, make sure to also manually close any of its open positions (this won't happen automatically).

Z8 needs not be trained, since this is automatically handled by the MVO process. The [Train] button can instead be used for finding assets with low correlation (Zorro S only). It displays a heatmap of the correlations between the assets in AssetsZ8.csv (red = high correlation, blue = low correlation). If you don't have Zorro S, you can use the script for generating heatmaps on Financial Hacker.

Z8 equity curve

For the backtest, historical data is automatically downloaded from the data providers set up in the 'Symbol' column in the asset list, so no further price history files are necessary. If you want to download data from a different source, either edit the asset list, or load it before starting the strategy. The system will automatically detect that up-to-date data is already present, and not attempt to download it again.

For trading Z8, the broker API must support the GET_POSITION command, which is the case for the IB TWS API. Make sure that you've subscribed market data for all traded assets (with IB, normally the US Equities "Value Bundle" and "Streaming Bundle"), that you're permitted to trade them (check all relevant boxes on the "Trade Permissions" page), and that the leverage in AssetsZ8.csv matches your account leverage. If your portfolio contains leveraged ETFs, check their margin requirement: IB accepts Leverage 2 for unleveraged or 2x leveraged ETFs; Leverage 1.333 for 3x ETFs; and Leverage 1 for 4x ETFs.

Since Z8 trades only every 5th week, it needs not run permanently, and requires no VPS and no permanent broker connection. Just start it in [Trade] mode once every 5 weeks after the opening time of the New York market (9:30 ET). Z8 will first download historical prices of all assets, then calculate the optimal portfolio. Set the Capital slider to the total margin you want to invest. That's normally the cash value on your account. After about a minute a message box will pop up, like this:

Z8 equity curve

"Old" is the current position in the asset, and "new" is the new position. Clicking [Yes] will automatically sell or buy the difference of any position, and this way optimize the portfolio. If the broker API does not support position requests, the 'old' positions will all be 0, even when positions are open. In that case open or close the position differences manually in the broker's trading platform, then click [No] on the message box. Afterwards the trading session is closed, and the suggested date for the next start is printed in the message window.

Since you can only buy integer numbers of shares, the real invested margin will normally be smaller than Capital, dependent on portfolio component weights and prices. The maximum capital can be set up in Z.ini (see below). For avoiding margin calls, we recommend to set Capital not higher than about 80% of the account equity. For accounts with no leverage, edit the asset list and set all leverages to 1; you can then set Capital at 100%. If the system does not open all trades - for instance due to a temporary connection problem or to being outside market hours - just run it again. Since it is detects actual positions, running it several times does no harm. If you missed the suggested start date, maybe because you're on vacation with all the money you made so far, run it at the next occasion. Missing a single date does not do much harm, but don't miss many dates in a row.

Z9

The portfolio rotation system from Black Book chapter 8, only with sector ETFs instead of US stocks, as suggested by Gary Antonacci in his "Dual Momentum" strategy. It uses the assets in AssetsZ9.csv, which should contain a mix of US sectors, non-US indices, and bonds or treasury. The portfolio is rotated so that it always contains the top third of the assets, selected by their highest relative momentum and positive absolute momentum. If no sector or index has any positive momentum, the system invests in treasury. If treasuries tank too, the system stays out of the market.

Z9 equity curve

The balance curve above is from a walk-forward test with the default assets, based on a margin account with 2:1 leverage and $5000 initial capital. Although the Z9 system uses a simpler algorithm than the Z8 system above, is achieves better CAGR. Editing the asset list, setting up the z.ini parameters, reinvesting profit to the power of 0.9, and rebalancing the portfolio works just as described for Z8 above. In the Type column of the AssetsZ9 list, enter 0 for sectors, 1 for bonds, 2 for non-US indexes, and 3 for a lead index that represents the market. The lead index is not traded, but used for detecting weak market periods. It can be omitted at slightly higher risk. As with Z8, [Train] generates a correlation heatmap. For trading Z8 and Z9 simultaneously on the same account, AssetsZ8 and AssetsZ9 must be modified for making sure that they share no assets.

Since US ETFs are not available anymore to European traders due to PRIIP regulation, an alternative asset list AssetsZ9E has been included that contains only ETFs that can be traded in Europe. The assets are similar, but not identical to their US counterparts, so the profit is smaller than with US ETFs. The asset list can be set up in the Z.ini or Z9.ini file.

Z10

Z10 is a cryptocurrency rotation system based on mean-variance optimization, like Z8, but with different settings, performance, and risk. It trades a bitcoin account on a cryptocurrency exchange. Therefore the return is in fractions of bitcoin ('$' == 1 Bitcoin) and thus independent of the bitcoin price. The system rotates a selection of major coins defined in AssetsZ10.csv, which have been selected by their ranking on cryptocurrency websites by trade volume, technology, and market expectancy. If a digital coin is not available for trading at your exchange, remove it from the list, or replace it with another by using the same criteria. You can add a dollar or gold backed coin - such as USDT or DGD - to the list as a 'safe haven' when the crypto market takes a dip.

Z10 equity curve

This system is for people who strongly believe in cryptocurrency surges, and have no problem with losing five-digit amounts in a single day. If you had invested $1,000 - 1 bitcoin - in January 2017 in a Z10 portfolio, you owned about 150 bitcoins at 150,000 dollars value in December same year, and 500 bitcoins worth 2.5 million in mid-2021. Still, the future is unknown, and the future of digital coins is twice unknown. We're including Z10 for completeness sake and for the crypto fans. Since failed coins have been delisted from the exchanges and thus don't appear in the portfolio, the backtest has likely selection bias.

The balance curve above is from a walk-forward test starting January 2017 with the Z10 assets, based on a standard bitcoin account with no leverage, 0.25% commission, and 0.5% spread. Not all assets were already available back then, so you'll get Warning 055 messages at backtest start. You can safely ignore them. Editing the asset list, setting up the z.ini parameters, reinvesting profit, and rebalancing the portfolio works just as described for Z8 above. The investment can be set up with the Bitcoin slider in steps of 0.001 bitcoin.

Z10 opens at the end of any [Test] a text file Z10rot.txt in the editor, containing today's suggested coin positions and the next rebalance date. It can look like this:

USDT/BTC: 1904@0.00011236 (0.2139 BTC)
FTC/BTC: 4266@0.00002952 (0.1259 BTC)
LTC/BTC: 8@0.01899999 (0.1520 BTC)
Next Rotation: June 18 2021

In the above example (not from a real Z10rot text), the invested capital was set to 0.5 bitcoins. You should have a portfolio of 1904 USD Tether, 4266 FTC, and 8 LTC. If positions of other coins are open, sell them for BTC. Next rebalancing is on June 18. If coin markets tank, not all capital is assigned, or none at all. In the latter case the system prints a "Market down" message. Then better sell all coins.

You can start Z10 at any time for rebalancing the portfolio. But start it next time only at the date given at the last rebalancing. Z10 requires rebalancing every 3 weeks. With the text exported in [Test] mode, it can be manually traded at any cryptocurrency exchange even if not supported by a Zorro plugin. Otherwise select the exchange in the scrollbox and click [Trade]. Z10 will then log in to the selected exchange, rebalance the portfolio, print the next rotation date, and log out.

By default, Z10 gets the historical coin prices from CryptoCompare and trades with coin symbols from Binance. For other exchanges, adapt the symbols in AssetsZ10.csv. The first steps to enter cryptocurrency trading are described under Brokers.

Z13

The options selling system from chapter 7 of the Black Book, with the therein described 'leverage trick' for boosting profits. Z13 must be traded with a stocks and options broker, like IB. It sells in-the-money SPY option combos and collects the differences of premiums and assignment losses. The combo type and leverage can be set up via [Action] scrollbox and sliders, and determines the risk and CAGR of the system between 20% (iron condors) up to 50% (naked puts). In the highest setting, Z13 can theoretically double the investment in less than 2 years. Risky market situations are detected with a volatility filter; trading is then suspended. The system reinvests profits using the square root rule, with the exponent determined from leverage. With no leverage, as on a cash account, profits are linear reinvested. Low leverage requires more capital and can exceed the capital limit of the free Zorro version.

 
Put Sell cash-covered or naked in-the-money puts. Highest profit, but also highest risk.
Strangle Sell puts and calls, with the put in the money and the call out of the money.
Condor Sell a put, buy a put, sell a call, buy a call. The combination limits the risk at 25%.
 
Leverage 1

Nonleveraged account, cash-covered options, linear reinvestment. Needs the highest capital.

Leverage 2 Margin account, cash-covered options, reinvestment by 1.5th root.
Leverage 6 Margin account, naked options, reinvestment by 1.85th root.

Leverage 6 is normally the preferred setting with the highest profit. It covers combo margins, but not the assigned underlying when options get exercised. In that case close the assigned position. You can close it either manually, or let the script close it, or let the broker liquidate it at market. This will normally automatically happen at the end of the next business day. If you want to leave the closing to the broker, take care to regularly withdraw profits for keeping the account in an insufficient funds state. If the broker closes the position only partially, close the rest manually. Or let it be automatically closed at the next script run.

For backtesting Z13 you'll need historical SPY options data that you can get from the Zorro download page. The chart below displays the equity curve (blue) of selling puts at leverage 6, compared with a benchmark (grey) from a SPY buy-and-hold strategy at leverage 2.

Z10 equity curve

For trading Z13, the broker API should support the SET_COMBO_LEG and the GET_POSITION commands, which is the case for IB. Make sure that you're permitted to trade options, and check the relevant boxes on the "Trade Permissions" page. If you have no market subscription for SPY, set Preload in z.ini (see below) and download SPY from another source. Z13 trades 6-week options and thus opens new positions only every 6th week. Therefore it requires no VPS and no permanent broker connection. You only need to run it every 6 weeks. Start it in [Trade] mode after the opening time of the New York market (9:30 EST) when the options from the previous run are expired or have been exercised. If a single leg of a combo has been prematurely exercised, close the remaining legs and the assigned underlying manually and start Z13 afterwards for entering the next combo.

At start, set the Capital slider to the margin you want to invest; for reinvesting profits at higher leverages you can use the InvestCalculator script to determine the amount. Z13 will first download SPY historical prices and the options chain, then close any SPY underlying position that was assigned, then place the option orders. Confirm them when the message box pops up. If Z13 considers the market too volatile or the Capital too low, it will instead print a message (f.i. "need XXX, have YYY") and terminate. If the market is unsuited, wait a few days. If it's loo low capital, be more generous with the Capital slider and add funds if required. The statistically best time for running Z13 is Tuesday 15:30 EST after option expiration and short before market close.

For using a different symbol than SPY, edit AssetsZ13.csv and replace the sole asset. The system trades the first asset from that list. Note that selling naked puts, especially of volatile stocks, can expose your account to high risk.

Z13 achieves higher returns with less effort than a mere portfolio rotation system, but at higher risk, especially with naked puts. A total loss of capital is theoretically possible. Do not trade with money that you cannot afford to lose.

 

The Z Systems: Setup and Handling

Every Z system can be configured at startup with parameters from an .ini file, and is controlled at runtime with the Capital and Panic sliders. First set up the strategy to your country and other requirements: open Strategy\z.ini with the script editor, and edit the following parameters:

Line Default Description
NFA = 0
No NFA compliance
Set this to 1 for for NFA mode (only needed when NFA was not defined in an account list). Often required for US accounts and NFA brokers, f.i. IB; not for MT4/MT5 accounts. A wrong NFA flag causes trades not being closed, so test your account before setting it!
Phantom = 0
No equity curve trading.
Set this to 1 for enabling equity curve trading. When active, trades of Z1, Z2, or Z12 components are temporarily suspended when the algorithm deteriorates, and resumed when it becomes profitable again. Equity curve trading can reduce the profit, but can also prevent losses by expiration of strategy components.
NoLock = 0 Locking enabled Set this to 1 for setting the NOLOCK flag. This prevents Zorro instances to wait for each other when sending commands to the broker API. Use this flag at your own risk and only when all Zorro instances trade with different brokers.
Hedge = 4
Virtual hedging.
Set this to 2 for disabling virtual hedging, to 4 when your broker does not support partially closing of trades (such as MT5 and some MT4 brokers), or to 5 for full virtual hedging with partial closing. Zorro S required for virtual hedging. Close open trades and restart the strategy after changing this parameter.
BarMode = 0
API requests
Set this to 32 for activating BR_SLEEP or to 96 for activating BR_LOGOFF.
MaxCapital = 10000
10000
Set this to the desired maximum value of the Capital slider for trading with higher volume (see Zorro S for capital limits)..
ScholzBrake = 0
0
Activate the ScholzBrake (German users only).
Verbose = 1
Verbosity.
Set this to 2 or 3 for more messages (see Verbose). Set it to 15 for 'black box' diagnostics.
BrokerPatch = 0 Broker API ok. Set this to 3 for letting Zorro calculate the balance, equity, and open trade profits displayed on the Zorro panel (see SET_PATCH), rather than reading the values from the broker API. Recommended when the broker API does not return correct trade profits or equity. This was reported for some versions of the FXCM API, and some MT4 servers. 
Preload = 0 Load all prices. Set this to 1 for loading the lookback period prices not from the broker's price server, but from Zorro's historical data files (see PRELOAD). Recommended for some MT4 brokers that offer only a very short price history. Recent history files are required.
StopFactor = 1.5 Distant broker stop. Set this to 0 for not sending any stop loss values to the broker (see StopFactor and StopPool). Sometimes required when the broker rejects trades with too distant stops, or accepts only certain stop values, or requires unique size for stop loss order (f.i. Oanda).
MaxRequests = 0 Default request limit. Use this to limit the requests per second when several Zorros trade on the same broker account that has a request limit
BarOffset = 0 Default bar offset. Set this to the trading time in minutes since midnight when trading assets on daily bars in other time zones. Close open trades and re-train the strategy after changing this parameter.
AssetList = "" Default account. Enter a different asset list for simulating different accounts or for setting up different symbols. All traded assets must be contained in the list. Close open trades and restart the strategy after changing this parameter.
Cancel = 0 Cancel no trade. Set this to the trade ID when a position was closed externally and must not be managed anymore by Zorro. Zorro normally detects externally closed trades, but not when a trade is closed by opening a counter-trade on an NFA account. The cancelled trade will be removed from the trade list at the end of the current bar. In the case of virtual hedging, cancel the phantom trade only; this will also automatically cancel the pool trade.

The .ini file is read at start of the strategy. If you want to trade different Z strategies with different parameters, save Z.ini under the name of the strategy, f.i. Strategy\Z12.ini for Z12. The strategy will then read the parameters from its corresponding .ini file. Not all parameters have effect on all strategies; f.i. for Z8/Z9 only MaxCapital, Verbose, and AssetList are relevant.

While running, the Z strategies are controlled with two sliders: 

Slider Range Default Description
Capital 0..10000 2000 /
5000
Determines the trade volume and the allocated margin per trade. The amount on the broker account is irrelevant for the volume. In [Test] mode you can adjust this slider for adjusting the desired monthly income (MI) and the minimum required capital on the account (Capital in the message window). Set MaxCapital (see above) for modifying the slider range.
Panic 0..100 0 Z1-Z7 only: tighten the stop loss of all open trades in percent of the current price difference to the original stop loss. At 0, stop loss control is completely up to Zorro; at 100 the stop limits are placed just at the current asset prices. This causes trades to be sold as soon as their prices move slightly in adverse direction, and can be used for taking profits early. No new trades are opened as long as the position is above 90. This slider reduces the profit, so use it only in drastic situations, for instance when an upcoming event - like Brexit - will have a large impact on the stock market. Put it back to 0 when the danger is over.

The sliders can be set after starting the strategy in test or trade mode (if no strategy is running, the sliders have no meaning). The last slider positions are stored, and the sliders snap to their last positions when the strategy is started again. Move them afterwards to a new posiion if desired.

The most important is the Capital slider. The Z systems do not autonomously reinvest profits or determine otherwise how much to invest; that is solely your decision and set up with this slider. Before trading the system, find your minimum capital requirement by running a [Test] with your current account parameters (see asset list) and the current slider position. Check the Required Capital (read performance report about how it's calculated) - that's the absolute minimum you need either in your broker account, or at least in your bank account. For reinvesting your profits, you can slowly increase the slider when the capital on the account grows. For not risking a margin call, take care to reinvest or withdraw capital only according to the square root rule explained in the Black Book.

For a realistic backtest, make sure that the account settings in the asset list are correct and up to date. For the Forex and CFD systems, an average Oanda US account with 100:1 leverage (AssetsFix.csv) is simulated in the backtest. For stock and ETF trading systems it's an average IB Margin account with 2:1 leverage. Capital requirement and System performance can be very different on your actual account that might have with higher trading costs or lower leverage. If a certain asset is not provided by your broker, remove it from the strategy as described below. If it is available, but under a different symbol, edit the asset list and enter its symbol name. US citizens are often not allowed to trade CFDs, and EU citzens are not allowed to trade US ETFs. Remove or replace unavailable assets as described below in teh FAQ.

Check the requirements of your broker and account. Typical issues are not being able to open or to close a trade ("Can't close...") due to NFA compliance, FIFO compliance, a wrong symbol, an invalid trade size, or unsupported partial closing. Make sure that NFA and Hedge are set correctly.

Before starting live, run a final [Test] with the Capital slider at the same position as in the trading session. This allows the system to permanently compare live performance with backtest performance, using the Cold Blood Index. The Capital can be increased later, but the initial position must match the last backtest. The CBI is printed once per day in the message window and on the status page. Consider pulling out when it gets down to a low value or 0.

After starting a strategy, it can take some days or even weeks before the first trades are entered. Don't grow impatient. The frequency of trades depends on the strategy and the market; in unprofitable periods with high market efficiency there can be no trades at all, especially when Phantom is set in the Z.ini file. Most trades are hold for 2-3 days, but some can stay open for weeks when they are profitable.

Don't unnecessarily stop and restart strategies. This closes open trades, initializes intermediate parameters, and sets back the lookback period. All this will reduce the profit and performance. Don't tamper with the trades: manually closing an open trade at the wrong moment can cost several hundred pips and can convert a winning strategy to a losing one. For 'soft stopping' a strategy without loss, set the Capital slider to zero so that no new trades are opened, then wait until the strategy itself has closed all open trades.

Your account balance will often go down in the first weeks after starting a strategy. This has 3 reasons: Drawdown periods are longer and more likely than profitable periods; unprofitable trades are closed first and thus contribute earlier to the account balance; and equity fluctuations - the up and down 'ripples' in the equity curve - almost always exceed the slowly increasing initial profit. Thus, periods of negative balance and equity are common at start of almost all strategies, as in the live profit curve below (from the Z5 system, now expired). When the profit accumulates, negative profit periods get shorter and eventually disappear. However if you're still not in the profit zone after 6-12 months and your trade returns still deviate largely from the predicted performance, as visible from a low CBI, something is wrong. The strategy might be expired and you should stop trading it.

Z5 profit curve

Events - such as entering and exiting trades, or trailing the stop loss - are displayed in Zorro's message window (see Log). Additionally, the current trading status, open trade list, and equity curve is displayed on the status page. You can configure that page to be visible under a particular URL and in this way observe your system online from everwhere. If you have multiple accounts with different brokers, you can use the ZStatus script for displaying the profits of all of them on a single panel.

 

Z Systems and Algo Trading: Frequently Asked Questions

What is the best Z system?

Z9.

Can I stop and start a Z system to any time?

Technically yes, when the broker server is online. But since most systems download recent price data at start for filling the LookBack period, avoid starting them at weekends when recent prices are not available and broker servers can be offline. Otherwise gaps in the price data can cause reduced performance during the following week. Once a system is trading, stop it only in case of an emergency. Most systems do not enter trades immediately after being started, so frequent stopping and starting will reduce the performance. While a system is stopped, it can not react on the market, which bears the danger of a potential loss when positions are still open.

Must I train the Z systems?

No. The portfolio rotation and options trading systems have no parameters to be trained. The other Z systems must be re-trained every 6..12 months, but we do that with any Zorro update. So you need not train them yourself. If you want, train them on your own risk with Zorro S by clicking the [Train] button. The last WFO cycle with the parameters for live trading is then retrained. The factors file (Z12.fac) of Z1, Z2, Z12 and the rules files of Z7 cannot be retrained by the user.

Why does the backtest not go up to the current date?

In walk-forward optimized algo trading systems, such as Z1-Z7 and Z12, backtest and training cycles must be in sync and end at the same date. Otherwise the backtest would produce wrong results. For the other systems the backtest ends at the latest date of the available price and/or options data.

When can I withdraw profits?

All strategies have long drawdowns that are listed in the table above (max drawdown). Don't withdraw profits when you're in a drawdown, since this would get you closer to a margin call. Remargin your account when your equity runs dangerously low. If you're winning, you can and even must remove profits regularly from your account, since the free Zorro version will stop trading when your balance exceeds its capital limit (use Zorro S for no limit). For the maximum amount to reinvest or to withdraw during a trading session, observe the square root rule.

Can I trade with very little capital?

For trading with low capital, such as a few hundred dollars, move the Capital slider mostly to the left and run repeated tests until the value displayed under Capital meets your needs. All margin based Z systems use the ACCUMULATE flag and thus allow trading with very low capital, although trades are then frequently skipped. Alternatively, reduce the capital requirement by removing assets from the portfolio, as described below. Note that low capital and few assets will normally reduce the live performance and increase risk and drawdowns due to the reduced number of trades. The setting of the Capital slider is unrelated to the displayed "Risk" of a trade, which does not reflect the strategy risk, but the stop loss distance.

How can I add new assets or exclude assets from trading?

Z8, Z9, Z10 can be used with any portfolio of stocks and ETFs. The other systems are optimized for a particular set of assets; you can not add, but you can exclude assets from trading. For excluding a certain component from trading in Z1, Z2, Z12, or Z7, edit Data\Z12.fac or Data\Z7.fac and place minus signs '-' in front of its OptimalF factors. The algorithms with the ES, HU, LP, LS, VO identifiers belong to Z1, A2, BB, CT, CY, HP to Z2, and PA, PD, PDD, PG to Z7. An example for excluding the CT algorithm with the USD/CAD asset:

...
USD/CAD:CT          -.041  1.32  263/420
USD/CAD:CT:L        -.029  1.25  177/227
USD/CAD:CT:S        -.058  1.38   86/93
...

Components with a negative or .000 OptimalF factor are automatically excluded this way. Be aware that excluding the least profitable assets or algorithms will generate a too optimistic backtest result due to selection bias.

My broker uses different symbols - how can I rename assets?

Use an asset list that contains the symbols and and account parameters of your broker. Enter the asset name used by the broker in the Symbol column of the list, as described here. Do not modify the asset names in the first column, since they are used by the strategies.

Can I 'fire and forget' an automated trading system?

Better not. Check the system's status page often, like once every day. Know your broker's trading platform for being able to observe and manually close trades anytime in case of an emergency, ideally from your mobile phone. If a trade was not correctly opened or closed due to a software glitch - this happens rarely, but it can happen - know how to deal with the problem. If it was a glitch of the broker's server or software, know how to contact the broker and request a refund. If it was a bug in Zorro or in your script, you'll get our compassion, but no refund.

Can I trade several Z systems together?

You'll need Zorro S for trading several automated trading systems at the same time. Make sure with your broker that your account is set up to allow multiple sessions. Some brokers set up accounts for single sessions only by default. Since Zorro stores its logs, trades, slider positions and other data in files named after the script, do not trade the same script with several Zorro instances in parallel! For doing that, either give the scripts different names, or run them from different Zorro installation folders.

How does algo trading affect my tax declaration?

In most countries you have to pay tax for trading profits. Normally the broker keeps records of your trades that you can download from his website. Otherwise Zorro also records all trades in the trades.csv spreadsheet in the Data folder for your tax declaration. Interest (rollover) and profit/loss are recorded separately. Usually you have to submit this spreadsheet or the broker's records together with your tax declaration. Note that sometimes you cannot deduct trading losses from trading profits (Scholz Tax).

How do I update a live trading system?

We'll publish updates to the Z strategies in regular intervals, so it's recommended to visit the user forum or the Zorro website from time to time. If you checked the box on the download form, you'll also be informed by email about updates. Please look here for how to move from an old to a new version with no interruption to trading.

Can an algo trading system become permanently unprofitable?

Yes. Any strategy can eventually expire. For instance, there was a Z5 system that expired when the Swiss removed the CHF cap. If we suspect that a certain system will expire, we'll announce that on the forum and will also inform subscribers and Zorro S users by email. Normally we'll provide a successor after a system expired. As long as the markets are not perfectly effective, possibilities for profitable trade algorithms are almost infinite.

Can I get the source code of a Z system?

For reasons described above, the Z systems are not available in source code - not even when you license the Zorro source. However, since the basic algorithms are published, you can hire a programmer (or our development service) for programming a replica of a Z system. The replica will trade similar, but not identical to the original system.

See also:

Strategy, Testing, Trading, Links

► latest version online