数字货币BTC量化交易系统-实盘行情服务器,虚拟币自动炒币-火币API-币安交易所-量化交易-网格策略。趋势跟踪策略,最简源码,可在线回测,一键部署,可定制的比特币量化交易框架,3年实盘检验!

Overview

huobi_intf

提供火币网的实时行情服务器(支持火币网所有交易对的实时行情),自带API缓存,可用于实盘交易和模拟回测。 行情数据,是一切量化交易的基础,可以获取1min、60min、4hour、1day等数据。数据能进行缓存,可以在多个币种,多个时间段查询的时候,查询速度依然很快。 服务框架采用基于强大的异步网络库tornado

功能特点:

  • 为什么要用独立的行情服务器,直接调用火币的行情API不行吗?( https://github.com/mpquant/huobi_hq 我们另外一个项目,直接调用火币行情api的封装) 火币行情服务器比较慢,尤其在国内被墙,无法访问,尤其多个策略运行,一次需要获取多个币种数据做实时指标计算的时候,慢的让你怀疑人生,无法满足实盘要求,所以必须架设独立的行情服务器

  • 自带Redis接口缓存,重复的历史日线,4小时线等数据获取一次即被缓存,下次策略再取得时候直接返回,速度加速上百倍

  • 完美包装火币的行情API,行情服务对外只简洁到一个get_price()函数,可以实时获取火币所有交易对实时行情,包括按天,4小时,1小时,15分钟,5分钟,1分钟的实时行情

  • 历史行情支持从当前时间往前推3000条,和历史任意时间200条的数据 (需要历史任意时间3000以上条可以联系下面微信)

  • 在本行情服务器基础上开发有增强版的本地历史行情服务器内存数据版,用来做策略回测,调参等,可以达到半年数据1分钟跑完回测看结果 (感兴趣的可以联系下面微信)

  • 最简函数调用 get_price(security, start_date=None, end_date=None, count=None, frequency='1d', fields=['open','close', 'low', 'high']) 具体看下面例子,懂的自然能看懂

  • 行情服务器编程语言是python,采用高性能异步网络框架tornado做WebApi, 标准json返回,所有语言都能方便调用

  • 经过半年的运行,已经是非常稳定的版本,可以直接用在实盘生成环境

  • 针对高频交易,每秒都要更新价格那种,可以联系最下面微信,我们提供分布式多端密集更新方案,来满足秒级别行情的要求

  • 稳定,可靠,及时的行情服务器是高波动率数字货币量化交易的基础实施,我们全部开源出来,希望能帮助到大家

系统架构图:

web

服务器启动说明

运行文件huobi_app.py启动服务,服务启动后就可以用程序调用所有的接口

python3 huobi_app.py

   (可选运行参数  --port=8005  )

启动成功后,在浏览器里输入http://127.0.0.1:8005/info,如果能出现下边的画面,说明启动成功了
info

需安装第三方库 (python >= 3.6 )

  • requests
  • pandas
  • tornado
  • websocket-client

安装时执行命令:pip install -r requirements.txt

接口说明

  • get_price接口得到火币的币的数据,返回dataframe的格式

  • 为了支持多交易所(币安,okex等),我们规范定义了几个核心数据格式

    • 交易对统一用 btc.usdt , eth.usdt , eth.btc 这样的中间加.分割的格式
    • 时间周期统一用 1d: 一天 , 4h: 四小时 , 60m: 60分 , 15m:15分 , 5m:5分 , 1m:1分 这样的格式
#1分钟的数据获取
df = get_price('btc.usdt', end_date='2021-04-25 18:56:23', count=1, frequency='1m')

#日线的数据获取
df = get_price('btc.usdt', end_date='2021-04-25 18:56:23', count=10, frequency='1d')

#4小时的数据获取
df = get_price('btc.usdt', end_date='2021-04-25 18:56:23', count=10, frequency='4h')

#1小时的数据获取
df = get_price('btc.usdt', end_date='2021-04-25 18:56:23', count=10, frequency='60m')

btc的1分钟线

btc1min

btc日线

btc日线

实盘策略收益图

下图是利用利用这个行情框架,跑的策略收益图 (山寨币趋势轮动策略) rate

3、intf_test.py里有调用这个接口的例子


巴特量化

  • 数字货币 股市量化工具 行情系统软件开发
  • BTC虚拟货币量化交易策略开发 自动化交易策略运行

加入群聊

A modular telegram Python bot running on python3 with an sqlalchemy database.

Saber A modular telegram Python bot running on python3 with an sqlalchemy database. Originally a marie fork - Saber has evolved further and was built

ZERO • アクバル . 4 Nov 09, 2021
Twitter automation tool for growing organic followers.

Tiwoto Tiwoto is a simple python program that automates some kind of behaviors and keep your account active. Create an .env file in this directory and

Mehmetcan Yildiz 6 Sep 22, 2022
Play Video & Music on Telegram Group Video Chat

Video Stream is an Advanced Telegram Bot that's allow you to play Video & Music on Telegram Group Video Chat 🧪 Get SESSION_NAME from below: Pyrogram

Sehath Perera 1 Jan 17, 2022
An Open Source ALL-In-One Telegram RoBot, that can do lot of things.

URL Uploader Bot An Open Source ALL-In-One Telegram RoBot, that can do lot of things. My Features Installation The Easy Way You can also tap the Deplo

NT BOTS 1 Oct 23, 2021
摩尔庄园手游脚本

摩尔庄园 BlueStacks 脚本 手游上线,情怀再起,但面对游戏中枯燥无味的每日任务和资源采集,你是否觉得肝疼呢? 本项目通过生成 BlueStacks 模拟器的宏脚本,帮助玩家护肝。 使用脚本请阅读 使用方式 和对应的 功能及说明 联系 Telegram 频道 @mole61 Telegram

WH-2099 43 Dec 16, 2022
Network simulation tools

Overview I'm building my network simulation environments with Vagrant using libvirt plugin on a Ubuntu 20.04 system... and I always hated how boring i

Ivan Pepelnjak 219 Jan 07, 2023
A Python Jupyter Kernel in Slack. Just send Python code as a message.

Slack IPython bot 🤯 One Slack bot to rule them all. PyBot. Just send Python code as a message. Install pip install slack-ipython To start the bot, si

Rick Lamers 44 May 23, 2022
Bill is a bot capable to Chat with you, search everything on web to you, and send message to yours contacts for you.

Bill Bot The inteligent Bot Bill is a intelligent bot, it can chat, search and send messages to you. Chat with You Send messages on WhatsApp for you S

João Assalim 3 Sep 12, 2021
Spacecrypto-bombcrypto-bot - SpaceCrypto And Bombcrypto Bot - MultiScreen

SpaceCrypto And Bombcrypto Bot - MultiScreen This is a open source project inspi

Paulo Bramante 5 Nov 03, 2022
The unofficial Amazon search CLI & Python API

amzSear The unofficial Amazon Product CLI & API. Easily search the amazon product directory from the command line without the need for an Amazon API k

Asher Silvers 95 Nov 11, 2022
Graviti-python-sdk - Graviti Data Platform Python SDK

Graviti Python SDK Graviti Python SDK is a python library to access Graviti Data

Graviti 13 Dec 15, 2022
Twitter-redesign - Twitter Redesign With Django

Twitter Redesign A project that tests Django and React knowledge through a twitt

Mark Jumba 1 Jun 01, 2022
Freqtrade is a free and open source crypto trading bot written in Python.

Freqtrade is a free and open source crypto trading bot written in Python. It is designed to support all major exchanges and be controlled via Telegram. It contains backtesting, plotting and money man

Kazune Takeda 5 Dec 30, 2021
Ini adalah UserBot Telegram dengan banyak modul keren. Ditulis dengan Python dengan Telethon dan Py-Tgcalls.

Okaeri-Userbot Okaeri-Userbot = userbot telegram modular yang berjalan di python3 dengan database sqlalchemy. Disclaimer Saya tidak bertanggung jawab

Wahyu 1 Dec 15, 2021
PackMyPayload - Emerging Threat of Containerized Malware

This tool takes a file or directory on input and embeds them into an output file acting as an archive/container.

Mariusz Banach 594 Dec 29, 2022
聚合空间测绘搜索(Fofa,Zoomeye,Quake,Shodan,Censys,BinaryEdge)

#Search-Tools Search-Tools集合比较常见的网络空间探测引擎 Fofa,Zoomeye,Quake,Shodan,Censys,BinaryEdge 简单说明 ICO搜索目前只有Fofa,Shodan,Quake支持 代理设置是防止在API请求过于频繁,或者在实战中,好多红队打

311 Dec 16, 2022
Music cog for discord bots. Supports YouTube, YoutubeMusic, SoundCloud and Spotify.

dismusic Music cog for discord bots. Supports YouTube, YoutubeMusic, SoundCloud and Spotify. Installation python3 -m pip install dismusic Usage from d

Md Shahriyar Alam 59 Jan 08, 2023
Archive tweets and make them searchable

Tweeter Archive and search your tweets and liked tweets using AWS Lambda, DynamoDB and Elasticsearch. Note: this project is primarily being used a tes

Kamil Sindi 8 Nov 18, 2022
Google Sheets Python API

Google Spreadsheets Python API v4 Simple interface for working with Google Sheets. Features: Open a spreadsheet by title, key or url. Read, write, and

Anton Burnashev 6.2k Dec 30, 2022
Want to play What Would Rather on your Server? Invite the bot now!😏

What is this Bot? 👀 What You Would Rather? is a Guessing game where you guess one thing. Long Description short Take this example: You typed r!rather

丂ㄚ么乙ツ 2 Nov 17, 2021