数字货币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虚拟货币量化交易策略开发 自动化交易策略运行

加入群聊

The system to host your files on the Discord application

Distorage The system to host your files on the Discord application Documentation Documentation Distorage How to use the package You can install it wit

6 Jun 27, 2022
Telegram 隨機色圖,支援每日自動爬取

Telegram 隨機色圖機器人 使用此原始碼的Bot 開放的隨機色圖機器人: @katonei_bot 已實現的功能 爬取每日R18排行榜 不夠色!再來一張 Tag 索引,指定Tag色圖 將爬取到的色圖轉為 WebP 格式儲存,節省空間 需要注意的事件 好久之前的怪東西,代碼質量不保證 請在使用A

cluckbird 15 Oct 18, 2021
A modular Telegram Python bot running on python3 with a sqlalchemy database.

Nao Tomori Robot Found Me On Telegram As Nao Tomori 🌼 A modular Telegram Python bot running on python3 with a sqlalchemy database. How to setup/deplo

Stinkyproject 1 Nov 24, 2021
A Telegram Bot for searching any channel messages from Inline by @AbirHasan2005

Message-Search-Bot A Telegram Bot for searching any channel messages from Inline by @AbirHasan2005. I made this for @AHListBot. You can use this for s

Abir Hasan 44 Dec 27, 2022
Coin-based opinion monitoring system

介绍 本仓库提供了基于币安 (Binance) 的二级市场舆情系统,可以根据自己的需求修改代码,设定各类告警提示 代码结构 binance.py - 与币安API交互 data_loader.py - 数据相关的读写 monitor.py - 监控的核心方法实现 analyze.py - 基于历史数

luv_dusk 6 Jun 08, 2022
GitHub Activity Generator - A script that helps you instantly generate a beautiful GitHub Contributions Graph for the last year.

GitHub Activity Generator A script that helps you instantly generate a beautiful GitHub Contributions Graph for the last year. Before 😐 😶 😒 After ?

1 Dec 30, 2021
Add Reactions to your Channel Posts!

• Shaaak - Post Reaction Bot Simple and Minimalistic telegram bot to add Reactions and Comments to your Channel Posts! - What's Unique About it?

Harsh Raj 4 Jan 31, 2022
A Bot to get RealTime Tweets to a Specific Chats from Desired Persons on Twitter to Telegram Chat.

TgTwitterStreamer A Bot to get RealTime Tweets to a Specific Chats from Desired Persons on Twitter to Telegram Chat. For Getting ENV's Refer this Link

Anonymous 69 Dec 20, 2022
Bot Auto Chess.com

Bot Auto Chess.com Is a suggestion for chess moves on the chess.com platform. The available features are: chess suggestions and moves automatically. i

Tn. Ninja 34 Jan 01, 2023
Role Based Access Control for Slack-Bolt Applications

Role Based Access Control for Slack-Bolt Apps Role Based Access Control (RBAC) is a term applied to limiting the authorization for a specific operatio

Jeremy Schulman 7 Jan 06, 2022
Bitbucket Server API Wrapper

A simple wrapper for the Atlassian's Bitbucket Server / Bitbucket Datacenter (formerly Stash) REST API, written in Python.

Schweitzer Engineering Laboratories 4 Jan 06, 2023
A Python library for the Discourse API

pydiscourse A Python library for working with Discourse. This is a fork of the original Tindie version. It was forked to include fixes, additional fun

Ben Lopatin 72 Oct 14, 2022
A simple Spamming software made in python

Spam-qlk Warning!!! 'I' am not responsible for the 'damage or harm' caused by this 'Software'!!! Use at your own risk!!! Input the message. After you

Aditya kumar 1 Nov 30, 2021
Yes, it's true :yellow_heart: This repository has 326 stars.

Yes, it's true! Inspired by a similar repository from @RealPeha, but implemented using a webhook on AWS Lambda and API Gateway, so it's serverless! If

510 Dec 28, 2022
google-resumable-media Apache-2google-resumable-media (🥉28 · ⭐ 27) - Utilities for Google Media Downloads and Resumable.. Apache-2

google-resumable-media Utilities for Google Media Downloads and Resumable Uploads See the docs for examples and usage. Experimental asyncio Support Wh

Google APIs 36 Nov 22, 2022
Image-Bot-Discord - This Is a discord bot that shows the specific image you search from Google

Advanced Discord.py Image Bot CREDITS Made by RLX and Mathiscool README by Milrato Installation Guide in .env Adjust the TOKEN python main.py to start

RLX 3 Jan 16, 2022
A complete Python application to automatize the process of uploading files to Amazon S3

Upload files or folders (even with subfolders) to Amazon S3 in a totally automatized way taking advantage of: Amazon S3 Multipart Upload: The uploaded

Pol Alzina 1 Nov 20, 2021
LoL 台版10周年活動自動輸入邀請碼

LoLTW_10Year_88Event LoLTW 8.8 周年慶 邀請碼自動輸入 設定 在 LoLTW_10Year_88Evnet.exe 的位置建立一個檔案 .env,內容如下 Bahamut_Discussion = https://forum.gamer.com.tw/C.php?bsn

古丁丁 5 Dec 13, 2021
Fetching tweets and integrating it with Kafka and PySpark

KafkaPySpark Zookeeper bin/zookeeper-server-start.sh config/zookeeper.properties Kafka Server bin/kafka-server-start.sh config/server.properties Kafka

Priyansh 2 Dec 29, 2021
A simple terminal UI for viewing fund P/L analysis through TEFAS

Tefas UI A simple terminal UI for viewing fund P/L analysis through TEFAS. Features (that my own bank's UI lack): Daily and weekly P/L FX comparisons

Batuhan Taskaya 4 Mar 14, 2022