0bps

Strategy vault / Tools & templates

Aok Quant JS Integration with FMZ Extended API Demo

JavaScript strategy by 奥克量化.

Author
奥克量化
Complexity
Starter · 48 lines
Parameters
0

The original spec has no written description. Read the source below.

Source JavaScript


var URL = "https://www.fmz.com/api/v1?";
var AK = "b3a53d3XXXXXXXXXXXXXXXXXXX866fe5";//Replace here with your ownAccessKey
var SK = "1d9ddd7XXXXXXXXXXXXXXXXXXX85be17";//Replace here with your ownSecretKey

//Get Base5Object of parameters
function getParam(version,ak,args){
    return {
        'version': version,
        'access_key': ak,
        'method': 'GetNodeList',
        'args': JSON.stringify(args),
        'nonce': new Date().getTime()
    }
}

//Executemd5Encrypt
function md5(param){
    var paramUrl = param.version+"|"+param.method+"|"+param.args+"|"+param.nonce+"|"+SK
    Log("paramUrl:",paramUrl);
    return Hash("md5", "hex", paramUrl)
}

//Get the final requestURL
function getFinalUrl(param){
    return URL+"access_key="+AK+"&nonce="+param.nonce+"&args="+param.args+"&sign="+param.sign+"&version="+param.version+"&method="+param.method;
}

//jsNot Supported...argsNaming method, so use insteadargumentsKeyword to get the parameter array
function getArgs(){
    return [].slice.call(arguments);
}

function main() {
    //Obtain5basic parameter objects
    var param = getParam("1.0.0",AK,getArgs());
    Log("param:",param);
    //Get concatenated parametersmd5Encrypted result
    var md5Result = md5(param);
    //assign the encryption result to the base parameter object
    param.sign = md5Result;
    //Get RequestapiofURL
    var finalUrl = getFinalUrl(param);
    Log("finalUrl:",finalUrl);
    //Execute the request and print the result
    var info = HttpQuery(finalUrl);
    Log("info:",info);
}

Published by 奥克量化 on the FMZ strategy square · last modified 2020-05-16. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.

Build this with AgenKit

A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.

in Claude Code, Cursor, Codex & 4 more
/agenkit build a tested, production-ready module from strategies/Aok-Quant-JS-Integration-with-FMZ-Extended-API-Demo.md
  1. npx agenkit install engineering-kit in your project
  2. Paste the command into your agent and approve each phase
  3. Get tests, backtest, risk controls and a paper-trading switch

Understand it first

Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.

Related specs

esc

Try , , or .

↑↓ move↵ open