Trading Bot - Scheduled Analysis #2355
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Trading Bot - Scheduled Analysis | |
| on: | |
| schedule: | |
| # Run every 5 minutes | |
| - cron: '*/5 * * * *' | |
| # Also allow manual execution from the Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| analyze: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: π₯ Checkout code | |
| uses: actions/checkout@v4 | |
| - name: π Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| cache: 'pip' | |
| - name: π¦ Install dependencies | |
| run: | | |
| pip install --upgrade pip | |
| pip install -r requirements.txt | |
| # Restore previous state if available | |
| - name: π Restore previous state | |
| uses: actions/cache@v4 | |
| with: | |
| path: state.json | |
| key: bot-state-${{ github.run_id }} | |
| restore-keys: | | |
| bot-state- | |
| - name: π€ Run bot | |
| env: | |
| DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
| DISCORD_HEARTBEAT_WEBHOOK_URL: ${{ secrets.DISCORD_HEARTBEAT_WEBHOOK_URL }} | |
| SYMBOL: 'BTC/USDT' | |
| TIMEFRAME: '1h' | |
| SEND_HEARTBEAT: 'true' | |
| EXCHANGE: 'kraken' | |
| DATA_LIMIT: '500' | |
| VOLUME_RATIO_MIN: '0.5407937891295632' | |
| VOLUME_SPIKE_MIN: '1.1026184592922577' | |
| CHOP_NO_TRADE_MAX: '60.28066995245851' | |
| ATR_PCT_MIN: '0.004641066207750961' | |
| ATR_EXTREME_MULT: '2.453187924335694' | |
| RSI_MIN: '39' | |
| RSI_MAX: '61' | |
| ATR_STOP_MULT: '2.543960674312195' | |
| TP1_MULT: '1.8084477345639143' | |
| TP2_MULT: '2.9904745180499277' | |
| COOLDOWN_BARS: '7' | |
| COOLDOWN_BARS_SL: '32' | |
| TIME_STOP_BARS: '38' | |
| INITIAL_CAPITAL: '100' | |
| FEE_RATE: '0.0004' | |
| SLIPPAGE_BPS: '0.0002' | |
| HIST_EXCHANGE: 'binance' | |
| START_DATE: '2023-01-01' | |
| WARMUP_BARS: '220' | |
| LONG_ONLY: 'false' | |
| PLOT_TRADES: 'true' | |
| PLOT_DAYS: '60' | |
| PLOT_PATH: 'backtest_plot.png' | |
| PLOT_LABEL_TRADES: 'false' | |
| TEST_MODE: 'false' | |
| REQUIRE_STRUCTURE: 'false' | |
| REQUIRE_VWAP: 'false' | |
| REQUIRE_MACD: 'false' | |
| REQUIRE_VOLUME_SPIKE: 'true' | |
| run: | | |
| echo "π Starting analysis..." | |
| python main.py | |
| echo "β Analysis completed" | |
| # Save updated state | |
| - name: πΎ Save state | |
| uses: actions/cache/save@v4 | |
| if: always() | |
| with: | |
| path: state.json | |
| key: bot-state-${{ github.run_id }} |