Script repository

The following scripts are included as examples and utilites and can be started from the [Script] scrollbox. Please note that not all scripts will start right away. Some are for Zorro S, some need training first, some need more historical data, and some need Python, R, or modules like DeepNet or RQuantlib. Please check out the description in the source code.


Calculates mean, standard deviation, skew, and kurtosis of the price curve of the selected asset.


Simple RSI strategy with 10-year backtest for speed tests and comparisons.


Example strategy for binary options with 5-minute bets.


Broker arbitrage example. Exploits forex price differences between two brokers. Requires Zorro S and an account list with entries for the two brokers. 


SPY buy-and-hold strategy as a benchmark for comparison.


Example script that calculates the first 1000 digits of Pi


Opens a t1, t6, or t8 historical data file in the History folder and displays its content in a chart.


Example script for the ZorroControl integration toolkit (Zorro S required). 


Small script for converting price history from Zorro's .t6 format to CSV.


Small example script for converting price history in some .csv formats to Zorro's .t6 format, optionally split into separate year files. The input/output file names and the format definition can be edited in the script.


Small example script for converting options EOD history in .csv format to Zorro's .t8 format. The symbol and CSV format definition can be edited in the script.


Small example script for converting price history in .csv format to Zorro's .t1 format. The input/output file names and the format definition can be edited in the script.


Strategy that exploits the relative strength of currencies and invests in the strongest forex pair. Requires forex history.


Displays the Windows date and the Unix date for a given calendar date that can be set with the sliders. Click [Stop] to terminate.


Short-term machine learning strategy from the article on Financial Hacker. Requires R with Caret and a deep learning package. Can switch between libraries Deepnet, H2O, MxNet, and Keras/Tensorflow.


Displays the effect of detrending or randomizing price curves.


Price distribution chart, comparing the distributions of two assets.


Script for adding new assets or downloading the price history of single assets or asset lists; details under History.


Script for accessing a website, and downloading, converting, and storing price data in Zorro .t6 format, as an example for using HTTP and dataset functions.


Multi-asset decision tree example. Demonstrates why out-of-sample tests for machine learning are mandatory. Requires forex history.


The system from the paper "Predictive Indicators for Effective Trading Strategies" by John Ehlers, converted to lite-C by DdlV. With and without crossover prediction.


Test Zorro's spectral filter and cycle detection functions with a sine chirp.


A simple gap trading system based on a book by David Bean as an example of time dependent trading (not really profitable).


Finds gaps in historical data and displays them with a red line.


For your grid trading experiments. Better do not trade this system with real money!


Displays the content of .t8, .t6, and .t1 historical data files in a spreadsheet. Uses the panel function and thus requires Zorro S; a history viewer for the free Zorro version is available on the download page.


Test the impulse response of moving averages, smoothing filters, and lowpass filters.


Calculates the investment from initial capital and accumulated profit with the square root rule. The exponent can be set with the slider from 1.000 (linear investment) up to 2.000 (square root investment). Click [Stop] to terminate.


Demonstrates controlling other applications by sending key strokes or mouse clicks to them. Opens Windows Notepad, writes something in it, saves the text, and closes Notepad.


Displays the curves of popular indicators.


System from a trading book by Jaeckle and Tomasini. Textbook example of an overfitted strategy: better don't trade it outside the backtest period used in the book. GBP/USD history required.


Example script that uses the Windows API for producing Mandelbrot fractals.


For your martingale experiments. Better do not trade this one with real money!


Scalping debunker. Plots a histogram of the required win rates for a given asset and trading cost dependent on trade duration in minutes. 


Framework for a Montecarlo Reality Check. Enter the script name to be tested, and run it in [Train] mode. 


Example of training both rules and parameters.


Strategy template generated by clicking on [New Script]. Rename it afterwards. Don't use scripts names that are very long or have blanks or other non-letter characters. Source in Source\Template.c


Example script that demonstrates using external libraries, in this case the OpenGL 3D graphics library.


Walk-forward optimization of a 12 parameters portfolio strategy with the ascent, brute force, or genetic optimizer. Useful for comparing optimization speed and methods. Forex history required.


Calculates the value and delta of call and put options with the Black-Scholes formula. Underlying price, strike distance to the price, and expiration can be set with the sliders, other parameters can be set up in the script. Click [Stop] to terminate.


Example script that demonstrates a complex spreadsheet-defined strategy control panel (Zorro S required).


Interactive script that displays payoff diagrams of arbitrary option combinations. The strike distance can be set with a slider. R and the RQuantLib package must be installed.


Simple machine learning system with walk forward analysis.


Script with a function for evaluating arbitrary values from the performance report, and an example that stores the Montecarlo parameters in a .csv file and prints the 50% level.


Predicts peaks, valleys, and crossovers in a price curve several bars in advance.


Compares the price ranges and price distributions of two assets (EUR/CHF and EUR/USD) for finding grid-trading-worth inefficiencies. EUR/CHF history required.


Example of two interacting Zorro processes. Move the "Other" slider and see the effect on the other Zorro (Zorro S required). 


Short script for testing the correct installation of Python.


Plots a price curve together with a random curve. Let fellow traders guess which one is which.


Displays a histogram of short-term price movements by random and by real prices.


Records live prices of the current asset to a .t1 file in [Trade] mode. A click on [Save] stores the file. Zorro S required.


Script for testing the response of some indicators to a market regime change from cycles to trending.


Short script for testing the correct installation of R.


Connects to the Interactive Brokers TWS, downloads the SPY options chain, and plots today's market sentiment histogram. Zorro S required.


Script for generating a chart and performance report from a trade list in .csv format. Demonstrates how to import data from a spreadsheet to a dataset. The script can be modified for importing other trade lists in different csv formats.


Script illustrating the use of Range, Renko, Haiken Ashi, or Point-and-Figure bars for single-asset and multiple-asset strategies.


Spectral analysis chart example. SPX500 history required.


Lists the ratio of spread to daily volatility of the main assets. Find out which assests are least expensive to trade. Forex and CFD history required.


A script that opens a panel with buttons for manually opening and closing positions in different modes. Useful for testing broker/account features, f.i. if it's a NFA account, if it is FIFO compliant or if partial closing is supported. Description under Broker Plugin.


A script that opens a panel with buttons for manually opening and closing options with IB. Set strike and life time, select a combo, then click [Buy] or [Sell]. 


A simple market sentiment system as described in the "Mechanical Turk" article. Not very profitable, but demonstrates the principle. SPY options history required.


Framework for a walk-forward optimization profile. Enter the script name to be tested, and run it in [Train] mode. 

Workshop1 .. Workshop8

Scripts containing the code examples from the workshops. Forex and SPY history required for workshops 6 and 8.

Z1 ... Z13

Zorro's included trade systems. Executable systems only; no source code. Forex and CFD history required. Zorro S required for some of the sytems.


Small script for displaying the live balances and profits of all your accounts on a single panel (details here; Zorro S required).

See also:


► latest version online