All Projects → mdn522 → binaryapi

mdn522 / binaryapi

Licence: other
Binary.com & Deriv.com API for Python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to binaryapi

Metatrader
Expert advisors, scripts, indicators and code libraries for Metatrader.
Stars: ✭ 99 (+209.38%)
Mutual labels:  trading, trading-bot, forex, forex-trading, automated-trading, foreign-exchange
xapi-node
xStation5 Trading API for NodeJS/JS
Stars: ✭ 36 (+12.5%)
Mutual labels:  trading, forex, forex-trading
ForEx
Using ML to create a ForEx trader to invest my personal finances to get rid of student debt
Stars: ✭ 17 (-46.87%)
Mutual labels:  trading, trading-bot, forex-trading
tumbleweed gdax
Prototype market maker specialized to trade on CoinbasePro
Stars: ✭ 41 (+28.13%)
Mutual labels:  trading, trading-bot, automated-trading
Sequence-to-Sequence-Learning-of-Financial-Time-Series-in-Algorithmic-Trading
My bachelor's thesis—analyzing the application of LSTM-based RNNs on financial markets. 🤓
Stars: ✭ 64 (+100%)
Mutual labels:  trading, forex, forex-trading
Twitter Activated Crypto Trading Bot
Buys crypto through keyword detection in new tweets. Executes buy in 1 second and holds for a given time (e.g. Elon tweets 'doge', buys Dogecoin and sells after 5 minutes). Tested on Kraken and Binance exchanges
Stars: ✭ 92 (+187.5%)
Mutual labels:  trading, trading-bot, automated-trading
AutoTrader
A Python-based development platform for automated trading systems - from backtesting to optimisation to livetrading.
Stars: ✭ 227 (+609.38%)
Mutual labels:  trading, trading-bot, forex
hurtrade
An Open Source Forex Trading Platform
Stars: ✭ 22 (-31.25%)
Mutual labels:  money, trading, forex-trading
Lean
Lean Algorithmic Trading Engine by QuantConnect (Python, C#)
Stars: ✭ 5,675 (+17634.38%)
Mutual labels:  trading, trading-bot, forex
Oanda Api V20
OANDA REST-V20 API wrapper. Easy access to OANDA's REST v20 API with oandapyV20 package. Checkout the Jupyter notebooks!
Stars: ✭ 325 (+915.63%)
Mutual labels:  trading, trading-bot, forex
Siis
Trading bot including terminal, for crypto and traditionals markets. Assisted or fully automated strategy.
Stars: ✭ 45 (+40.63%)
Mutual labels:  trading, trading-bot, forex
Mida
The open-source and cross-platform trading framework
Stars: ✭ 263 (+721.88%)
Mutual labels:  trading, trading-bot, forex
Oandapyv20 Examples
Examples demonstrating the use of oandapyV20 (oanda-api-v20)
Stars: ✭ 102 (+218.75%)
Mutual labels:  trading, trading-bot, forex
Trading Server
A multi-asset, multi-strategy, event-driven trade execution and management platform for running many algorithms/bots at many venues simultaneously with unified risk management and reporting. Uses MongoDB for storage and Telegram for user notifications/trade consent.
Stars: ✭ 191 (+496.88%)
Mutual labels:  trading, trading-bot, forex
Algotrading
Algorithmic trading framework for cryptocurrencies.
Stars: ✭ 249 (+678.13%)
Mutual labels:  trading, trading-bot
gym-mtsim
A general-purpose, flexible, and easy-to-use simulator alongside an OpenAI Gym trading environment for MetaTrader 5 trading platform (Approved by OpenAI Gym)
Stars: ✭ 196 (+512.5%)
Mutual labels:  trading, forex
Crypto Trader
💰 Cryptocurrency trading bot library with a simple example strategy (trading via Gemini).
Stars: ✭ 554 (+1631.25%)
Mutual labels:  money, trading
Alpaca Backtrader Api
Alpaca Trading API integrated with backtrader
Stars: ✭ 246 (+668.75%)
Mutual labels:  trading, trading-bot
tvjs-overlays
💴 Collection of overlays made by the TradingVueJs community
Stars: ✭ 65 (+103.13%)
Mutual labels:  money, trading
Oxr
💱 Node.js wrapper for the Open Exchange Rates API
Stars: ✭ 72 (+125%)
Mutual labels:  money, forex

Binary.com & Deriv.com API for Python

Donate

Documentation

Documentation is also available online at https://binaryapi.readthedocs.io


About API

# High Level API, This API is based on "binaryapi.api" for easy usage
from binaryapi.stable_api import Binary

# Low Level API
from binaryapi.api import BinaryAPI

Compatibility

Requires Python 3.7.0 or later.


Installing and Updating

pip install -U git+https://github.com/mdn522/binaryapi.git

Must have git installed


Getting Started

from binaryapi.stable_api import Binary

binary_token = "YOUR-API-TOKEN-GOES-HERE"

binary = Binary(token=binary_token)

symbol = "frxEURUSD"  # symbol/asset

print("Buy a [CALL] contract")
success, contract_id, req_id = binary.buy('CALL', amount=1, symbol=symbol, duration=5, duration_unit='t')

print('success={}, contract_id={}, req_id={}'.format(success, contract_id, req_id))

Document

Import

from binaryapi.stable_api import Binary

Enabling Debug Logs

import logging
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(message)s')

Authorize/Login

binary = Binary(token="YOUR-API-TOKEN-GOES-HERE")

*It automatically subscribes to balance and transaction API


Authorize/Login with a message handler function

def message_handler(message):
    msg_type = message.get('msg_type')
    
    print(msg_type, "=>", message)

    
binary = Binary(token="YOUR-API-TOKEN-GOES-HERE", message_callback=message_handler)

I tried to add every API function available in Binary.com API documentation to this library, which you can call by accessing api variable of stable API

Examples:

binary = Binary(token="YOUR-API-TOKEN-GOES-HERE")

# Buy API - https://developers.binary.com/api/#buy
binary.api.buy(buy, price, parameters=None, subscribe=None, passthrough=None, req_id=None)
# You must pass values for "buy" and "price" arguments

# Proposal API - https://developers.binary.com/api/#proposal
binary.api.proposal(contract_type, currency, symbol, amount=None, barrier=None, barrier2=None, basis=None, cancellation=None, date_expiry=None, date_start=None, duration=None, duration_unit=None, limit_order=None, multiplier=None, product_type=None, selected_tick=None, subscribe=None, trading_period_start=None, passthrough=None, req_id=None)
# You must pass values for "contract_type", "currency" and "symbol" arguments

# Subscribe to Ticks API - https://developers.binary.com/api/#ticks
binary.api.ticks(ticks="frxEURUSD", subscribe=None, passthrough=None, req_id=None)

# For More API functions/endpoints please refer to https://developers.binary.com/api/
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].