All Projects → Cinderella-Man → hedgehog

Cinderella-Man / hedgehog

Licence: other
Source code for the "Hands-on Elixir & OTP: Cryptocurrency Trading Bot" course

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to hedgehog

binapi
Binance API C++ implementation
Stars: ✭ 129 (+84.29%)
Mutual labels:  binance, binance-api
cryptodiversify
Automatically check your portfolio on the Binance exchange and advice you on rebalancing your portfolio into the top 20 cryptocurrencies by market capitalization
Stars: ✭ 43 (-38.57%)
Mutual labels:  binance, binance-api
Bybit-Auto-Trading-Bot-Ordes-placed-via-TradingView-Webhook
Python based Trading Bot that uses TradingView.com webhook JSON alerts to place orders(buy/sell/close/manage positions/TP/SL/TS etc.) on Bybit.com. Hire me directly here https://www.freelancer.com/u/Beannsofts for any assistance
Stars: ✭ 235 (+235.71%)
Mutual labels:  binance, binance-api
binance-client-websocket
🛠️ C# client for Binance websocket API
Stars: ✭ 41 (-41.43%)
Mutual labels:  binance, binance-api
binance-connector-dotnet
Lightweight connector for integration with Binance API
Stars: ✭ 77 (+10%)
Mutual labels:  binance, binance-api
unicorn-binance-suite
The UNICORN Binance Suite is a Python Meta Package of unicorn-fy, unicorn-binance-local-depth-cache, unicorn-binance-rest-api, unicorn-binance-trailing-stop-loss and unicorn-binance-websocket-api.
Stars: ✭ 35 (-50%)
Mutual labels:  binance, binance-api
binance-spot-order-notification-heoku
[binance order trade fill notification] Telegram Notification when Binance order created, cancelled or filled. Ready to Deploy on Heroku
Stars: ✭ 30 (-57.14%)
Mutual labels:  binance, binance-api
hands-on-elixir-and-otp-cryptocurrency-trading-bot
Source code to generate the "Hands-on Elixir & OTP: Cryptocurrency trading bot" book
Stars: ✭ 210 (+200%)
Mutual labels:  binance, binance-api
binancer
An R client to the Public Rest API for Binance.
Stars: ✭ 51 (-27.14%)
Mutual labels:  binance, binance-api
multi pairs martingle bot
A muti pairs martingle trading bot for Binance exchange.
Stars: ✭ 55 (-21.43%)
Mutual labels:  binance, binance-api
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 (+31.43%)
Mutual labels:  binance, binance-api
binance-chain-kit-ios
Full Binance DEX iOS library (SDK), implemented on Swift.
Stars: ✭ 15 (-78.57%)
Mutual labels:  binance, binance-api
binance-downloader
Python tool to download Binance Candlestick (k-line) data from REST API
Stars: ✭ 44 (-37.14%)
Mutual labels:  binance, binance-api
binance-technical-algorithm
Technical trading algorithm for Binance
Stars: ✭ 44 (-37.14%)
Mutual labels:  binance, binance-api
binance-rs-async
Async client for the Binance APIs
Stars: ✭ 74 (+5.71%)
Mutual labels:  binance, binance-api
twitter-crypto-bot
This is a Twitter bot that tweets about cryptocurrencies prices every certain amount of minutes
Stars: ✭ 21 (-70%)
Mutual labels:  binance, binance-api
java-binance-api
Java Binance API Client
Stars: ✭ 72 (+2.86%)
Mutual labels:  binance, binance-api
Blankly
🚀 💸 Easily build, backtest and deploy your algo in just a few lines of code. Trade stocks, cryptos, and forex across exchanges w/ one package.
Stars: ✭ 1,456 (+1980%)
Mutual labels:  algotrading, binance
howtrader
Howtrader is a crypto currency quant framework, you can easily develop, backtest and run your own strategy in real market. It also supports tradingview or other 3rd party signals, just simply send a post request and it will help trade automatically. Now it only support binance spot, futures and inverse futures exchange. It will support okex, ftx…
Stars: ✭ 294 (+320%)
Mutual labels:  binance, binance-api
binance-bot
Very simple binance trading Bot using Binance REST API
Stars: ✭ 108 (+54.29%)
Mutual labels:  binance, binance-api

Hedgehog

Repository created to follow along with the Create a cryptocurrency trading bot in Elixir course.

Each subsequent video has an assigned git branch that stores a state of the code after it.

For anyone interested in an written version of the course, it's available free online at elixircryptobot.com.

Limit of Liability/Disclaimer of Warranty

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Intial setup

  1. Install the required dependencies:
$ mix deps.get
...
  1. Start Postgres instance inside docker:
$ docker-compose up -d
Creating hedgehog_db_1 ... done
  1. Create, migrate and seed databases inside the Postgres instance:
$ mix setup

Further setup (danger zone)

Inside the configuration file(config/config.exs) there's a setting(config :naive, binance_client) specifying which Binance client should be used. By default, it's the BinanceMock module that won't connect to the Binance exchange at all neither it will require any access configuration as it stores orders in memory.

To connect to the Binance exchange and make real trades the configuration needs to be changed to the Binance client:

# /config/config.exs:L25
binance_client: BinanceMock, => binance_client: Binance,

as well as api_key and secret_key need to be set:

# /config/config.exs:L49
config :binance,
  api_key: "insert value here",
  secret_key: "insert value here"

Running

iex -S mix

# connect to the Binance and stream into PubSub
Streamer.start_streaming("xrpusdt")

# to store trade_events in db
DataWarehouse.start_storing("trade_events", "xrpusdt")

# to store orders in db
DataWarehouse.start_storing("orders", "xrpusdt")

# turn on naive strategy
Naive.start_trading("XRPUSDT")

Postgres cheat sheet

psql -U postgres -h 127.0.0.1
Password for user postgres: postgres
...
postgres=# \c data_warehouse
...
postgres=# \x
...
data_warehouse=# SELECT COUNT(*) FROM trade_events;
...
data_warehouse=# SELECT COUNT(*) FROM orders;

Loading backtesting data

cd /tmp

wget https://github.com/Cinderella-Man/binance-trade-events/raw/master/XRPUSDT/XRPUSDT-2019-06-03.csv.gz

gunzip XRPUSDT-2019-06-03.csv.gz

PGPASSWORD=postgres psql -Upostgres -h localhost -ddata_warehouse  -c "\COPY trade_events FROM '/tmp/XRPUSDT-2019-06-03.csv' WITH (FORMAT csv, delimiter ';');"

Running backtesting

DataWarehouse.start_storing("orders", "xrpusdt")

Naive.start_trading("XRPUSDT")

DataWarehouse.publish_data(%{
  type: :trade_events,
  symbol: "XRPUSDT",
  from: "2019-06-02",
  to: "2019-06-04",
  interval: 5
})

Running integration test

MIX_ENV=test mix test.integration
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].