Your interactive trading laboratory!
23 users online

Quantacula Help

C# API Reference
Development Blog
Indicator Spotlights

QCommunity Extensions
The open-source GitHub repository of source code for the QCommunity Extensions library. Contains indicators and other extensions submitted by the Quantacula Community. Look for QCommunity indicators when you create a Building Block model, mark the "QCommunity" library check box to expose them.

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.
Entries and Exits
Published by Glitch on 9/28/2018

This article will describe how to use the different Entry and Exit Building Blocks in your Quantacula models. We offer building blocks that simulate familiar order types, including market, limit, and stop.

Standard Market Entry and Exit

To simulate a standard market order to open a position, use one of the following two Entry Blocks:

  • Buy at Market Open

  • Short at Market Open

And conversely, to exit an open position at market, use the corresponding:

  • Sell at Market Open

  • Cover at Market Open

Sell Blocks should be paired with Buy Blocks, and Cover Blocks with Short Blocks.

Limit or Stop Orders

Quantacula includes a very versatile Entry and Exit Block to simulate trading with limit and stop orders.

  • Buy at Limit or Stop

  • Short at Limit or Stop

  • Sell at Limit or Stop

  • Cover at Limit or Stop

Entries Exits

These blocks let you simulate limit or stop orders with an order price based on a percentage above or below an Indicator value. Remember that "indicators" can also mean the standard price components open, high, low, close. If you want the price to be pegged to the exact indicator value, simply leave the Percentage parameter at zero.

  • Order Type lets you select whether you want to simulate a limit order or a stop order.

  • The price of the order is controlled by the Percentage Amount Above or Below setting, and the specified Indicator.

The following example implements a channel breakout model. The model buys at stop, with a stop price set at the highest 10-bar high. It sells at stop at the bottom of the channel, the lowest 10-bar low.

Entries Exits

The following example attempts to catch a falling knife by buying using a limit order set to 5% below the low of the current bar, and sells the next bar at market open.

Entries Exits

Exit Building Blocks

Quantacula includes some additional Exit Building Blocks to more easily simulate common trading patterns.

Profit Target

  • Sell at Profit Target

  • Cover at Profit Target

These Exit Blocks let you easily implement a profit target in your models. You specify a percentage amount, and the system automatically calculates the correct price to use for the simulated limit order.

Stop Loss

  • Sell at Stop Loss

  • Cover at Stop Loss

These Exit Blocks implement a stop loss, establishing the price of the simulated stop order based on a percentage below the entry price.

Timed Exit

  • Sell after N Bars

  • Cover after N Bars

These Exit Blocks let you exit a position after a fixed amount of time.

Combining Exits

You can combine several Exit Blocks with a single Entry Block. For example, you can drop both a Sell at Profit Target and a Sell at Stop Loss onto your model, below a single Buy at Market Open. The model will dutifully place the simulated limit order for the profit target, and the stop order for the stop loss, for each open position.