RealTest User Guide
RealTest User Guide

 

 

Navigation: RealTest Script Language > Syntax Element Details >

FillPriceAvg

 

 

 

 

Category

Current Position Information

Description

Average entry fill price of the current symbol when pyramiding (MaxSameSym > 1)

Notes

FillPriceAvg returns the share-weighted average entry fill price of all open positions of the current symbol — for example the legs of a pyramided position (MaxSameSym > 1), or the positions held by several strategies in a group.

FillPriceAvg can be used directly in the strategy's own formulas: in EntrySetup and the entry price formulas it reads the open legs, and in the exit formulas each leg reads all legs still open. For example, EntrySetup: Shares > 0 and C < FillPriceAvg * 0.95 adds a leg once the close is 5% below the average entry.

Each leg contributes its actual fill price, except on its own entry bar, where (as for FillPrice) a formula evaluated for that bar sees its order price. A leg that has already exited earlier on the same bar is no longer included, so an exit price based on the average can differ between legs that exit on the same bar (see Scaling In or Out of Positions). Inside PositionSum each position stands alone and FillPriceAvg returns nan. Use Extern to read another strategy's positions, or Combined for the current strategy and any strategies grouped with it.

 

 

 

Copyright © 2020-2026 Systematic Solutions, LLC