Your interactive trading laboratory!
 • 
19 users online

Quantacula Help

How-To
C# API Reference
Extensions
Development Blog
API-Extensions
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.

TASC-Extensions
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.
Transaction
Namespace: Quantacula.Backtest
Parent: Object

The Transaction class represents the result of an order (buy, sell, sell short, or cover short) that was placed either during a simulated backtest, or in the Quantacula Studio Signal Hub.

When developing a C# Coded Model, you obtain a Transaction instance as a result of the PlaceTrade method. You can modify certain properties of the Transaction, such as Quantity, to implement customized position sizing in your trading model.

Backtest Related

Commission
public double Commission

The commission that was applied to the order. In Quantacula Studio, you establish commission in the Backtest Settings interface.


EntryDate
public DateTime EntryDate

The signal entry date of the transaction. Corresponds to the price bar on which the trading signal was issued.


ExecutionDate
public DateTime ExecutionDate

The date that the backtester filled the order during the simulation.


ExecutionPrice
public double ExecutionPrice

The price at which the backtester filled the order during the simulation.


MarginOverride
public bool MarginOverride

Set this property to true to cause the backtester to fill the transaction even if there is not enough simulated capital.


PositionTag
public int PositionTag

This integer value is used internally by Quantacula to track which Building Block a particular Transaction belongs to. Avoid using this yourself. Instead, you can use the Tag property to store information in a Transaction.


TransactionWeight
public double TransactionWeight

Specifies a weight value to use for determining which transactions the backtester should fill in cases where there are more candidate transactions than available simulated capital. Transactions are sorted by this value during the backtest process, so lower values here will result in a higher order priority.



Members

Bars
public BarHistory Bars

The BarHistory instance that the transaction was placed on.


IsEntry
public bool IsEntry

Returns true if this is an entry (Buy or Short) transaction.


IsExit
public bool IsExit

Returns true if this is an exit (Sell or Cover) transaction.


OrderPrice
public double OrderPrice

The order price of the transaction. Does not apply for Market orders.


OrderType
public OrderType OrderType

Contains the order type of the transaction. Possible values are OrderType.Market, OrderType.Limit, OrderType.Stop and OrderType.FixedPrice. Market, Limit, and Stop simulate their corresponding broker order types, while FixedPrice is a theoretical order type intended to support situations where you want to establish a fixed price of an order.


PositionType
public PositionType PositionType

Returns the position type of the transaction, PositionType.Long for Buy and Sell orders, and PositionType.Short for Short and Cover orders.


Quantity
public double Quantity

Contains the number of shares or contracts in the transaction.


Symbol
public string Symbol

The symbol that the transaction was placed on.


Tag
public object Tag

Lets you store custom information (an object instance or value type) along with a Transaction. If the Transaction is filled by the backtest engine, the Tag value is passed into the Tag property of the resulting Position object.


TransactionType
public TransactionType TransactionType

Contains the type of transaction, possible values are TransactionType.Buy, TransactionType.Sell, TransactionType.Short or TransactionType.Cover.