Changes

Jump to navigation Jump to search

Understanding Portfolio Backtesting

8 bytes removed, 13:12, 16 November 2015
no edit summary
== Script Calculation and Raw Order Generation ==
During backtesting, a single bar of each symbol's data series is evaluated by the strategy's signal scripts, starting with the first (oldest) bar. The series’ bars are evaluated in the order that the symbols appear in the symbols table of the Portfolio BacktesterTrader. Based on evaluation of each series’ bar, a set of one or more orders may be generated by the scripts for each of the symbols. Order sets are generated in the same sequence as the series’ bars are evaluated.
This process is illustrated in the Raw Order Generation section of the diagram: the first bar for symbol 1 is evaluated first, and a set of orders is generated based on that bar. Then the first bar for symbol 2 is evaluated, and a set of orders is generated based on that bar. The process is repeated until the first bar for the last symbol (Symbol N) is evaluated.
== Risk Control ==
At the risk control stage, the sequence of order sets is treated as one long sequence of orders. The orders are executed one-by-one from the beginning of the sequence, until all orders are executed, or until the risk control limits defined in Portfolio Settings of the Portfolio Backtester Trader prevent the execution of remaining orders. Any remaining orders that could not be executed are discarded.
This process is illustrated in the Risk Control section of the diagram: all of the orders for symbol 1 and symbol N are executed, while only some of the orders for symbol 2, 100 shares Long @ 55, are executed, due to risk control limits preventing the execution of the rest of the orders for symbol 2.

Navigation menu