Confidence Levels
Detailed guide to understanding confidence levels in AI trading signals, including how they're calculated, what they mean, and how to use them effectively.
Understanding Confidence Levels
What is Confidence?
Confidence is a numerical score (0-100) that represents the AI system's certainty in a trading signal's accuracy. It's calculated based on multiple factors including technical analysis alignment, sentiment consensus, volume confirmation, and model agreement.
Confidence Scale
Very High Confidence (90-100%)
Meaning: Extremely strong signal with high probability of success.
Characteristics:
- All technical indicators aligned
- Strong volume confirmation
- Clear sentiment direction
- Multiple timeframe agreement
- Low risk assessment
- Model consensus
Trading Implications:
- Position Size: 3-5% of portfolio
- Execution: Immediate
- Risk Management: Minimal overhead
- Conviction: Very high
Example:
{
"confidence": 94,
"breakdown": {
"technicalAlignment": 0.95,
"sentimentConsensus": 0.92,
"volumeConfirmation": 0.98,
"modelAgreement": 0.96,
"riskAssessment": 0.08
},
"reasoning": "All factors strongly aligned with minimal risk"
}
High Confidence (80-89%)
Meaning: Strong signal with good probability of success.
Characteristics:
- Most technical indicators aligned
- Good volume confirmation
- Clear sentiment direction
- Some timeframe agreement
- Low-medium risk assessment
Trading Implications:
- Position Size: 2-3% of portfolio
- Execution: Quick
- Risk Management: Standard
- Conviction: High
Example:
{
"confidence": 84,
"breakdown": {
"technicalAlignment": 0.88,
"sentimentConsensus": 0.82,
"volumeConfirmation": 0.85,
"modelAgreement": 0.89,
"riskAssessment": 0.25
},
"reasoning": "Strong alignment with moderate risk"
}
Medium Confidence (70-79%)
Meaning: Moderate signal with reasonable probability of success.
Characteristics:
- Majority of indicators aligned
- Moderate volume confirmation
- Generally clear sentiment
- Limited timeframe agreement
- Medium risk assessment
Trading Implications:
- Position Size: 1-2% of portfolio
- Execution: Normal
- Risk Management: Standard
- Conviction: Moderate
Example:
{
"confidence": 73,
"breakdown": {
"technicalAlignment": 0.75,
"sentimentConsensus": 0.68,
"volumeConfirmation": 0.72,
"modelAgreement": 0.78,
"riskAssessment": 0.45
},
"reasoning": "Good alignment with moderate risk"
}
Low Confidence (60-69%)
Meaning: Weak signal with uncertain probability of success.
Characteristics:
- Some indicators aligned
- Low volume confirmation
- Mixed sentiment
- Limited timeframe agreement
- Medium-high risk assessment
Trading Implications:
- Position Size: 0.5-1% of portfolio
- Execution: Careful
- Risk Management: Enhanced
- Conviction: Low
Example:
{
"confidence": 62,
"breakdown": {
"technicalAlignment": 0.65,
"sentimentConsensus": 0.55,
"volumeConfirmation": 0.58,
"modelAgreement": 0.68,
"riskAssessment": 0.65
},
"reasoning": "Mixed signals with higher risk"
}
Very Low Confidence (40-59%)
Meaning: Very weak signal with low probability of success.
Characteristics:
- Few indicators aligned
- Very low volume
- Conflicting sentiment
- No timeframe agreement
- High risk assessment
Trading Implications:
- Position Size: 0.25-0.5% of portfolio
- Execution: Very careful
- Risk Management: Maximum
- Conviction: Very low
Example:
{
"confidence": 48,
"breakdown": {
"technicalAlignment": 0.45,
"sentimentConsensus": 0.42,
"volumeConfirmation": 0.38,
"modelAgreement": 0.52,
"riskAssessment": 0.85
},
"reasoning": "Conflicting signals with high risk"
}
No Confidence (0-39%)
Meaning: Signal should be ignored or avoided.
Characteristics:
- Conflicting indicators
- No volume confirmation
- Negative sentiment
- No timeframe agreement
- Very high risk assessment
Trading Implications:
- Position Size: 0% of portfolio
- Execution: Avoid
- Risk Management: N/A
- Conviction: None
Example:
{
"confidence": 28,
"breakdown": {
"technicalAlignment": 0.25,
"sentimentConsensus": 0.18,
"volumeConfirmation": 0.22,
"modelAgreement": 0.35,
"riskAssessment": 0.95
},
"reasoning": "Strongly conflicting signals with very high risk"
}
Confidence Calculation
Weighted Factors
The confidence score is calculated using a weighted combination of multiple factors:
def calculate_confidence(factors):
weights = {
'technical_alignment': 0.30,
'sentiment_consensus': 0.25,
'volume_confirmation': 0.20,
'model_agreement': 0.15,
'risk_assessment': 0.10
}
base_confidence = sum(factors[factor] * weight
for factor, weight in weights.items())
# Apply confidence modifiers
confidence = apply_modifiers(base_confidence, factors)
return min(max(confidence, 0), 100)
Factor Breakdown
Technical Alignment (30% Weight)
Description: How well technical indicators align with the signal direction.
Calculation:
def calculate_technical_alignment(symbol, signal_direction):
indicators = [
'rsi', 'macd', 'moving_averages', 'bollinger_bands',
'stochastic', 'williams_r', 'cci', 'adx'
]
aligned_indicators = 0
total_indicators = len(indicators)
for indicator in indicators:
if is_aligned(indicator, signal_direction):
aligned_indicators += 1
return aligned_indicators / total_indicators
Example:
{
"technicalAlignment": 0.875,
"alignedIndicators": 7,
"totalIndicators": 8,
"details": {
"rsi": "aligned",
"macd": "aligned",
"moving_averages": "aligned",
"bollinger_bands": "aligned",
"stochastic": "aligned",
"williams_r": "aligned",
"cci": "aligned",
"adx": "not_aligned"
}
}
Sentiment Consensus (25% Weight)
Description: Agreement across different sentiment sources.
Calculation:
def calculate_sentiment_consensus(symbol):
sources = ['social_media', 'news', 'market_sentiment', 'community']
sentiments = [get_sentiment(symbol, source) for source in sources]
# Calculate consensus as agreement level
consensus = 1 - (max(sentiments) - min(sentiments))
return max(0, consensus)
Example:
{
"sentimentConsensus": 0.82,
"sources": {
"social_media": 0.78,
"news": 0.85,
"market_sentiment": 0.8,
"community": 0.83
},
"range": 0.07,
"consensus": "high"
}
Volume Confirmation (20% Weight)
Description: How well volume supports the signal direction.
Calculation:
def calculate_volume_confirmation(symbol, signal_direction):
current_volume = get_current_volume(symbol)
average_volume = get_average_volume(symbol, 20)
volume_ratio = current_volume / average_volume
# Volume confirmation based on ratio and direction
if signal_direction == 'buy':
if volume_ratio >= 1.5:
return 1.0
elif volume_ratio >= 1.2:
return 0.8
elif volume_ratio >= 1.0:
return 0.6
else:
return 0.3
else: # sell signal
if volume_ratio >= 1.5:
return 1.0
elif volume_ratio >= 1.2:
return 0.8
elif volume_ratio >= 1.0:
return 0.6
else:
return 0.3
Example:
{
"volumeConfirmation": 0.85,
"currentVolume": 1250000,
"averageVolume": 800000,
"volumeRatio": 1.56,
"confirmation": "strong"
}
Model Agreement (15% Weight)
Description: Agreement between different AI models.
Calculation:
def calculate_model_agreement(symbol, signal_direction):
models = ['lstm', 'cnn', 'random_forest', 'xgboost', 'transformer']
predictions = [model.predict(symbol) for model in models]
# Count models agreeing with signal direction
agreeing_models = sum(1 for pred in predictions
if pred.direction == signal_direction)
return agreeing_models / len(models)
Example:
{
"modelAgreement": 0.8,
"agreeingModels": 4,
"totalModels": 5,
"modelPredictions": {
"lstm": "buy",
"cnn": "buy",
"random_forest": "buy",
"xgboost": "buy",
"transformer": "hold"
}
}
Risk Assessment (10% Weight)
Description: Risk level of the signal (inverted - lower risk = higher confidence).
Calculation:
def calculate_risk_assessment(symbol):
risk_factors = {
'volatility': get_volatility(symbol),
'liquidity': get_liquidity(symbol),
'correlation': get_correlation(symbol),
'market_conditions': get_market_conditions()
}
# Combine risk factors
risk_score = sum(risk_factors.values()) / len(risk_factors)
# Convert to confidence (inverted)
return 1 - risk_score
Example:
{
"riskAssessment": 0.75,
"riskFactors": {
"volatility": 0.15,
"liquidity": 0.2,
"correlation": 0.1,
"market_conditions": 0.25
},
"overallRisk": 0.25
}
Confidence Modifiers
Positive Modifiers
High Volume Confirmation (+5-10 points)
if volume_ratio >= 2.0:
confidence += 10
elif volume_ratio >= 1.5:
confidence += 7
elif volume_ratio >= 1.2:
confidence += 5
Multiple Timeframe Alignment (+5-15 points)
timeframes = ['1h', '4h', '1d', '1w']
aligned_timeframes = count_aligned_timeframes(signal)
confidence += min(aligned_timeframes * 3, 15)
Strong Sentiment Consensus (+3-8 points)
if sentiment_consensus >= 0.9:
confidence += 8
elif sentiment_consensus >= 0.8:
confidence += 5
elif sentiment_consensus >= 0.7:
confidence += 3
Model Agreement (+2-5 points)
if model_agreement >= 0.9:
confidence += 5
elif model_agreement >= 0.8:
confidence += 3
elif model_agreement >= 0.7:
confidence += 2
Negative Modifiers
Low Volume (-5-10 points)
if volume_ratio < 0.8:
confidence -= 10
elif volume_ratio < 1.0:
confidence -= 5
Conflicting Signals (-10-20 points)
if technical_alignment < 0.5:
confidence -= 20
elif technical_alignment < 0.6:
confidence -= 15
elif technical_alignment < 0.7:
confidence -= 10
High Volatility (-3-8 points)
if volatility > 0.8:
confidence -= 8
elif volatility > 0.6:
confidence -= 5
elif volatility > 0.4:
confidence -= 3
Market Uncertainty (-5-15 points)
if market_uncertainty > 0.8:
confidence -= 15
elif market_uncertainty > 0.6:
confidence -= 10
elif market_uncertainty > 0.4:
confidence -= 5
Confidence Validation
Historical Accuracy
Accuracy by Confidence Level
{
"confidenceLevels": {
"90-100": {
"accuracy": 0.87,
"sampleSize": 1250,
"averageReturn": 0.068,
"sharpeRatio": 1.85
},
"80-89": {
"accuracy": 0.78,
"sampleSize": 2100,
"averageReturn": 0.045,
"sharpeRatio": 1.42
},
"70-79": {
"accuracy": 0.68,
"sampleSize": 1850,
"averageReturn": 0.032,
"sharpeRatio": 1.15
},
"60-69": {
"accuracy": 0.58,
"sampleSize": 1200,
"averageReturn": 0.018,
"sharpeRatio": 0.85
},
"40-59": {
"accuracy": 0.45,
"sampleSize": 800,
"averageReturn": 0.008,
"sharpeRatio": 0.52
}
}
}
Confidence Calibration
Calibration Metrics
def calculate_calibration_metrics(predictions, outcomes):
# Group predictions by confidence level
confidence_groups = {}
for pred, outcome in zip(predictions, outcomes):
conf_level = get_confidence_level(pred.confidence)
if conf_level not in confidence_groups:
confidence_groups[conf_level] = []
confidence_groups[conf_level].append(outcome)
# Calculate accuracy for each group
calibration = {}
for level, outcomes in confidence_groups.items():
accuracy = sum(outcomes) / len(outcomes)
calibration[level] = {
'predicted_accuracy': level / 100,
'actual_accuracy': accuracy,
'calibration_error': abs(level / 100 - accuracy)
}
return calibration
Using Confidence Levels
Position Sizing
Conservative Approach
def calculate_position_size(confidence, portfolio_value, risk_per_trade=0.02):
if confidence >= 90:
return portfolio_value * 0.03 # 3%
elif confidence >= 80:
return portfolio_value * 0.02 # 2%
elif confidence >= 70:
return portfolio_value * 0.015 # 1.5%
elif confidence >= 60:
return portfolio_value * 0.01 # 1%
else:
return portfolio_value * 0.005 # 0.5%
Moderate Approach
def calculate_position_size(confidence, portfolio_value, risk_per_trade=0.02):
if confidence >= 90:
return portfolio_value * 0.05 # 5%
elif confidence >= 80:
return portfolio_value * 0.03 # 3%
elif confidence >= 70:
return portfolio_value * 0.02 # 2%
elif confidence >= 60:
return portfolio_value * 0.015 # 1.5%
else:
return portfolio_value * 0.01 # 1%
Aggressive Approach
def calculate_position_size(confidence, portfolio_value, risk_per_trade=0.02):
if confidence >= 90:
return portfolio_value * 0.08 # 8%
elif confidence >= 80:
return portfolio_value * 0.05 # 5%
elif confidence >= 70:
return portfolio_value * 0.03 # 3%
elif confidence >= 60:
return portfolio_value * 0.02 # 2%
else:
return portfolio_value * 0.015 # 1.5%
Risk Management
Stop Loss Levels
def calculate_stop_loss(confidence, entry_price, signal_direction):
if confidence >= 90:
stop_distance = 0.02 # 2%
elif confidence >= 80:
stop_distance = 0.025 # 2.5%
elif confidence >= 70:
stop_distance = 0.03 # 3%
elif confidence >= 60:
stop_distance = 0.035 # 3.5%
else:
stop_distance = 0.04 # 4%
if signal_direction == 'buy':
return entry_price * (1 - stop_distance)
else:
return entry_price * (1 + stop_distance)
Take Profit Levels
def calculate_take_profit(confidence, entry_price, signal_direction):
if confidence >= 90:
profit_distance = 0.06 # 6%
elif confidence >= 80:
profit_distance = 0.05 # 5%
elif confidence >= 70:
profit_distance = 0.04 # 4%
elif confidence >= 60:
profit_distance = 0.035 # 3.5%
else:
profit_distance = 0.03 # 3%
if signal_direction == 'buy':
return entry_price * (1 + profit_distance)
else:
return entry_price * (1 - profit_distance)
Best Practices
Confidence-Based Trading
High Confidence Signals
- Use for: Major position entries
- Execution: Immediate
- Risk Management: Standard
- Monitoring: Regular check-ins
Medium Confidence Signals
- Use for: Standard position entries
- Execution: Normal speed
- Risk Management: Standard
- Monitoring: Regular check-ins
Low Confidence Signals
- Use for: Small position entries
- Execution: Careful
- Risk Management: Enhanced
- Monitoring: Frequent check-ins
Confidence Monitoring
Track Performance
- Monitor accuracy by confidence level
- Track returns by confidence level
- Identify optimal confidence thresholds
- Adjust strategy based on results
Continuous Improvement
- Analyze failed high-confidence signals
- Identify patterns in low-confidence successes
- Refine confidence calculation
- Update position sizing rules
Ready to explore custom models? Check out our Custom Models guide.