- Accounts & Connection Management
- Data Management & Analysis
- Price Monitoring
- Charting
- Trading
- Scanners
-
Builders
-
Manual Strategy Builder
- Main Concept
- Operand Component
- Algo Elements
-
Use Cases
- How to create a condition on something crossing something
- How to create an indicator based on another indicator
- How to calculate a stop loss based on indicator
- How to submit stop order based on calculated price
- How to calculate a current bar price using a price type from inputs
- How to Use a Closed Bar Price
- Automatic Strategy Builder
-
Manual Strategy Builder
- Autotrading
- FinScript
- Trade Analysis
- Media Feeds
- Logs & Notifications
- UI & UX
AFP Orders in FinStudio
Overview
AFP Orders (Average Fill Price Orders) in FinStudio are advanced market algorithms designed to maximize execution quality and control price slippage when trading large volumes. Instead of classic TWAP or simple market orders, the AFP Market Algo dynamically submits orders only when the expected average fill price is within a user-defined range. This minimizes negative market impact and ensures price control in both volatile and low-liquidity environments.
How AFP Orders Work
The AFP Market Algo monitors market depth and places orders only when the calculated Average Fill Price (AFP) meets the trader's criteria. The order is either submitted fully (Full Fill) or broken into smaller submissions (Partial Fill), each limited by the AFP constraint. If market conditions are unfavorable (e.g., price moves too far from the acceptable AFP), the algorithm waits, monitoring the order book for a better opportunity.
Key Parameters & Controls
1. Filter:
-
Max AFP Deviation:
Sets the maximum allowable deviation (in points, ticks, or price units) between the AFP and your reference price. If the expected AFP exceeds this threshold, the algorithm skips the current quote and waits for more favorable conditions. -
From:
Determines the reference price for calculating AFP deviation. Options:-
Initial Price: Uses the price at the moment of Algo creation as the benchmark.
-
Current Price: Uses the latest best bid/ask on each quote.
-
2. Submission:
-
Fill Mode:
-
Full Fill: The order is submitted in one transaction for the entire requested quantity, provided AFP is within limits.
-
Partial Fill: The algo submits only the portion of the order that can be filled within the AFP threshold. The remaining quantity waits for subsequent opportunities.
Partial Fill logic:-
Calculate AFP for the remaining quantity (Q).
-
Find order book levels within AFP; sum their volumes (Q1).
-
Submit Q1 as a limit/market order.
-
Repeat for remaining quantity (Q2 = Q - Q1) with next market update, until the total is filled or the timeout is reached.
-
-
-
Type:
-
Market Order: Sends a market order for immediate execution at current prices, without price guarantee but with high fill probability.
-
Limit Order: Sends an Immediate-Or-Cancel (IOC) limit order at the furthest price level required to fill the requested quantity. (If IOC is not supported by the broker, a GTC order is used instead.)
Example:
You want to buy 10 lots. Market depth:-
3 at 100.00
-
5 at 100.01
-
2 at 100.02
Limit price is set at 100.02 so all 10 can be filled.
-
-
3. Timeout / Expiry:
-
Expiration:
Optionally set how long the algo should run before aborting unfilled quantities. -
Stop if Price:
Abort if the price moves beyond a specified level.
Monitoring and Managing AFP Orders
-
Strategy Runner:
Track all AFP orders in real time: see filled quantities, current AFP, pending lots, and overall performance. -
Pause/Resume/Cancel:
Traders can manually pause, resume, or cancel running AFP orders at any time. -
Notifications:
System alerts inform the trader of key events—order submission, partial fills, completion, or deviations outside limits.
Use Cases
-
Institutional trading: Slice large orders into discrete fills, minimizing market impact and improving average price.
-
High-frequency or quant strategies: Automate price-sensitive execution, exploiting small windows of favorable liquidity.
-
Discreet order placement: Hide trading intent in illiquid markets by waiting for price/volume opportunities.
Conclusion
The AFP Order mechanism in FinStudio provides a highly customizable, algorithmic solution for executing large or sensitive trades. By leveraging real-time market data, flexible fill strategies, and strict AFP deviation controls, traders achieve improved execution quality, lower slippage, and more predictable outcomes compared to traditional TWAP or VWAP approaches.
- Accounts & Connection Management
- Data Management & Analysis
- Price Monitoring
- Charting
- Trading
- Scanners
-
Builders
-
Manual Strategy Builder
- Main Concept
- Operand Component
- Algo Elements
-
Use Cases
- How to create a condition on something crossing something
- How to create an indicator based on another indicator
- How to calculate a stop loss based on indicator
- How to submit stop order based on calculated price
- How to calculate a current bar price using a price type from inputs
- How to Use a Closed Bar Price
- Automatic Strategy Builder
-
Manual Strategy Builder
- Autotrading
- FinScript
- Trade Analysis
- Media Feeds
- Logs & Notifications
- UI & UX