数字货币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 Telegram user bot to count telegram channel subscriber or group member.

Subscriber Count Userbot A Telegram user bot to count telegram channel subscriber or group member. This tool is only for educational purpose. You coul

IDNCoderX 8 Nov 30, 2022
The Research PACS on AWS solution facilitates researchers' access medical images stored in the clinical PACS in a secure and seamless manner

Research PACS on AWS Challenge to solve Solution presentation Deploy the solution Further reading Releases License Challenge to solve The rise of new

AWS Samples 23 Sep 09, 2022
Retrieves GitHub Stats via `git_api` and flask.

GitHub User Search Created using Python3 and git_api, coded by JBYT27. About This is a project I decided to make for Kajam, but I decided to choose a

an aspirin 4 May 11, 2022
You can share your Chegg account for answers using this bot with your friends without getting your account blocked/flagged

Chegg-Answer-Bot You can share your Chegg account for answers using this bot with your friends without getting your account blocked/flagged Reuirement

Ammey Saini 27 Dec 24, 2022
An almost dependency-less, synchronous Discord gateway library meant for my personal use

An almost dependency-less, synchronous Discord gateway library meant for my personal use.

h0nda 4 Feb 05, 2022
Customizable and open-sourced bot for a few private servers

MarlBot A private bot for controlling monkeys and turtles. Why does this bot exist? The bot exists as a general-purpose community bot for a select few

KR 1 Jan 18, 2022
a harbinger of events or things.

Herald: Intrusion Detection System using IR and ML Herald - noun; a harbinger of events or things. Overview Herald is an intrusion detection system us

Muhammad Muzzammil 4 Jun 07, 2021
Scratch2py or S2py is a easy to use, versatile tool to communicate with the Scratch API Based of Scratch2py

Scratch2py Scratch2py or S2py is a easy to use, versatile tool to communicate with the Scratch API Based of Scratch2py Installation Run this command i

2 Jan 13, 2022
AnyAPI is a library that helps you to write any API wrapper with ease and in pythonic way.

AnyAPI AnyAPI is a library that helps you to write any API wrappers with ease and in pythonic way. Features Have better looking code using dynamic met

Fatih Kilic 129 Sep 20, 2022
A Telegram Bot to display Codeforces Contest Ranklist

CFRankListBot A bot that displays the top ranks for a Codeforces contest. Participants' Details All the details of a participant is in the utils/__ini

Code IIEST 5 Dec 25, 2021
Fetch torrent links from nyaa, according to releases by smoke index.

Nyaa - Smoke's index torrent fetcher Description This script parses the local (or online) anime release index (csv format) made by Big Smoke. And uses

Dinank 21 Jun 08, 2022
BingBot - A bot that will automate searches on bing

bingBot A bot that will automate searches on bing. To install this just download

Lukas 2 Jul 28, 2022
Linky bot, A open-source discord bot that allows you to add links to ur website, youtube url, etc for the people all around discord to see!

LinkyBot Linky bot, An open-source discord bot that allows you to add links to ur website, youtube url, etc for the people all around discord to see!

AlexyDaCoder 1 Sep 20, 2022
Telegram bot/scraper to get the latest NUS vacancy reports.

Telegram bot/scraper to get the latest NUS vacancy reports. Stay ahead of the curve and don't get modrekt.

Chee Hong 1 Jan 08, 2022
Discord Bot Sending Members - Leaked by BambiKu ( Me )

Wokify Bot Discord Bot Sending Members - Leaked by BambiKu ( Me ) Info The Bot was orginaly made by someone else! Ghost-Dev just wanted to sell "priva

bambiku 6 Jul 05, 2022
Auto Filter Bot V2 With Python

How To Deploy Video Subscribe YouTube Channel Added Features Imdb posters for autofilter. Imdb rating for autofilter. Custom captions for your files.

Milas 2 Mar 25, 2022
Images to PDF Telegram Bot

ilovepdf Convert Images to PDF Bot This bot will helps you to create pdf's from your images [without leaving telegram] 😉 By Default: your pdf fil

✰Naͥbiͣlͫ A Navab✰ 116 Dec 29, 2022
This Mirror Bot is a multipurpose Telegram Bot writen in Python for mirroring files on the Internet to our beloved Google Drive.

MIRROR HUNTER This Mirror Bot is a multipurpose Telegram Bot writen in Python for mirroring files on the Internet to our beloved Google Drive. Repo la

anime republic 130 May 28, 2022
MassReportBot - Discord Mass Report Bot By Dropout

Discord Mass Report Bot By Dropout Discord Report Bot, Just Re-Made The "Admin R

vanis / 1800 0 Jan 20, 2022
An open-source Discord Bot Project based on programming!

An open-source Discord Bot Project based on programming!

Vladimer Moore 2 Aug 22, 2022