Getting Started
Platform Basics
Writing Strategies
Development Tools
Backtesting System
Advanced Topics
Data and Research
Integrations
Built-in Libraries
The FMZ Quant Trading Platform has some commonly used libraries built in. Availability by language:
| Library | JavaScript / TypeScript | Python | Rust |
|---|---|---|---|
TA indicators | yes | yes | yes |
talib indicators | yes | requires TA-Lib and numpy installed on the docker's machine | no |
| JSON | the language's built-in JSON | the standard json module | JSONParse()/JsonValue |
For the full list of functions and their arguments see TA and Talib in the reference.
TA indicator library
The platform's TA library optimizes the common indicator algorithms (open-source TA library code). Where there are not enough K-lines to compute an indicator, invalid values are returned at those positions.
javascript
function main(){
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])
}
rust
fn main() {
let r = exchange.GetRecords(None, None, None).unwrap();
let macd = TA.MACD(&r, None, None, None);
let atr = TA.ATR(&r, 14);
Log!(macd[0][r.len() - 1], macd[1][r.len() - 1], macd[2][r.len() - 1]);
Log!(atr[atr.len() - 1]);
}
talib indicator library
javascript
function main() {
var records = exchange.GetRecords()
var cci = talib.CCI(records, 14)
Log(cci)
}
python
# Python needs TA-Lib and numpy installed on the docker's machine; without them calling talib raises an error asking to install it
def main():
records = exchange.GetRecords()
cci = talib.CCI(records.High, records.Low, records.Close, 14)
Log(cci)
JavaScript: loading third-party libraries dynamically
Other third-party JavaScript libraries can be downloaded at run time and loaded with eval:
javascript
function 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}
}