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

加入群聊

Most Advance Trading Bot Support Windows Linux Mac

GUI Pancakeswap 2 and Uniswap 3 SNIPER BOT 🏆 🥇 (MOST ADVANCE TRADING BOT SUPPORT WINDOWS LINUX MAC) (AUTO BUY TOKEN ON LAUNCH AFTER ADD LIQUIDITY) S

1 Dec 26, 2021
A Python library for rendering ASS subtitle file format using libass.

ass_renderer A Python library for rendering ASS subtitle file format using libass. Installation pip install --user ass-renderer Contributing # Clone

1 Nov 02, 2022
Date Time Userbot With Python

DATE_TIME_USERBOT An Telegram Bot By @Pythone_3 Config Vars API_ID : Telegram API_ID, get it from my.telegram.org/apps API_HASH : Telegram API_ID, get

Sinzz-sinan-m 2 Oct 20, 2021
A surviv.io bot that helps you manage you clan in surviv.io!

Scooter-Surviv.io-Clan-Bot A Surviv.io Discord Bot This is a bot that helps manage your surviv.io clan! Read below for more!!. Features Lets you creat

cosmic|duck 1 Jan 03, 2022
Mega.nz to GDrive uploader

Mega.nz to GDrive uploader With this telegram bot you can download files from mega.nz and upload those files or telegram uploaded files to GDrive. You

30 Nov 13, 2022
WebhookHub - A discord WebHook Manager with much more features coming soon

WebhookHub A discord WebHook Manager with much more features coming soon This is

5 Feb 19, 2022
Translator based on Google API

Yakusu Toshiko Translator based on Google API. Instance of this bot is running as @yakusubot. Features Add a plus to a language's name to show an orig

Arisu W. 2 Sep 21, 2022
Unarchive Bot for Telegram

Telegram UnArchiver Bot UnArchiveBot: 🇬🇧 Bot that allows you to extract supported archive formats in telegram. 🇹🇷 Desteklenen arşiv biçimleri tele

Hüzünlü Artemis [HuzunluArtemis] 25 May 07, 2022
Step by Step Guide To Install Discord Py Master Branch on Replit

Guide to Install Discord Py Master Branch on Replit Step 1 Create an empty repl on replit Step 2 Add this Basic Code to the file main.py so as to chec

Pranav Saxena 7 Nov 18, 2022
Moderation and Utility Discord bot.

Qrista An advanced Moderation and Utility Discord bot. Features Uses Hikari and Lightbulb as a command handler Advance Logging & Whole new enviroment

Blaze Camp 2 Jan 11, 2022
Sielzz Music adalah proyek bot musik telegram, memungkinkan Anda memutar musik di telegram grup obrolan suara.

Hi, I am: Requirements 📝 FFmpeg NodeJS nodesource.com Python 3.8 or higher PyTgCalls MongoDB Get STRING_SESSION from below: 🎖 History Features 🔮 Th

1 Nov 29, 2021
An unoffcial python API client for primeuploads.com

primeuploads-py An unoffcial python API wrapper for primeuploads.com Installation pip3 install primeuploads-py Usage example from prime import PrimeUp

W4RR10R 41 Dec 05, 2022
An open-source Discord Nuker can be used as a self-bot or a regular bot.

How to use Double click avery.exe, and follow the prompts Features Important! Make sure to use [9] (Scrape Info) before using these, or some things ma

Exortions 3 Jul 03, 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
Match-making API for OpenSanctions

OpenSanctions Match-making API This directory contains code and a Docker image for running an API to match data against OpenSanctions. It is intended

OpenSanctions.org 26 Dec 15, 2022
A modular Telegram group management bot running with Python based on Pyrogram.

A modular Telegram group management bot running with Python based on Pyrogram.

Jefanya Efandchris 1 Nov 14, 2022
vk Bot because of which everyone will lag

VK-crash-bot open cmd and write: "pip install vk-api" To configure the bot, you need to open main.py and set the value to such variables as "token" an

NotQuki 0 Jun 05, 2022
twitter bot tha uses tweepy library class to connect to TWITTER API

TWITTER-BOT-tweepy- twitter bot that uses tweepy library class to connect to TWITTER API replies to mentions automatically and follows the tweet.autho

Muziwandile Nkomo 2 Jan 08, 2022
A Python wrapper around the Twitter API.

Python Twitter A Python wrapper around the Twitter API. By the Python-Twitter Developers Introduction This library provides a pure Python interface fo

Mike Taylor 3.4k Jan 01, 2023
TORNADO CASH Proxy Pancakeswap Sniper BOT 2022-V1 (MAC WINDOWS ANDROID LINUX)

TORNADO CASH Pancakeswap Sniper BOT 2022-V1 (MAC WINDOWS ANDROID LINUX) ⭐️ A ful

Crypto Trader 1 Jan 06, 2022