Complete Technical Documentation

1. Signal Card Components Explained

Signal Header

  • BUY/SELL (Strength Level) - Direction and confidence level
  • Strength % - Overall signal strength from 0-100%
  • Color Coding: Green = BUY, Red = SELL, Gray = Neutral

Signal Strength Bar

  • 0-19% - Very Weak (Blue) - Ignore signal
  • 20-39% - Weak (Red/Orange) - Wait for confirmation
  • 40-59% - Moderate (Yellow) - Consider with caution
  • 60-79% - Strong (Light Green) - Good trading opportunity
  • 80-100% - Very Strong (Bright Green) - High confidence

2. Indicator Grid Explanation

RSI

Relative Strength Index

Measures overbought/oversold conditions

• <30: Oversold (Bullish)
• >70: Overbought (Bearish)

STOCH

Stochastic Oscillator

Measures momentum

• <20: Oversold
• >80: Overbought

MACD

Moving Average Convergence Divergence

Trend and momentum indicator

• ↑: Bullish momentum
• ↓: Bearish momentum

TREND

SMA Trend Direction

Price vs moving averages

• ↑: Bullish trend
• ↓: Bearish trend
• →: Neutral

BB

Bollinger Bands Position

Price volatility and position

• LOW: Below lower band
• HIGH: Above upper band
• MID: Between bands

3. TP/SL/RR Panel Explained

Take Profit (TP): Target price where you should take profits
Stop Loss (SL): Protective stop to limit losses
TP/SL Ratio: Risk-Reward ratio (Profit Potential ÷ Risk)

Calculation Formulas:
For BUY signals: TP = Resistance Level, SL = Support - (ATR × 1.2)
For SELL signals: TP = Support Level, SL = Resistance + (ATR × 1.2)
RR Ratio: |TP - Entry| ÷ |Entry - SL|
ATR: Average True Range (volatility measure)

4. Support & Resistance Levels

Support Level

Price level where buying interest is strong enough to overcome selling pressure. Acts as a price floor.

  • • Used as Take Profit for SELL signals
  • • Used as Stop Loss reference for BUY signals
  • • Calculated from swing lows and moving averages

Resistance Level

Price level where selling interest is strong enough to overcome buying pressure. Acts as a price ceiling.

  • • Used as Take Profit for BUY signals
  • • Used as Stop Loss reference for SELL signals
  • • Calculated from swing highs and moving averages

Complete System Algorithm

1. Data Collection & Processing

1.1. Data Sources:
• Binance Public API - primary source
• Endpoints:
  → /api/v3/ticker/24hr - current prices and changes
  → /api/v3/klines - historical data (candles)

1.2. Request Parameters:
• Symbol: BTCUSDT, ETHUSDT, etc.
• Timeframe: M5, M15, H1, H4, D1, W1
• Limit: 150 candles
• Frequency: Price updates every 15 seconds

2. Technical Indicators Calculation

2.1. RSI (Relative Strength Index):
• Period: 14
• Formula: RSI = 100 - (100 / (1 + RS))
• RS = Average Gain / Average Loss
• Average Gain = Σ(Gains) / Period
• Average Loss = Σ(Losses) / Period
• Interpretation: <30 = Oversold, >70 = Overbought

2.2. MACD (Moving Average Convergence Divergence):
• EMA12 = Exponential Moving Average (12 periods)
• EMA26 = Exponential Moving Average (26 periods)
• MACD Line = EMA12 - EMA26
• Signal Line = EMA9 of MACD Line
• Histogram = MACD Line - Signal Line
• Bullish: MACD Line > 0 & Histogram > 0
• Bearish: MACD Line < 0 & Histogram < 0

2.3. Stochastic Oscillator:
• Period: 14
• %K = ((Current Close - Lowest Low) / (Highest High - Lowest Low)) × 100
• %D = 3-period SMA of %K
• Interpretation: <20 = Oversold, >80 = Overbought

2.4. Bollinger Bands:
• Period: 20, Standard Deviation: 2
• Middle Band = 20-period SMA
• Upper Band = Middle Band + (2 × Standard Deviation)
• Lower Band = Middle Band - (2 × Standard Deviation)
• Interpretation: Price near lower band = oversold, near upper band = overbought

2.5. Trend Detection (SMA):
• SMA20 = 20-period Simple Moving Average
• SMA50 = 50-period Simple Moving Average
• Bullish Trend: Price > SMA20 & SMA20 > SMA50
• Bearish Trend: Price < SMA20 & SMA20 < SMA50
• Neutral: Mixed signals

3. Weighted Signal Strength Calculation

3.1. Weight Calculation for Each Indicator:

RSI Weight (0-1 scale):
if RSI < 50: buyWeight = (50 - RSI) / 50
if RSI > 50: sellWeight = (RSI - 50) / 50
Example: RSI=30 → buyWeight = (50-30)/50 = 0.40

