Skip to content

chainmywallet/scalping-alert-bot

Repository files navigation

scalping-alert-bot

The Scalping Alerts Bot is a Python-based tool designed for cryptocurrency scalping and price action trading. It identifies high-volatility trading opportunities on the Bitget exchange and sends actionable alerts via Telegram. The bot dynamically adjusts its analysis based on the specified timeframe and includes advanced support and resistance detection, ATR-based volatility analysis, and optional order book evaluation.


Features

  • Dynamic Analysis:
    • Detects opportunities based on adjustable timeframes (e.g., 5m, 15m, 1h).
    • Identifies proximity to support and resistance zones.
  • Volatility Detection:
    • Uses ATR (Average True Range) for dynamic volatility thresholds.
    • Incorporates volume-based thresholds for better sensitivity.
  • Order Book Analysis (Optional):
    • Adjusts thresholds based on bid-ask spread and depth from the Bitget order book.
  • Telegram Notifications:
    • Sends detailed alerts with take profit (TP), stop loss (SL), leverage suggestions, and other key metrics.
  • CSV Export:
    • Saves detected opportunities to a CSV file for further analysis.

Used Software

  • Python 3.8+: Programming language used for the bot.
  • ccxt: Library for interacting with cryptocurrency exchange APIs.
  • Pandas: Data manipulation and analysis.
  • NumPy: Numerical operations and calculations.
  • Dotenv: Manage environment variables.
  • Requests: Send HTTP requests (used for Telegram integration).
  • Telegram Bot API: Send notifications via Telegram.

Installation

  1. Clone the Repository:

    git clone https://github.com/your-repo/scalping-alerts-bot.git
    cd scalping-alerts-bot
  2. Set Up Virtual Environment:

    python3 -m venv venv
    source venv/bin/activate
  3. Install Dependencies:

    pip install -r requirements.txt
  4. Configure Environment Variables: Create a .env file in the project root:

    TELEGRAM_BOT_TOKEN=your_telegram_bot_token
    TELEGRAM_CHAT_ID=your_chat_id
    

Configuration

Update the config.py file to adjust the bot’s behavior:

  • Static Coins: Ensure certain coins are always included:
    STATIC_COINS = ['BTCUSDT', 'ETHUSDT', 'PEPEUSDT']
  • Top Coins Limit: Number of top trading pairs to analyze based on volume:
    TOP_COINS_LIMIT = 50
  • Timeframe: Specify the timeframe for data analysis:
    TIMEFRAME = '15m'  # Options: '5m', '15m', '1h', etc.
  • Risk-Reward Ratio: Define the ratio for calculating TP and SL:
    RISK_REWARD_RATIO = 3.0
  • Enable Order Book Analysis: Optional feature for finer threshold adjustments:
    ENABLE_ORDER_BOOK_ANALYSIS = True

Usage

Run the bot:

python main.py

The bot will:

  1. Fetch data for top coins from the Bitget exchange.
  2. Analyze trends, volatility, and support/resistance proximity.
  3. Send Telegram notifications for detected opportunities.
  4. Save results to a CSV file.

Example Telegram Alert

📊 **Scalping Opportunity Detected**
**Timestamp**: 2024-12-21 18:34:12
**Asset**: BTCUSDT
**Current Price**: 20000.12345
**Support Zone**: 19800.54321
**Resistance Zone**: 20200.67890
**Direction**: Long
**Leverage**: 10x
**Take Profit**: 20250.54321
**Stop Loss**: 19750.12345
**ATR**: 150.54321
**Volume**: 1234567890.00
**Threshold**: 0.00500

Files and Structure

.
├── main.py               # Entry point of the bot
├── analyzer.py           # Analysis logic (volatility, trend detection, etc.)
├── data_fetcher.py       # Fetches OHLCV and order book data
├── telegram_notifier.py  # Sends Telegram alerts
├── utils.py              # Helper functions
├── config.py             # Configuration variables
├── requirements.txt      # Python dependencies
└── README.md             # Documentation

Troubleshooting

  • No Opportunities Found:
    • Check the TIMEFRAME and MIN_VOLUME_THRESHOLD settings in config.py.
  • Errors in Data Fetching:
    • Ensure the Bitget API is operational and your network connection is stable.
  • Telegram Not Sending Messages:
    • Verify your TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID in the .env file.

Future Enhancements

  • Add advanced machine learning models for better trend predictions.
  • Include multiple exchange support.
  • Implement real-time dashboards for live monitoring.

License

This project is licensed under the MIT License. See the LICENSE file for details.


About

Indicates and provides notifications for scalping opportunities.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages