The MSFL is a programming framework designed to build custom indicators, system tests, and explorations. It operates similarly to spreadsheet languages, using predefined functions (moving averages) and
Most MetaStock users stop at Cross(RSI(14),30) and call it a day. But the MetaStock formula language (MSFL) is far deeper—especially if you combine , Cumulative functions , and Binary Flags . Here are 3 advanced constructs that changed my trading.
For pairs trading, use this custom indicator to plot the correlation between the closing price and the MACD:
This catches micro pullbacks in oversold zones.
Allows you to use custom DLLs for advanced mathematical calculations (e.g., machine learning integration).
Plotting Resistance; Support;
: References the value of the current formula on the previous bar. While powerful for trailing stops, overusing PREV can slow down large-scale market scans. Foundational Building Blocks
The MetaStock Formula Language functions similarly to spreadsheet formulas. It relies on data arrays, mathematical operators, and specific functions. Core Data Arrays
(((Close-Low) - (High-Close)) / (High-Low)) * Volume
Intraday traders rely heavily on VWAP. This formula establishes custom boundaries surrounding a core transaction-weighted price anchor.
Mov(data, periods, method) : Calculates moving averages (e.g., Simple, Exponential).
: Always remember that Ref(C,-1) looks at yesterday’s close, while Ref(C,1) looks "forward," which will lead to unrealistic backtesting results (peeking). Resources for Formula Libraries
Essential for defining breakout levels, especially when combined with dynamic periods.