### Example BUY Setup Analysis Source: https://github.com/yasinkuyu/binance-trader/blob/master/BOLLINGER_STRATEGY.md A sample calculation demonstrating how confidence scores are derived for a BUY signal. ```text Symbol: BTCUSDT Price: $42,500 Lower BB: $42,800 Middle BB: $43,500 Upper BB: $44,200 RSI: 28 Volume Ratio: 1.5x Analysis: ✅ Price below lower BB (+30) ✅ RSI oversold (+25) ✅ High volume (+20) ✅ Price well below band (+15) ━━━━━━━━━━━━━━━━━━ Total Confidence: 90% Signal: STRONG BUY ``` -------------------------------- ### Clone and Install Dependencies Source: https://github.com/yasinkuyu/binance-trader/blob/master/BOLLINGER_README.md Commands to clone the repository and install the required Python packages. ```bash git clone https://github.com/yasinkuyu/binance-trader.git cd binance-trader ``` ```bash pip install -r requirements.txt ``` -------------------------------- ### Quick Start Bollinger Strategy Source: https://github.com/yasinkuyu/binance-trader/blob/master/IMPLEMENTATION_SUMMARY.md Commands to initialize the environment, configure API credentials, run a backtest, and launch the live trader. ```bash # 1. Setup ./setup_bollinger.sh # 2. Configure API keys nano app/config.py # 3. Test ./run_bollinger_test.sh BTCUSDT 100 # 4. Live (when ready) python3 trader_bollinger.py --symbol BTCUSDT --amount 100 ``` -------------------------------- ### Build and run Docker container Source: https://github.com/yasinkuyu/binance-trader/blob/master/README.md Commands to build the Docker image and start the containerized application. ```bash docker build -t trader . docker run trader ``` -------------------------------- ### Install Requirements Source: https://github.com/yasinkuyu/binance-trader/blob/master/README.md Install the necessary requests library via pip. ```bash sudo pip install requests ``` -------------------------------- ### Run Bollinger Strategy with Different Risk Profiles Source: https://github.com/yasinkuyu/binance-trader/blob/master/BOLLINGER_STRATEGY.md Command-line examples for executing the strategy with conservative, balanced, and aggressive configurations. ```bash python trader_bollinger.py \ --symbol BTCUSDT \ --amount 100 \ --rsi_oversold 25 \ --rsi_overbought 75 \ --min_confidence 70 \ --risk_per_trade 1.0 \ --bb_stddev 2.5 ``` ```bash python trader_bollinger.py \ --symbol BTCUSDT \ --amount 100 \ --rsi_oversold 30 \ --rsi_overbought 70 \ --min_confidence 50 \ --risk_per_trade 2.0 \ --bb_stddev 2.0 ``` ```bash python trader_bollinger.py \ --symbol BTCUSDT \ --amount 100 \ --rsi_oversold 35 \ --rsi_overbought 65 \ --min_confidence 40 \ --risk_per_trade 3.0 \ --bb_stddev 1.5 ``` -------------------------------- ### Stop Loss Calculation Example Source: https://github.com/yasinkuyu/binance-trader/blob/master/BOLLINGER_STRATEGY.md A practical example showing the calculation of a stop loss price with specific input values. ```text Entry Price: $43,000 ATR: $500 Stop Loss: $43,000 - ($500 × 2) = $42,000 Risk per trade: $1,000 (2.3%) ``` -------------------------------- ### Recommended Beginner Configuration Source: https://github.com/yasinkuyu/binance-trader/blob/master/BOLLINGER_README.md A standard execution command for beginners using test mode. ```bash python trader_bollinger.py \ --symbol BTCUSDT \ --amount 100 \ --interval 5m \ --test_mode ``` -------------------------------- ### Configure API Credentials Source: https://github.com/yasinkuyu/binance-trader/blob/master/BOLLINGER_README.md Steps to set up the configuration file and define Binance API keys. ```bash cp app/config.sample.py app/config.py nano app/config.py ``` ```python api_key = 'your_binance_api_key_here' api_secret = 'your_binance_api_secret_here' ``` -------------------------------- ### Basic Configuration Parameters Source: https://github.com/yasinkuyu/binance-trader/blob/master/BOLLINGER_README.md Minimum required parameters for initializing the trading bot. ```bash --symbol BTCUSDT # Trading pair --amount 100 # Amount to trade (in USDT) ``` -------------------------------- ### Run balance module Source: https://github.com/yasinkuyu/binance-trader/blob/master/README.md Execute the balance script to check account balances. ```bash python balance.py ``` -------------------------------- ### Advanced Configuration Parameters Source: https://github.com/yasinkuyu/binance-trader/blob/master/BOLLINGER_README.md Full list of available parameters for fine-tuning strategy, risk management, and bot behavior. ```bash python trader_bollinger.py \ # Required --symbol BTCUSDT \ # Position sizing (choose one) --amount 100 \ # Amount in quote currency (recommended) --quantity 0.01 \ # Fixed quantity # Bollinger Bands --bb_period 20 \ # BB lookback period --bb_stddev 2.0 \ # Standard deviation multiplier # RSI --rsi_period 14 \ # RSI calculation period --rsi_oversold 30 \ # Oversold threshold --rsi_overbought 70 \ # Overbought threshold # Volume --volume_threshold 1.2 \ # Volume ratio for confirmation # Risk Management --stop_loss_atr 2.0 \ # Stop loss distance (ATR multiplier) --take_profit middle \ # Take profit: middle, upper, or % --risk_per_trade 2.0 \ # Risk per trade (% of balance) # Filters --min_bb_width 1.0 \ # Minimum volatility --max_bb_width 10.0 \ # Maximum volatility --min_confidence 50 \ # Minimum signal confidence # Data --interval 5m \ # Candlestick interval --kline_limit 100 \ # Historical candles to fetch # Bot Behavior --wait_time 10 \ # Seconds between cycles --max_trades 10 \ # Max trades before stopping (0=unlimited) --test_mode \ # Test mode (no real trades) --debug # Verbose logging ``` -------------------------------- ### Configure API Credentials Source: https://github.com/yasinkuyu/binance-trader/blob/master/README.md Insert your Binance API key and secret key into the config.py file to enable account access. ```python api_key = '' api_secret = '' ``` -------------------------------- ### Run the Trading Bot Source: https://github.com/yasinkuyu/binance-trader/blob/master/BOLLINGER_README.md Commands to execute the bot in test mode or live trading mode. ```bash python trader_bollinger.py --symbol BTCUSDT --amount 100 --test_mode ``` ```bash python trader_bollinger.py --symbol BTCUSDT --amount 100 ``` -------------------------------- ### Run Trading Module Source: https://github.com/yasinkuyu/binance-trader/blob/master/README.md Execute the trader script with specific market symbols and trading parameters. ```bash python trader.py --symbol XVGBTC ``` ```bash python trader.py --symbol XVGBTC --quantity 300 --profit 1.3 ``` ```bash python trader.py --symbol XVGBTC --amount 0.0022 --profit 3 ``` ```bash python trader.py --symbol XVGBTC --mode range --quantity 300 --buyprice 0.00000780 --sellprice 0.00000790 ``` ```bash python trader.py --symbol XVGBTC --mode range --amount 0.0022 --buyprice 0.00000780 --sellprice 0.00000790 ``` ```bash trader.py --symbol TBNBTC --quantity 50 --profit 3 trader.py --symbol NEOBTC --amount 0.1 --profit 1.1 trader.py --symbol ETHUSDT --quantity 0.3 --profit 1.5 ``` -------------------------------- ### Project File Structure Source: https://github.com/yasinkuyu/binance-trader/blob/master/IMPLEMENTATION_SUMMARY.md Visual representation of the project directory layout, including new strategy-specific files and existing components. ```text binance-trader/ ├── app/ │ ├── Indicators.py # NEW: Technical indicators library │ ├── BollingerStrategy.py # NEW: Strategy implementation │ ├── BollingerTradingBot.py # NEW: Trading bot engine │ ├── BinanceAPI.py # Existing: API wrapper │ ├── Orders.py # Existing: Order management │ ├── Database.py # Existing: Trade logging │ ├── Messages.py # Existing: Error messages │ ├── Analyze.py # Existing: (unused) │ ├── Trading.py # Existing: Original strategy │ └── config.sample.py # Existing: Config template │ ├── trader_bollinger.py # NEW: Main entry point ├── setup_bollinger.sh # NEW: Setup script ├── run_bollinger_test.sh # NEW: Test launcher ├── run_bollinger_live.sh # NEW: Live trading launcher │ ├── Dockerfile.bollinger # NEW: Docker image ├── docker-compose.bollinger.yml # NEW: Docker compose │ ├── BOLLINGER_README.md # NEW: User guide ├── BOLLINGER_STRATEGY.md # NEW: Strategy documentation ├── IMPLEMENTATION_SUMMARY.md # NEW: This file ├── requirements.txt # NEW: Dependencies │ ├── trader.py # Existing: Original bot ├── balance.py # Existing: Balance checker ├── README.md # Existing: Original docs └── Dockerfile # Existing: Original docker ``` -------------------------------- ### Configure Bollinger Trader Strategy Source: https://github.com/yasinkuyu/binance-trader/blob/master/IMPLEMENTATION_SUMMARY.md Run the Bollinger band trading script with specific risk profiles. Adjust parameters like symbol, interval, and risk per trade to match your strategy. ```bash python3 trader_bollinger.py \ --symbol BTCUSDT --amount 100 \ --interval 15m \ --min_confidence 70 \ --risk_per_trade 1.0 \ --rsi_oversold 25 --rsi_overbought 75 ``` ```bash python3 trader_bollinger.py \ --symbol ETHUSDT --amount 100 \ --interval 5m \ --min_confidence 50 \ --risk_per_trade 2.0 ``` ```bash python3 trader_bollinger.py \ --symbol BNBUSDT --amount 200 \ --interval 3m \ --min_confidence 40 \ --risk_per_trade 3.0 \ --rsi_oversold 35 ``` -------------------------------- ### Calculate Position Size using Python Source: https://github.com/yasinkuyu/binance-trader/blob/master/BOLLINGER_STRATEGY.md Formula for determining position size based on account balance, risk percentage, and price risk. ```python Risk Amount = Account Balance × Risk Percentage Price Risk = Entry Price - Stop Loss Price Position Size = Risk Amount / Price Risk ``` -------------------------------- ### Risk Management and Monitoring Commands Source: https://github.com/yasinkuyu/binance-trader/blob/master/BOLLINGER_README.md Configuration flags for risk control and log monitoring. ```bash --risk_per_trade 2.0 # Maximum recommended ``` ```bash --amount 50 # Start with minimum viable amount ``` ```bash --test_mode # Always test before going live ``` ```bash --max_trades 5 # Limit daily trades while learning ``` ```bash tail -f bollinger_trader.log # Watch in real-time ``` -------------------------------- ### Volatility Threshold Configuration Source: https://github.com/yasinkuyu/binance-trader/blob/master/BOLLINGER_STRATEGY.md Adjusting the minimum Bollinger Band width parameter based on market volatility sessions. ```bash # Increase min_bb_width during Asian session --min_bb_width 2.0 # Decrease during high volatility (London/NY open) --min_bb_width 1.0 ``` -------------------------------- ### Simulated Backtesting Results Source: https://github.com/yasinkuyu/binance-trader/blob/master/BOLLINGER_STRATEGY.md Performance metrics for the Bollinger strategy based on a 3-month simulation on BTCUSDT using a 5-minute interval. ```text Total Trades: 127 Winning Trades: 78 (61.4%) Losing Trades: 49 (38.6%) Average Win: $185 Average Loss: $98 Profit Factor: 1.89 Max Drawdown: 8.3% Total Return: +24.7% ($2,470) Sharpe Ratio: 1.42 ``` -------------------------------- ### Run Bollinger Trading Strategies Source: https://github.com/yasinkuyu/binance-trader/blob/master/BOLLINGER_README.md Execute the trader script with specific parameters for different trading styles. ```bash # Low risk, high confidence required, larger timeframe python trader_bollinger.py \ --symbol BTCUSDT \ --amount 50 \ --interval 1h \ --min_confidence 70 \ --risk_per_trade 1.0 \ --rsi_oversold 25 \ --rsi_overbought 75 ``` ```bash # Recommended for most users python trader_bollinger.py \ --symbol ETHUSDT \ --amount 100 \ --interval 5m \ --min_confidence 50 \ --risk_per_trade 2.0 ``` ```bash # Higher frequency, lower confidence threshold python trader_bollinger.py \ --symbol BNBUSDT \ --amount 200 \ --interval 1m \ --min_confidence 40 \ --risk_per_trade 3.0 \ --rsi_oversold 35 \ --rsi_overbought 65 \ --bb_stddev 1.5 ``` ```bash # Perfect for learning without risking money python trader_bollinger.py \ --symbol BTCUSDT \ --amount 100 \ --test_mode \ --debug ``` ```bash # Terminal 1 python trader_bollinger.py --symbol BTCUSDT --amount 100 # Terminal 2 python trader_bollinger.py --symbol ETHUSDT --amount 50 # Terminal 3 python trader_bollinger.py --symbol ADAUSDT --amount 25 ``` -------------------------------- ### Multi-Timeframe Confirmation Logic Source: https://github.com/yasinkuyu/binance-trader/blob/master/BOLLINGER_STRATEGY.md Guidelines for checking higher timeframe trends to filter entry signals. ```bash # Check 15m for entry, 1h for trend direction # Only take longs in 1h uptrend # Only take shorts in 1h downtrend ``` -------------------------------- ### Git contribution workflow Source: https://github.com/yasinkuyu/binance-trader/blob/master/README.md Standard commands for contributing changes to the repository. ```bash git commit -m 'Add some feature' git push ``` -------------------------------- ### Access Application Logs Source: https://github.com/yasinkuyu/binance-trader/blob/master/BOLLINGER_README.md The primary log file used for troubleshooting and performance review. ```text bollinger_trader.log ``` -------------------------------- ### Import Dependencies Source: https://github.com/yasinkuyu/binance-trader/blob/master/README.md Required Python modules for the trader script. ```python import os import sys import time import config import argparse import threading import sqlite3 ``` -------------------------------- ### Monitor Performance Logs Source: https://github.com/yasinkuyu/binance-trader/blob/master/BOLLINGER_README.md Format for tracking trade statistics in the application logs. ```text 📊 Stats: X trades, Win rate: Y%, Total P/L: Z ``` -------------------------------- ### Monitor Bot Logs Source: https://github.com/yasinkuyu/binance-trader/blob/master/BOLLINGER_README.md Commands for real-time monitoring, error searching, and viewing recent activity in the log file. ```bash tail -f bollinger_trader.log ``` ```bash grep ERROR bollinger_trader.log ``` ```bash tail -100 bollinger_trader.log ``` -------------------------------- ### Define BUY Signal Logic Source: https://github.com/yasinkuyu/binance-trader/blob/master/IMPLEMENTATION_SUMMARY.md Logic for determining a BUY signal based on price, RSI, volume, and volatility thresholds. ```python IF price <= lower_band AND rsi < 30 (oversold) AND volume > average AND volatility in acceptable range THEN generate BUY with confidence score ``` -------------------------------- ### Calculate Position Sizing Source: https://github.com/yasinkuyu/binance-trader/blob/master/IMPLEMENTATION_SUMMARY.md Formula for determining position size based on account balance and risk percentage. ```text Risk Amount = Balance × Risk% Position Size = Risk Amount / (Entry - Stop Loss) ``` -------------------------------- ### Define SELL Signal Logic Source: https://github.com/yasinkuyu/binance-trader/blob/master/IMPLEMENTATION_SUMMARY.md Logic for determining a SELL signal based on take profit targets, overbought conditions, or stop loss triggers. ```python IF price >= take_profit_target (usually middle_band) OR price >= upper_band (overbought) OR price <= stop_loss THEN SELL ``` -------------------------------- ### Synchronize System Clock Source: https://github.com/yasinkuyu/binance-trader/blob/master/BOLLINGER_README.md Command to synchronize the system clock on Linux to resolve timestamp errors. ```bash sudo ntpdate -s time.nist.gov ``` -------------------------------- ### Dynamic ATR-based Stop Loss Formula Source: https://github.com/yasinkuyu/binance-trader/blob/master/BOLLINGER_STRATEGY.md The mathematical formula used to calculate the stop loss price based on ATR. ```text Stop Loss = Entry Price - (ATR × Multiplier) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.