Everyone can use the FMZ Quant extended API to create a quantitative platform. The demo item shows how to build up a powerful quantitative platform by using Python and FMZ Quant extended API.
According to the DEMO item, you can refer to writing server-side codes and adding front-end pages to insert to the existing systems, such as forums, blogs, communities and others. In order to achieve flexible access to the existing user groups, the existing user groups will not experience the underlying technical support of FMZ Quant completely, so the use of the users is more concise and easy to operate.
You can use Python, JavaScript and C++ to write quantitative trading strategies, feel free to customize, and realize your own trading ideas in the world of quantitative trading, without restrictions. - Powerful and effective backtest system
You do not need to collect data hard, and the local backtest engine only needs one command to easily configure; link: https://github.com/fmzquant/backtest_python - Simplified structure
You only need to write several front-end pages and one HTTP srver program, to easily construct the structure.
Name: FMZ Quant Demonstrates How to Use Its Extended API to Construct Your Own Assets Management Quantitative Platform
DEMO installation
git clone https://github.com/fmzquant/fmz_extend_api_demo.git
pip install -r requirements.txt
Note: if “Permission denied” is prompted, you need to execute pip like “sudo pip install -r requirements.txt”, and enter the password of the operation system by request.
The using details of FMZ extended API KEY can be seen in API documentation:
Create FMZ API KEY.
Write API KEY in the app.py server program of the DEMO.
python app.py
After the server program is performed, open the local page in the browser: http://127.0.0.1:5000
The DEMO quantitative platform is now running; register the test platform account (saved in the local data); log in to configure API KEY of the platform account.
Now it is configured as follows:
The three strategies displayed on the page are only UI displays. These also require specific design to be implemented by the manager of the asset management quantitative platform. Ther it is only for demonstration purpose.
Strategy code of main Test profit:
function main() {
while(true) {
LogProfit(Math.random()*100);
Sleep(1000);
}
}
Edit code and click save.
Note: make sure there is one docker online before operation.
You can see a newly created bot is displayed on the dashboard of FMZ Quant:
The corresponding random values are also displayed on DEMO page.
def robot_run(robotId, appId, exchanges):
strategyId = -1
# You can select to operate a strategy containing the string "main" from the "Strategy"library
for ele in api("GetStrategyList")['data']['result']['strategies']:
if 'main' in ele['name']:
strategyId = ele['id']
if strategyId < 0:
raise u"not found strategy"
settings = {
"name":"robot for %s" % (appId, ),
"args": [], # our custom arguments for this strategey
"appid": appId, # set a label for the bot, to relate to the user
"period": 60,
"strategy": strategyId,
"exchanges": [],
}
for e in exchanges:
settings["exchanges"].append({"eid": e.eid, "pair": get_default_stock(e.eid), "meta" :{"AccessKey": e.accessKey, "SecretKey": e.secretKey}})
if robotId > 0:
return api('RestartRobot', robotId, settings)
else:
return api('NewRobot', settings)
As you can see, “settings” in the code is the configuration information to creates the bot, and appid is used to mark the user.
# Github address update: https://github.com/fmzquant/fmz_extend_api_demo