Stochastic Weight (0-1 scale):
if Stochastic < 50: buyWeight = (50 - Stochastic) / 50
if Stochastic > 50: sellWeight = (Stochastic - 50) / 50
Example: Stochastic=20 → buyWeight = (50-20)/50 = 0.60

MACD Weight (0-1 scale):
if bullish: weight = min(|MACD Line|×10 + |Histogram|×20, 1)
if bearish: weight = min(|MACD Line|×10 + |Histogram|×20, 1)
Example: MACD=0.02, Histogram=0.01 → weight = min(0.02×10 + 0.01×20, 1) = 0.40

Bollinger Bands Weight (0-1 scale):
if price < lowerBB: buyWeight = min(|price - lowerBB| / (BB Range × 0.5), 1)
if price > upperBB: sellWeight = min(|price - upperBB| / (BB Range × 0.5), 1)
Example: Price=$100, lowerBB=$95, BB Range=$10 → buyWeight = min(|100-95|/(10×0.5), 1) = 1.0

Trend Weight:
Bullish trend: +0.5 to buyStrength
Bearish trend: +0.5 to sellStrength
Neutral: +0 to both

3.2. Net Strength Calculation:
totalBuyStrength = Σ(buyWeights from 5 indicators)
totalSellStrength = Σ(sellWeights from 5 indicators)
net = totalBuyStrength - totalSellStrength
maxPossibleNet = 3.0 (5 indicators × max 0.6 each)

3.3. Final Signal Strength (0-100%):
absoluteNet = |net|
strength = (absoluteNet / maxPossibleNet) × 100
strength = clamp(0, 100, round(strength))

3.4. Signal Direction Determination:
if net > 0.1: signal = "BUY"
if net < -0.1: signal = "SELL"
else: signal = "NEUTRAL"

3.5. Strength Level Classification:
if strength ≥ 80: level = "VERY STRONG"
if strength ≥ 60: level = "STRONG"
if strength ≥ 40: level = "MODERATE"
if strength ≥ 20: level = "WEAK"
else: level = "VERY WEAK"

4. Support & Resistance Levels

4.1. Swing Point Detection:
• Window size: 7 periods
• Swing High: Price higher than 7 periods before and after
• Swing Low: Price lower than 7 periods before and after
• Filter duplicates and keep unique levels

4.2. Level Selection:
• Support: Highest swing low below current price
• Resistance: Lowest swing high above current price
• Fallback: If no swing points found, use SMA20/SMA50
• Adjustment: Ensure levels are not too close to current price

4.3. ATR (Average True Range) Calculation:
• Period: 14
• True Range = max(High-Low, |High-PrevClose|, |Low-PrevClose|)
• ATR = SMA of True Ranges
• Used for stop loss buffer calculation

5. Take Profit & Stop Loss Calculation

5.1. For BUY Signals:
• Take Profit (TP) = Resistance Level
• Stop Loss (SL) = Support Level - (ATR × 1.2)
• If strength > 80: TP = TP + (ATR × 0.5) // Extended TP

5.2. For SELL Signals:
• Take Profit (TP) = Support Level
• Stop Loss (SL) = Resistance Level + (ATR × 1.2)
• If strength > 80: TP = TP - (ATR × 0.5) // Extended TP

5.3. Risk-Reward Ratio:
• For BUY: RR = (TP - Entry) / (Entry - SL)
• For SELL: RR = (Entry - TP) / (SL - Entry)
• Minimum acceptable RR: 1:1.5

5.4. Percentage Calculations:
• TP% = ((TP - Entry) / Entry) × 100
• SL% = ((Entry - SL) / Entry) × 100
• For SELL signals, formulas are inverted

6. Complete Algorithm Sequence

Step-by-Step Execution:

1. INITIALIZATION:
• User selects cryptocurrency pair
• User selects timeframe (M5-W1)
• Click "GET SIGNAL" button

2. DATA FETCHING:
• Fetch current price from Binance API
• Fetch 150 historical candles for selected timeframe
• Validate data integrity and completeness

3. INDICATOR CALCULATION:
• Calculate RSI (14 period)
• Calculate MACD (12,26,9)
• Calculate Stochastic (14 period)
• Calculate Bollinger Bands (20,2)
• Calculate SMA20 and SMA50 for trend
• Calculate ATR (14 period)

4. SUPPORT/RESISTANCE IDENTIFICATION:
• Detect swing highs and swing lows
• Identify nearest support and resistance levels
• Apply fallback calculations if needed

5. WEIGHTED SIGNAL GENERATION:
• Calculate weights for each indicator (0-1 scale)
• Sum buy weights and sell weights separately
• Calculate net strength
• Convert to percentage (0-100%)
• Determine signal direction (BUY/SELL/NEUTRAL)
• Classify strength level (VERY WEAK to VERY STRONG)

6. TP/SL CALCULATION:
• Calculate Take Profit based on resistance/support
• Calculate Stop Loss with ATR buffer
• Adjust TP for strong signals (>80%)
• Calculate Risk-Reward ratio
• Calculate percentage gains/losses

