FMZ 퀀트 트레이딩 플랫폼은 일부 일반적인 라이브러리와 통합되어 있습니다.
이TA
FMZ 양자 거래 플랫폼의 지표 라이브러리는 일반적으로 사용되는 지표 알고리즘을 최적화하여JavaScript
, Python
그리고C++
.
오픈 소스 TA 라이브러리 코드, FMZ 양자 거래 플랫폼의 API 매뉴얼.
function main(){
// The length of records, when the length does not meet the parameter calculation requirements of indicator function, an invalid value will be returned
var records = exchange.GetRecords()
var macd = TA.MACD(records)
var atr = TA.ATR(records, 14)
// Print out 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])
}
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])
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]);
}
다음은CCI
표시기 호출 예제 코드, 더 많은 talib 표시기 기능을 찾을 수 있습니다FMZ 양자 거래 플랫폼의 API 매뉴얼
function main() {
var records = exchange.GetRecords()
var cci = talib.CCI(records, 14)
Log(cci)
}
# Python requires a separate installation of the talib library
import talib
def main():
records = exchange.GetRecords()
# The parameter 14 can be defaulted
cci = talib.CCI(records.High, records.Low, records.Close, 14)
Log(cci)
void main() {
auto records = exchange.GetRecords();
auto cci = talib.CCI(records, 14);
Log(cci);
}
// Solve the problem of javascript language data calculation accuracy
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
}
function main() {
var sum = _.reduce([1, 2, 3], function(memo, num){return memo + num}, 0)
Log(sum)
}
function main(){
var records = exchange.GetRecords()
// Print all indicator data, and JavaScript written strategies have integrated a talib library on FMZ Quant Trading Platform
Log(talib.MACD(records))
Log(talib.MACD(records, 12, 26, 9))
}
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}
}
void main() {
json table = R"({"type": "table", "title": "Position Information", "cols": ["Column1", "Column2"], "rows": [["abc", "def"], ["ABC", "support color #ff0000"]]})"_json;
LogStatus("`" + table.dump() + "`");
LogStatus("Fist 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" : ["Column1", "Column2", "Action"],
"rows" : [
["abc", "def", {"type": "button", "cmd": "coverAll", "name": "close position"}]
]
})"_json;
LogStatus("`" + table.dump() + "`", "\n`" + R"({"type": "button", "cmd": "coverAll", "name": "close position"})"_json.dump() + "`");
}