Bingo-Bot (Binance GO Bot) is a work-in-progress, experimental trading bot for Binance, built with Go and designed to be flexible, extensible, and easy to use. Whether you're testing strategies or building a robust trading system, Bingo-Bot is here to help!
- Automated Trading: Works with Binance for spot trading. More exchanges coming soon!
- Custom Strategies: Easily implement your own strategies in the
./strategies/
folder. - Market Analysis: Bot automatically analyzes markets and trades based on market conditions.
- Automatic pairs add/remove: Bot automatically adds new pairs and removes pairs that are not profitable.
- Pluggable Exchanges: Add other exchanges by adhering to the shared interface in
./interfaces/shared.go
. - Stop-Loss and Take-Profit: Dynamic risk management for trades.
- Multi-Pair Trading: Manage multiple trading pairs with thread-safe operations.
- Trend Filtering: Combines indicators like RSI and MACD for smarter trades.
- Docker Support: Deploy quickly with Docker Compose.
- Performance Logging: Tracks your trades for performance analysis.
- Go (1.23)
- Docker and Docker Compose (optional)
- A Binance API Key and Secret
-
Clone the Repository
git clone https://github.com/your-repo/bingo-bot.git cd bingo-bot
-
Prepare Environment Variables
- Rename
.env.sample
to.env
:mv .env.sample .env
- Fill in your Binance API Key and Secret in the
.env
file:BINANCE_API_KEY=your_api_key BINANCE_API_SECRET=your_api_secret
- Rename
-
Run with Docker Compose:
- Update the database volume in the
docker-compose.yml
file if needed:volumes: - /path/to/local/folder:/app/sqlite_data
- Start the bot:
docker-compose up --build
- Update the database volume in the
-
Run Directly with Go:
- Build and run:
go build -o bingo-bot main.go ./bingo-bot
- Or use
go run
:go run main.go --log=debug
- Build and run:
You can find the default strategies in the ./strategies/
folder. To add your own:
- Implement a new struct that adheres to the
Strategy
interface in./interfaces/shared.go
. - Add your logic for signal generation (e.g., RSI, MACD, Moving Averages).
- The bot's trading logic manages multiple pairs using
MultiPairTradingBot
. Ensure your strategy is compatible with this multi-pair setup.
Example:
type MyCustomStrategy struct {}
func (self *MyCustomStrategy) Calculate(candles []models.CandleStick, pair string, trend bool) (int, error) {
// Custom logic here
return 0, nil
}
Bingo-Bot uses a flexible configuration system found in the config package to manage strategies and settings for different market states. This system allows you to fine-tune how the bot behaves under varying market conditions.
β’ Market State Strategies: Separate strategy configurations (Default, Chaotic, Trending, etc.) for different market conditions.
β’ Intervals & Filters: Set how often the bot trades and analyzes the market, and filter markets to include or exclude certain trading pairs.
β’ Analyzer Config: Contains parameters for technical indicators (RSI, MACD, etc.) used in market analysis.
β’ UpdateStrategy(state, strategy): Change the strategy for a specific market state after validating it.
β’ UpdateAnalyzerConfig(analyzerConfig): Update the market analyzerβs parameters.
β’ Other update methods adjust intervals, include/exclude markets, and more.
You can also use default configurations or create your own by modifying the config package.
conf := config.DefaultMultiTradingConfig()
bt := bot.NewMultiPairTradingBot(cl, &conf)
- Binance is currently supported. More exchanges are coming soon!
- To add a new exchange, implement the
ExchangeClient
interface in./interfaces/shared.go
. - PRs are welcome for new exchange integrations.
To integrate a new exchange:
- Implement the
Exchange
interface in./interfaces/shared.go
. - Provide methods for fetching market data, creating orders, and managing balances.
The bot manages multiple trading pairs using internal thread-safe mechanisms.
- Mutexes are used to handle concurrent access to shared resources such as trading pairs and market data.
- No manual mutex handling is required for users implementing new strategies or adding pairs. The bot's
MultiPairTradingBot
handles this automatically.
For advanced users integrating new exchanges or modifying the bot, ensure proper thread safety by leveraging sync.RWMutex
where applicable.
- Day Trading with RSI and MACD:
- Uses a combination of RSI and MACD for smarter trading decisions.
- Stop-loss and take-profit are configured dynamically.
- Backtesting Strategies:
- Simulate trading strategies on historical data.
bingo-bot/
βββ algos/ # Algos used for trading
βββ analysis/ # Market analysis
βββ bot/ # Core bot logic for trading
βββ client/ # Binance API client
βββ config/ # Config for trading bot
βββ db/ # SQLite integration for logging trades
βββ interfaces/ # Shared interfaces for strategies and exchanges
βββ logger/ # Logger implementation
βββ metrics/ # metrics reporting (wip)
βββ ml/ # experimental ml model for predicting when to buy (wip/experimental)
βββ models/ # structs for data models
βββ plotter/ # Plotting for performance of the bot (wip)
βββ strategies/ # Default and custom trading strategies
βββ types/ # Custom types structs for the bot
βββ utils/ # Utility functions (Performance, Time, etc.)
βββ main.go # Entry point for the bot
βββ Dockerfile # Docker file for building the bot
βββ docker-compose.yml # Docker Compose for easy deployment
- Bingo-Bot is experimental and should NOT be used with real money unless fully tested!
- Trading involves risk. Use at your own discretion.
Contributions are welcome and encouraged!
Feel free to submit pull requests, bug reports, or feature requests.
- Add backtesting framework.
- Improve logging and analytics.
- Integrate more exchanges.
- Add more strategies (Bollinger Bands, Stochastic Oscillator, etc.).
MIT License.