Analytics in Action: Open Technology (API) Use Case
Determining an Optimized FX Algo Trade Horizon
Identify the ideal trading horizon for your FX Algo trade given a risk tolerance level.
The FX Cost Curve data API on Virtu’s Open Technology platform facilitates trade horizon selection for your FX algos. Using the programming language of your choice, you can use this tool to help determine the optimal duration for your orders based on your cost and risk tolerances.
For a more in-depth review of how FX Agency Cost Estimator (ACE) can help you optimize trade horizon decisions for scheduled FX algos, please refer to our White Paper.
Use Case
You’re considering an order for 100M of USD.NOK which arrives on your trade blotter at 06:00 GMT. You would like to optimize the trade horizon based on the cost and risk profiles for USD.NOK at that time and in this instance you decide on a TWAP (risk neutral) strategy. This assumes execution buckets are the same size throughout the order.
Note: When using the OPT strategy; Virtu’s model for risk optimized execution you can adjust your risk tolerance further with riskAversionCoefficient 0.75 being the most risk averse (front loads the order), and 0 being risk neutral.
HOW TO USE FX COST CURVES
Set up your data request
Use Virtu’s online documentation to query Open Technology API endpoints in Java, Python or R languages. Then log into a secure session to initiate the query process. Next, fill in required payload fields like symbol, symbol type, currency and date of estimate. Users can run multiple payloads in their sessions, as well as pull results for multiple days.
Response
Results are rendered to the user environment in the form of a JSON object and can be held in program memory, displayed as a table, converted to a Pandas DataFrame, or even exported as a text file. Virtu’s team of experts can assist in developing code that works best for the task at hand.

Expected Cost and Risk for Defined Durations
Expected cost (due to price impact and spread) and expected risk (volatility penalty) values are returned for the specified durations:

OPTIMIZING YOUR ORDER HORIZON
The optimum duration can then be obtained by taking the lowest value from the following equation:
costBps + γ * riskBps (where γ is your risk tolerance).
For example, if you are willing to sacrifice 0.2bps of cost for 1bp of risk then γ = 0.2.
In this instance, the lowest value comes from the row with the duration 120mins: (6.28 + 0.2 * 9.097 = 8.0994), therefore 120 minutes would be the optimum trade horizon.
Conversely, if you are more risk averse, and willing to accept a higher risk penalty of γ = 1, then one hour would be preferable: 8.257 + 1*5.776 = 14.033
PUTTING IT ALL TOGETHER
The full cost vs. risk horizon can be charted to fully understand the tradeoff. The chart below displays the cost curve of costBps vs riskBps for each duration retrieved, whereby the blue tangent depicts the optimum duration for γ = 0.2, and the magenta tangent depicts the optimum duration for γ = 1.
FX Cost Curves: Cost vs Risk (bps)
