Your interactive trading laboratory!
8 users online

Quantacula Help

C# API Reference
Development Blog

The open-source GitHub repository of source code for the TASCExtensions Quantacula extension. Contains indicators and other extensions adapted from the Traders' Tips articles in Technical Analysis of Stocks & Commodities magazine.
Trading Model Basics
Published by Q Glitch on 9/28/2018

In Quantacula parlance, a model is a collection of rules that specify when to enter and exit the market. In this article we’ll concentrate on building models on the web site using drag and drop Building Blocks.

When you select Create/Building Block Model from the main menu, brings up the Building Block Model Composer. The lists along the left contain the different kinds of Building Blocks you can use to implement your model. You drag Building Blocks from these lists and drop them onto the model’s surface to the right.

Building Block Model

Entry and Exit Blocks

These Blocks control when your model enters and exits the market. There are separate Blocks for long (buy, sell) and short (short, cover) positions. Quantacula pairs an Entry Block with the Exit Blocks it finds below the Entry. Each Entry Block can be paired with one or more Exit Blocks.

In the example below, we paired one Buy at Market Open Entry Block with both a Sell at Profit Target and a Sell at Stop Loss Exit Block. We modified the default value of the Stop Loss parameter from 10% to 20%. Most Building Blocks expose parameters that you can modify by clicking the gear icon () on the Block.

Building Block Model

Setting Parameter Values

You can drop one or more Condition Blocks onto an Entry or Exit to add conditional logic to your model. Typical Conditions involve indicators crossing each other, crossing price, or penetrating a specific value. You will often need to adjust the parameters of Condition blocks to achieve the results you want. Some of the parameters are expressed as indicators. When modifying an indicator, Quantacula presents a new user interface that lets you select all the available technical indicators, as well as the standard price components of open, high, low, close and volume.

Building Block Model

Example Model

In the example below, we implement the classic moving average crossover system. We use two Indicator Crosses Indicator Condition Blocks, and set the period of the moving averages to 20 for the fast average, and 50 for the slow average.

Building Block Model

Settings Tab

Here you can control the various settings of the backtest simulation. Establish a Data Selection to determine what data to backtest. Specify a Benchmark Symbol to compare your results against an appropriate market proxy (for example SPY for US stocks or BTC.USD for cryptocurrencies.) Specify a simulated Starting Capital and a Margin Factor to use in the simulation. Select your desired Position Sizing method, and the Data Range to determine the length of history to backtest.

Backtest Tab

When you are satisfied with your model's composition and settings, click the green Run Backtest button to begin the simulation. The backtest results appear here in the Backtest tab, and include an equity curve, metrics report, and lists of simulated positions and trade signals.