investfly.models.strategy.StrategyServices
Runtime planning and evaluation services available to custom strategies.
Build a protective-exit plan from common percentage-based settings.
The returned plan may combine a profit target, fixed stop, trailing stop, and maximum holding period. The Investfly runtime evaluates the plan.
Continuous behavior that the runtime manages around custom strategy callbacks.
A custom strategy remains responsible for deciding when to request an entry or rebalance. The runtime owns the configured position management, asset lifecycle, and portfolio-limit algorithms before and after those callbacks.
A selected security and its ranking score.
Request runtime-managed instrument selection, sizing, and order construction.
Allocate one total execution budget equally across the supplied securities.
For percentage and notional sizing, execution.positionSize is the total pool and the
runtime divides it by the number of securities. For fixed quantity sizing, the quantity is
applied to each security.
How a rebalance budget is distributed among selected securities.
How a rebalance handles securities that leave the target set.
Describe target selection, weighting, and replacement for a rebalance.
Runtime-injected operations shared with configuration-driven strategies.
This class is a public contract only. Strategy authors call self.services; Investfly
injects the live/backtest implementation before any strategy callback is evaluated.
Resolve a selection specification to ordered securities.
Resolve and score securities using a ranked selection specification.
Evaluate a filter expression for one security.
Evaluate strategy guards and return their decisions for the requested scope.
Plan entry orders with runtime-managed selection, sizing, and execution.
Plan orders that allocate a budget across a group of securities.
Plan closing orders for the supplied open positions.
Plan orders that move the portfolio toward a target basket.
Plan scale-in orders for positions affected by the latest market update.