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.
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.
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
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.
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.
Quantacula includes some additional Exit Building Blocks to more easily simulate common trading patterns.
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.
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.
Sell after N Bars
Cover after N Bars
These Exit Blocks let you exit a position after a fixed amount of time.
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.