7. RESULT DISPLAY:
• Display signal with direction and strength level
• Show strength percentage with colored progress bar
• Display indicator grid with values and weights
• Show calculated TP, SL, and RR
• Display support and resistance levels
• Show warning for weak signals (<40%)

8. UPDATE CYCLE:
• Prices update automatically every 15 seconds
• Signals regenerate only on user request
• Historical data updates with each new signal
• Real-time price changes trigger visual updates

7. Visual Display Components

Signal Display

  • Signal Header: BUY/SELL (STRENGTH LEVEL)
  • Strength %: 0-100% in colored badge
  • Progress Bar: Visual strength representation
  • Strength Text: Very Weak to Very Strong
  • Color Coding: Green=BUY, Red=SELL, Gray=NEUTRAL

Indicator Grid

  • 5 Indicators: RSI, Stochastic, MACD, Trend, BB
  • Current Value: Numerical value
  • Weight Value: Contribution to signal (0.00-1.00)
  • Color Badges: Visual state indication
  • Direction Arrows: Up/down/neutral

TP/SL Panel

  • Take Profit: Target price with percentage gain
  • Stop Loss: Protective price with percentage loss
  • RR Ratio: Risk-Reward ratio (1:X format)
  • Level Source: Support/Resistance reference
  • ATR Buffer: Stop loss adjustment factor

Support/Resistance

  • Support Level: Price floor calculation
  • Resistance Level: Price ceiling calculation
  • Swing Points: Based on historical price action
  • Fallback Levels: SMA20/SMA50 if no swing points
  • Real-time Updates: Based on latest data

8. Technical Specifications

System Performance:
• Response Time: <3 seconds for signal generation
• Accuracy: Weighted multi-indicator approach
• Reliability: Fallback calculations for edge cases
• Scalability: Handles 20+ cryptocurrency pairs
• Real-time: Price updates every 15 seconds

Algorithm Advantages:
• No single point of failure (5 independent indicators)
• Weighted system prevents false signals
• Dynamic TP/SL based on market volatility (ATR)
• Support/Resistance based on actual price action
• Clear strength classification for risk management

Risk Management Features:
• Automatic stop loss calculation
• Minimum 1:1.5 risk-reward ratio
• Strength-based position sizing recommendations
• Weak signal warnings (<40% strength)
• Extended TP for strong signals (>80% strength)

Complete Trading Strategy Guide

Signal Strength Interpretation

VERY WEAK (0-19%)

Ignore Signal

  • • No clear market direction
  • • Indicators show mixed signals
  • • Wait for stronger confirmation
  • • Do not enter trades

WEAK (20-39%)

Wait for Confirmation

  • • Slight directional bias
  • • Requires additional confirmation
  • • Consider smaller position size
  • • Wait for price action confirmation

MODERATE (40-59%)

Trade with Caution

  • • Clear directional bias
  • • Good for swing trading
  • • Use normal position size
  • • Set tight stop losses

STRONG (60-79%)

Good Trading Opportunity

  • • Strong directional momentum
  • • Multiple indicators aligned
  • • Suitable for day trading
  • • Consider full position size
  • • Follow TP/SL levels closely

VERY STRONG (80-100%)

High Confidence Signal

  • • Extremely strong momentum
  • • All indicators strongly aligned
  • • Best for trend following
  • • Consider scaling into position
  • • TP may be extended (ATR × 0.5)

Recommended Trading Strategy

Step-by-Step Trading Plan:

1. TIME FRAME SELECTION:
• Day Trading: M5, M15, H1
• Swing Trading: H4, D1
• Position Trading: D1, W1

2. SIGNAL CONFIRMATION:
• Wait for strength ≥40%
• Check indicator alignment (≥3 indicators in same direction)
• Verify with price action

3. POSITION SIZING:
• 0-19%: No position
• 20-39%: 25% of normal size
• 40-59%: 50% of normal size
• 60-79%: 75% of normal size
• 80-100%: 100% of normal size

4. RISK MANAGEMENT:
• Always use Stop Loss
• Target minimum 1:1.5 Risk-Reward ratio
• Maximum risk per trade: 1-2% of capital
• Take partial profits at resistance/support levels

5. EXIT STRATEGY:
• Take Profit at calculated levels
• Move Stop Loss to breakeven after 1:1 RR
• Consider trailing stop for strong trends
• Close if signal strength drops below 20%

Pro Trading Tips

Best Practices

  • • Combine signals with market structure analysis
  • • Check higher timeframe trends for context
  • • Avoid trading during major news events
  • • Monitor volume with price action
  • • Keep trading journal with signal results

Risk Management Rules

  • • Never risk more than 2% per trade
  • • Maximum 5 open positions at once
  • • Daily loss limit: 5% of capital
  • • Weekly loss limit: 15% of capital
  • • Take breaks after 3 consecutive losses