An automated trading bot that connects TradingView signals to Bitunix Futures trading platform, enabling automated execution of trading strategies. This bot allows you to automate your trading strategies by receiving webhook alerts from TradingView and executing trades on Bitunix Futures automatically.
- 📈 Real-time webhook endpoint for TradingView alerts
- 🤖 Automated order execution on Bitunix Futures
- 💱 Support for multiple trading pairs and order types
- 🔒 Secure API key management with environment variables
- 📊 Position management and risk controls
- 🧪 Comprehensive test suite with unit and integration tests
- 📝 Detailed logging for monitoring and debugging
- Node.js (v14 or higher)
- npm or yarn
- A Bitunix Futures account with API access
- TradingView account (Pro, Pro+ or Premium for webhook alerts)
- Clone the repository:
git clone https://github.com/ThomasEnoch/TradingviewTradingBot.git
cd TradingviewTradingBot
- Install dependencies:
npm install
- Create a
.env
file in the root directory with your configuration:
BITUNIX_API_KEY=your_api_key
BITUNIX_API_SECRET=your_api_secret
PORT=3000
NODE_ENV=production
BITUNIX_API_KEY
: Your Bitunix API keyBITUNIX_API_SECRET
: Your Bitunix API secretPORT
: Port for the webhook server (default: 3000)NODE_ENV
: Environment (development/production)
- In TradingView, create a new alert
- Set the webhook URL to your bot's endpoint
- Format the alert message as JSON:
{
"symbol": "BTCUSDT",
"side": "buy",
"quantity": 1,
"price": 50000
}
- Build the project:
npm run build
- Start the server:
npm start
For development:
npm run dev
Run all tests:
npm run test:all
Run specific test suites:
npm run test:unit # Unit tests
npm run test:integration # Integration tests
POST /webhook
Example payload:
{
"symbol": "BTCUSDT",
"side": "buy",
"quantity": 1,
"price": 50000,
"stopLoss": 49000,
"takeProfit": 51000
}
We welcome contributions! Please see our Contributing Guide for details.
This project is licensed under the MIT License - see the LICENSE file for details.
This bot is for educational purposes only. Cryptocurrency trading carries significant risks. Always test thoroughly with small amounts first. We are not responsible for any financial losses incurred while using this bot.
- Never commit API keys or sensitive information
- Always use environment variables for sensitive data
- Regularly update dependencies for security patches
- Use secure HTTPS endpoints in production
- Create an issue for bug reports or feature requests
- Check existing issues before creating new ones
- Follow the issue templates for bug reports and feature requests
- TradingView for their excellent charting and alerting platform
- Bitunix for their trading API
- All contributors who have helped improve this project