Formula Editor & XapiScript

Built-in formulas, custom formulas, strategy values, and testing practices.

Formula Editor & XapiScript complete reference Comprehensive practical reference for formulas and formula-driven strategy values. Capture a value when an event occurs Use state-oriented functions when a value should be frozen at the moment of a trigger. Create a custom formula Build a custom calculation through the Formula Editor interface. Current-market reference formulas Choose Bid, Ask, Last, RecentPrice, or Quotes according to the trading logic. Event and state functions in formulas Use functions that react to changes, crossings, and state over time. Formula Editor and XapiScript overview An expanded reference to the Formula Editor, XapiScript framework, system formulas, custom formulas, and strategy integration. How to request help with a custom strategy Describe a custom strategy in a form that can be evaluated or reproduced. Open the Formula Editor Open the platform formula library from the f(x) control. Position-aware formula logic Build calculations that reference the current account position. Session breakout formulas Use session high/low values with event functions to detect a breakout. System formulas vs. My formulas Distinguish built-in platform functions from formulas you create. Test a custom formula or strategy safely Validate custom logic in stages before using it with live orders. Use ClosestPrice for valid tick increments Round a calculated order price to a valid tradable price for the contract. Use formulas inside order strategies Drive strategy values from formulas instead of fixed inputs. Useful Formula Editor function categories Find the right built-in formula by concept instead of memorizing internal syntax. Work with compound formula results Select a specific value from a formula that returns multiple fields.

Get Started Now!

Try out our technology for free or open an account and start trading.

There is a substantial risk of loss in trading futures and options.