Bingo-Bot π
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!

β‘ Features
- 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.
π Getting Started
Prerequisites
- Go (1.23)
- Docker and Docker Compose (optional)
- A Binance API Key and Secret
Installation
-
Clone the Repository
git clone https://github.com/your-repo/bingo-bot.git
cd bingo-bot
-
Prepare Environment Variables
-
Run with Docker Compose:
-
Run Directly with Go:
βοΈ Configuration
Strategies
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) {
return 0, nil
}
π§ Configuration Explained
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.
MultiTrading Struct
The core configuration is handled by the MultiTrading struct, which defines:
β’ 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.
Updating Configurations
The bot provides methods to update configurations at runtime:
β’ 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)
Exchanges
- 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.
Adding New Exchanges
To integrate a new exchange:
- Implement the
Exchange interface in ./interfaces/shared.go.
- Provide methods for fetching market data, creating orders, and managing balances.
Mutex and Thread Safety
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.
π Example Use Cases
- 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.
π Project Structure
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
β οΈ Experimental π¨
- Bingo-Bot is experimental and should NOT be used with real money unless fully tested!
- Trading involves risk. Use at your own discretion.
π€ Contributing
Contributions are welcome and encouraged!
Feel free to submit pull requests, bug reports, or feature requests.
π§ TODO
- Add backtesting framework.
- Improve logging and analytics.
- Integrate more exchanges.
- Add more strategies (Bollinger Bands, Stochastic Oscillator, etc.).
π License
MIT License.
Happy Trading! π