Skip to content

Budapest" cryptocurrency trading script. Buy, sell or float a cryptocurrency taking into account the current market state and the past.

Notifications You must be signed in to change notification settings

amuracciole/budapest-bot-binance

Repository files navigation

Binance Budapest Bot

This bot connects to Binance and buys or sells taking into account the Budapest strategy, which consists of buying if the current price is in the green quadrant and selling if it is in the red quadrant. The flag is formed taking into account the high and low prices of the last 30 days.

  • RED ZONE: Sell BTC. The current price is between the maximum (in the last 30 days) and 33% cheaper than the maximum. 🔴
  • WHITE ZONE: No buy no sell ⚪
  • GREEN ZONE: Buy BTC. The current price is between the minimum (in the last 30 days) and 33% more expensive than the minimum. 🟢

Moon trading

⚠️ ALERT!: This is an academic task and NOT AN INVEST ADVISE ⚠️

Keys 🔑

Plese add you own keys and paths in config.py file

  • API_KEY & API_SECRET -> Obtained in Binance web
  • Full directory where the text files that store global variables will be located. There are 8 text files in total, 4 are for the production environment and the other 4 are for backtesting.

By default the variables should be initialized:

  • "coins" -> Amount of BTC to start with.
  • "money" -> Amount of stable coin BUSD to start with
  • "next order" -> Variable defining the amount of BUSD to be used to buy BTC next time
  • "ready to sell" -> Variable indicating whether it is possible to sell

As an example we start with 0, 1000, 10, 0 respectively.

Backtesting 🚩

The budapest_strategy_backtest.py file is used to backtest the script and see its profitability. By default it does backtesting from the daily candles of the last 365 days.

Crontab ⏱️

You MUST include the following line in you crontab file to run the script every day at 4:00 AM (You can schedule as you wish)

0 4 * * * project path

Test orders ❗

This script will never buy or sell BTC because only run "test_order". In case you want to work with real operations, please comment test_order lines and delete "#" before "order_market_sell" and "order_market_buy" lines

"Buy Me A Coffee"

About

Budapest" cryptocurrency trading script. Buy, sell or float a cryptocurrency taking into account the current market state and the past.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages