Navigation: Realtest Script Language > Syntax Element Details >







Current Position Information


Entry fill price (or exit fill price when calculating commission or slippage for exit transactions)


FillPrice is generally the price per share at which this position was entered. This will match the PriceIn value from the backtest Trade List.

In formulas evaluated at the same time as EntrySetup -- before tomorrow's entry price could have been known -- FillPrice returns OrderPrice by default.

This automatic substitution of OrderPrice for FillPrice typically applies to:


ExitLimit and/or ExitStop for exit orders attached to an entry order

The purpose of this automatic substitution is to ensure that a future backtest will match the orders that would have been generated and placed before the market open.

On all subsequent days that a position is held, references to FillPrice return the actual entry price that was modeled.

This entry-day substitution allows FillPrice to be used in your ExitLimit and ExitStop formulas without needing extra logic to use OrderPrice on entry day and FillPrice thereafter.

If you would prefer that FillPrice always return the actual entry price (even for orders placed at the same time as the entry order when it could not have been known yet) add QtyPrice: FillPrice to the strategy definition.

The one exception to FillPrice being the entry price (or order price) is when it is used in the Commission or Slippage formulas.

Since those formulas are evaluated separately for the entry and exit sides of each round-trip trade, FillPrice automatically retrieves the exit price when these two formulas are evaluated at position exit time.




Copyright © 2020-2024 Systematic Solutions, LLC