Welcome to FMZ Quant Trading Platform
Programming Languages
Key Security
Live Trading
Strategy Library
Docker
Exchange
Strategy Editor
Backtesting System
Backtesting System Modes
Impact of Backtest Data Granularity on Backtesting
Backtesting System Supports Multiple Programming Languages
Exchanges Supported by Backtesting System
Backtest System Parameter Optimization
Save Backtest Settings
Custom Data Source
Local Backtesting Engine
Backtest Page Shortcuts
Backtest Data Download
Backtest System Sharpe Ratio Algorithm
Strategy Entry Functions
Strategy Framework and API Functions
Template Library
Strategy Parameters
Interactive Controls
Options Trading
C++ Strategy Writing Guide
JavaScript Strategy Writing Guide
Web3
Built-in Libraries
Extended API Interface
MCP Service
Trading Terminal
Data Explorer
Alpha Factor Analysis Tool
General Protocol
Debugging Tool
Remote Editing
Import and Export of Complete Strategies
Multi-language Support
Live Trading and Strategy Grouping
Live Trading Display
Strategy Sharing and Renting
Live Trading Message Push
Common Causes of Live Trading Errors and Abnormal Exits
Exchange-Specific Notes
Built-in Libraries
The FMZ Quant Trading Platform has integrated some commonly used libraries.
TA Indicator Library
The FMZ Quant TA indicator library optimizes common indicator algorithms and supports strategy calls in JavaScript, Python, and C++ languages. Open Source TA Library Code, FMZ Quant Trading Platform API Manual.
javascript
function main(){
// Length of records. When data length is insufficient to meet the indicator function's parameter calculation requirements, invalid values will be returned
var records = exchange.GetRecords()
var macd = TA.MACD(records)
var atr = TA.ATR(records, 14)
// Print the last set of indicator values
Log(macd[0][records.length-1], macd[1][records.length-1], macd[2][records.length-1])
Log(atr[atr.length-1])
}
python
def main():
r = exchange.GetRecords()
macd = TA.MACD(r)
atr = TA.ATR(r, 14)
Log(macd[0][-1], macd[1][-1], macd[2][-1])
Log(atr[-1])
c++
void main() {
auto r = exchange.GetRecords();
auto macd = TA.MACD(r);
auto atr = TA.ATR(r, 14);
Log(macd[0][macd[0].size() - 1], macd[1][macd[1].size() - 1], macd[2][macd[2].size() - 1]);
Log(atr[atr.size() - 1]);
}
talib Indicator Library
Below is example code for calling the CCI indicator. For more talib indicator functions, please refer to the FMZ Quant Trading Platform API Manual
javascript
function main() {
var records = exchange.GetRecords()
var cci = talib.CCI(records, 14)
Log(cci)
}
python
# Python requires separate installation of talib library
import talib
def main():
records = exchange.GetRecords()
# The parameter 14 can be omitted
cci = talib.CCI(records.High, records.Low, records.Close, 14)
Log(cci)
c++
void main() {
auto records = exchange.GetRecords();
auto cci = talib.CCI(records, 14);
Log(cci);
}
JavaScript Libraries
- http://mikemcl.github.io/decimal.js/javascript// Solve precision issues in JavaScript numerical calculations function main() { var x = -1.2 var a = Decimal.abs(x) var b = new Decimal(x).abs() Log(a.equals(b)) // true var y = 2.2 var sum = Decimal.add(x, y) Log(sum.equals(new Decimal(x).plus(y))) // true }
- http://underscorejs.org/javascriptfunction main() { var sum = _.reduce([1, 2, 3], function(memo, num){return memo + num}, 0) Log(sum) }
- http://ta-lib.org/javascriptfunction main(){ var records = exchange.GetRecords() // Print all technical indicator data. On FMZ Quant Trading Platform, JavaScript strategies have the talib library built-in Log(talib.MACD(records)) Log(talib.MACD(records, 12, 26, 9)) }
- Dynamic Loading of JavaScript Libraries
To use other third-party JavaScript libraries, you can dynamically load them as follows:javascriptfunction main() { // via. https://cdnjs.com/libraries eval(HttpQuery("https://cdnjs.cloudflare.com/ajax/libs/mathjs/13.2.0/math.min.js")) Log(math.round(math.e, 3)) // 2.718 Log(math.atan2(3, -3) / math.pi) // 0.75 Log(math.log(10000, 10)) // 4 Log(math.sqrt(-4)) // {"mathjs":"Complex","re":0,"im":2} }
C++ Library
- https://nlohmann.github.io/json/c++void main() { json table = R"({"type": "table", "title": "Position Info", "cols": ["Column 1", "Column 2"], "rows": [["abc", "def"], ["ABC", "support color #ff0000"]]})"_json; LogStatus("`" + table.dump() + "`"); LogStatus("First line message\n`" + table.dump() + "`\nThird line message"); json arr = R"([])"_json; arr.push_back(table); arr.push_back(table); LogStatus("`" + arr.dump() + "`"); table = R"({ "type" : "table", "title" : "Position Operation", "cols" : ["Column 1", "Column 2", "Action"], "rows" : [ ["abc", "def", {"type": "button", "cmd": "coverAll", "name": "Close"}] ] })"_json; LogStatus("`" + table.dump() + "`", "\n`" + R"({"type": "button", "cmd": "coverAll", "name": "Close"})"_json.dump() + "`"); }