Skip to main content
Skip to main content
Version: Next 🚧

How to Configure Risk Parameters

Problem

You need to define risk limits to protect your capital and ensure you trade within your risk tolerance. Proper risk parameters prevent catastrophic losses and help maintain long-term profitability.

Prerequisites

  • Basic algorithm configuration completed (Step 1)
  • Position sizing configured (Step 2)
  • Entry and exit conditions configured (Steps 3-4)
  • Understanding of your risk tolerance

Risk Parameters Overview

{
"riskParameters": {
"maxPositionSize": 10.0,
"stopLoss": 2.0,
"takeProfit": 4.0,
"maxDailyLoss": 50000,
"maxOpenPositions": 5,
"riskRewardRatio": 2.0
}
}

Maximum Position Size

Limits the percentage of capital allocated to a single position.

Configuration

{
"riskParameters": {
"maxPositionSize": 10.0 // 10% of account
}
}

How It Works

Prevents over-concentration in a single position, regardless of position sizing method.

Example:

Account: ₹10,00,000 Max Position Size: 10% Maximum Allowed: ₹1,00,000

Scenario 1: Within Limit

  • Position sizing calculates: ₹80,000
  • Max position size: ₹1,00,000
  • ✅ Trade executes with ₹80,000

Scenario 2: Exceeds Limit

  • Position sizing calculates: ₹1,50,000
  • Max position size: ₹1,00,000
  • ⚠️ Trade executes with ₹1,00,000 (capped)
Risk ProfileMax Position SizeUse Case
Conservative2-5%Capital preservation
Moderate5-10%Balanced approach
Aggressive10-20%Growth-focused
Very Aggressive20-30%High risk tolerance

Professional Recommendation: 5-10% for most traders

Account Size Considerations

Small Account (< ₹5,00,000):

{
"maxPositionSize": 15.0 // Can be higher due to limited diversification
}

Medium Account (₹5,00,000 - ₹50,00,000):

{
"maxPositionSize": 10.0 // Standard recommendation
}

Large Account (> ₹50,00,000):

{
"maxPositionSize": 5.0 // More conservative, better diversification
}

Interaction with Position Sizing

Max position size acts as a cap on all position sizing methods:

Percentage-Based:

{
"positionSizing": {
"method": "percentage",
"percentage": 15.0 // Wants 15%
},
"riskParameters": {
"maxPositionSize": 10.0 // Caps at 10%
}
}

Result: Position will be 10% (capped)

Risk-Based:

{
"positionSizing": {
"method": "risk_based",
"riskPercentage": 2.0
},
"riskParameters": {
"maxPositionSize": 10.0,
"stopLoss": 1.0 // Tight stop = large position
}
}

If calculated position exceeds 10%, it will be capped.

Stop Loss Percentage

Required stop loss for all trades (used in risk-based position sizing).

Configuration

{
"riskParameters": {
"stopLoss": 2.0 // 2% stop loss
}
}

How It Works

For Risk-Based Position Sizing: Used to calculate position size based on risk amount.

Position Size = (Account × Risk%) / Stop Loss%

Example:

  • Account: ₹10,00,000
  • Risk: 1%
  • Stop Loss: 2%
  • Position Size: (₹10,00,000 × 1%) / 2% = ₹50,000

For Other Position Sizing Methods: Acts as a guideline and validation check.

VolatilityStop Loss %Use Case
Low1-2%Large caps, stable stocks
Medium2-3%Mid caps, normal volatility
High3-5%Small caps, volatile stocks
Very High5-10%Penny stocks, crypto

Strategy-Specific Recommendations

Scalping:

{
"stopLoss": 0.5 // 0.5% - tight stops
}

Day Trading:

{
"stopLoss": 1.5 // 1.5% - moderate stops
}

Swing Trading:

{
"stopLoss": 3.0 // 3% - wider stops
}

Position Trading:

{
"stopLoss": 5.0 // 5% - very wide stops
}

Validation

System validates that stop loss is reasonable:

{
"stopLoss": 0.1 // ⚠️ Too tight (< 0.5%)
}
{
"stopLoss": 50.0 // ⚠️ Too wide (> 50%)
}

Valid Range: 0.1% - 50%

Take Profit Percentage

Optional take profit target (used with risk-reward ratio).

Configuration

{
"riskParameters": {
"takeProfit": 4.0 // 4% take profit
}
}

How It Works

With Risk-Reward Ratio:

{
"riskParameters": {
"stopLoss": 2.0,
"riskRewardRatio": 2.0
}
}

Take Profit = 2% × 2.0 = 4%

Explicit Take Profit:

{
"riskParameters": {
"stopLoss": 2.0,
"takeProfit": 6.0 // Explicit 6% target
}
}
StrategyTake Profit %Holding Period
Scalping0.5-1%Minutes
Day Trading2-4%Hours
Swing Trading5-10%Days
Position Trading15-30%Weeks/Months

Relationship with Stop Loss

Conservative (1:1):

{
"stopLoss": 2.0,
"takeProfit": 2.0 // Equal risk-reward
}

Moderate (1:2):

{
"stopLoss": 2.0,
"takeProfit": 4.0 // Double reward
}

Aggressive (1:3):

{
"stopLoss": 2.0,
"takeProfit": 6.0 // Triple reward
}

Maximum Daily Loss

Circuit breaker that pauses algorithm after reaching daily loss limit.

Configuration

{
"riskParameters": {
"maxDailyLoss": 50000 // ₹50,000 daily loss limit
}
}

How It Works

  1. Tracking: System tracks P&L from midnight (00:00 IST)
  2. Calculation: Includes realized + unrealized losses
  3. Trigger: When daily loss reaches limit
  4. Action: Algorithm automatically pauses
  5. Reset: Resets at midnight for next trading day

Example:

Account: ₹10,00,000 Max Daily Loss: ₹50,000 (5% of account)

TimeTradeP&LCumulativeStatus
09:30Trade 1-₹15,000-₹15,000✅ Active
11:00Trade 2-₹20,000-₹35,000✅ Active
13:00Trade 3-₹18,000-₹53,000⛔ Paused!

Algorithm pauses and won't take new trades until next day.

Risk ProfileDaily Loss %Daily Loss Amount
Conservative1-2%₹10,000 - ₹20,000 (₹10L account)
Moderate2-5%₹20,000 - ₹50,000 (₹10L account)
Aggressive5-10%₹50,000 - ₹1,00,000 (₹10L account)

Professional Recommendation: 2-3% of account

Account Size Examples

Small Account (₹5,00,000):

{
"maxDailyLoss": 10000 // 2% of account
}

Medium Account (₹10,00,000):

{
"maxDailyLoss": 30000 // 3% of account
}

Large Account (₹50,00,000):

{
"maxDailyLoss": 100000 // 2% of account
}

Circuit Breaker System

Automatic Actions:

  1. Pause algorithm
  2. Close all open positions (optional)
  3. Send notification
  4. Log event
  5. Prevent new entries

Configuration:

{
"riskParameters": {
"maxDailyLoss": 50000,
"circuitBreaker": {
"closePositions": false, // Keep positions open
"notifyUser": true,
"preventNewEntries": true
}
}
}

Multiple Algorithms

Daily loss is tracked per algorithm, not portfolio-wide.

Algorithm 1:

{
"maxDailyLoss": 30000
}

Algorithm 2:

{
"maxDailyLoss": 20000
}

Total Portfolio Risk: ₹50,000

For portfolio-wide limits, see Portfolio Risk Management.

Maximum Open Positions

Limits the number of simultaneous open positions.

Configuration

{
"riskParameters": {
"maxOpenPositions": 5 // Maximum 5 positions at once
}
}

How It Works

Example:

Max Open Positions: 3

TimeActionOpen PositionsStatus
09:30Buy RELIANCE1✅ Executed
10:00Buy TCS2✅ Executed
11:00Buy INFY3✅ Executed
12:00Buy HDFC3⛔ Blocked (limit reached)
13:00Sell RELIANCE2Position closed
14:00Buy HDFC3✅ Executed (slot available)
StrategyMax PositionsReason
Focused1-3Deep analysis, high conviction
Balanced3-5Diversification, manageable
Diversified5-10Spread risk, more opportunities
Portfolio10-20Full diversification

Professional Recommendation: 3-5 positions for most traders

Account Size Considerations

Small Account (< ₹5,00,000):

{
"maxOpenPositions": 2 // Limited capital
}

Medium Account (₹5,00,000 - ₹50,00,000):

{
"maxOpenPositions": 5 // Good diversification
}

Large Account (> ₹50,00,000):

{
"maxOpenPositions": 10 // Full diversification
}

Interaction with Position Sizing

Example:

Account: ₹10,00,000 Max Position Size: 10% Max Open Positions: 5

Maximum Total Exposure: 5 × 10% = 50% of account

This prevents over-leveraging while allowing diversification.

Strategy-Specific Settings

Scalping (High Frequency):

{
"maxOpenPositions": 1 // One at a time, quick in/out
}

Day Trading:

{
"maxOpenPositions": 3 // Few positions, active management
}

Swing Trading:

{
"maxOpenPositions": 5 // Multiple positions, less active
}

Position Trading:

{
"maxOpenPositions": 10 // Long-term holds, diversified
}

Risk-Reward Ratio

Minimum ratio of potential profit to potential loss.

Configuration

{
"riskParameters": {
"riskRewardRatio": 2.0 // Minimum 1:2 risk-reward
}
}

How It Works

Calculation:

Risk-Reward Ratio = Potential Profit / Potential Loss

Example:

Entry: ₹500 Stop Loss: ₹490 (2% loss = ₹10 risk) Take Profit: ₹520 (4% profit = ₹20 reward) Risk-Reward: ₹20 / ₹10 = 2.0 (1:2 ratio)

Minimum Ratio Enforcement

{
"riskRewardRatio": 2.0 // Minimum 1:2
}

Trade Validation:

Scenario 1: Meets Requirement

  • Risk: ₹10
  • Reward: ₹25
  • Ratio: 2.5
  • ✅ Trade allowed

Scenario 2: Doesn't Meet Requirement

  • Risk: ₹10
  • Reward: ₹15
  • Ratio: 1.5
  • ⛔ Trade blocked
Win RateMin RatioBreakevenUse Case
60%+1:140% win rateHigh probability
50%1:1.540% win rateBalanced
40%1:233% win rateStandard
30%1:325% win rateTrend-following
20%1:420% win rateHome runs

Breakeven Win Rate Calculation

Breakeven Win Rate = 1 / (1 + Risk-Reward Ratio)

Examples:

1:1 Ratio:

  • Breakeven: 1 / (1 + 1) = 50%
  • Need 50% win rate to break even

1:2 Ratio:

  • Breakeven: 1 / (1 + 2) = 33.3%
  • Need 33.3% win rate to break even

1:3 Ratio:

  • Breakeven: 1 / (1 + 3) = 25%
  • Need 25% win rate to break even

Strategy Profitability

Example 1: High Win Rate, Low Ratio

  • Win Rate: 60%
  • Risk-Reward: 1:1
  • Avg Win: ₹10,000
  • Avg Loss: ₹10,000
  • Expected Value: (0.6 × ₹10,000) - (0.4 × ₹10,000) = ₹2,000 per trade

Example 2: Low Win Rate, High Ratio

  • Win Rate: 30%
  • Risk-Reward: 1:3
  • Avg Win: ₹30,000
  • Avg Loss: ₹10,000
  • Expected Value: (0.3 × ₹30,000) - (0.7 × ₹10,000) = ₹2,000 per trade

Both are equally profitable!

Automatic Take Profit Calculation

{
"riskParameters": {
"stopLoss": 2.0,
"riskRewardRatio": 2.0
}
}

System automatically calculates:

  • Take Profit = 2% × 2.0 = 4%

Complete Risk Parameter Examples

Example 1: Conservative Profile

{
"riskParameters": {
"maxPositionSize": 5.0,
"stopLoss": 1.5,
"takeProfit": 4.5,
"maxDailyLoss": 20000,
"maxOpenPositions": 3,
"riskRewardRatio": 3.0
}
}

Profile:

  • Small positions (5%)
  • Tight stops (1.5%)
  • High risk-reward (1:3)
  • Low daily loss limit (2% of ₹10L account)
  • Few positions (3)

Expected Drawdown: 5-10% Suitable For: Risk-averse traders, beginners

Example 2: Moderate Profile

{
"riskParameters": {
"maxPositionSize": 10.0,
"stopLoss": 2.0,
"takeProfit": 4.0,
"maxDailyLoss": 50000,
"maxOpenPositions": 5,
"riskRewardRatio": 2.0
}
}

Profile:

  • Standard positions (10%)
  • Moderate stops (2%)
  • Balanced risk-reward (1:2)
  • Moderate daily loss limit (5% of ₹10L account)
  • Balanced positions (5)

Expected Drawdown: 10-20% Suitable For: Most traders, balanced approach

Example 3: Aggressive Profile

{
"riskParameters": {
"maxPositionSize": 20.0,
"stopLoss": 3.0,
"takeProfit": 6.0,
"maxDailyLoss": 100000,
"maxOpenPositions": 10,
"riskRewardRatio": 2.0
}
}

Profile:

  • Large positions (20%)
  • Wide stops (3%)
  • Standard risk-reward (1:2)
  • High daily loss limit (10% of ₹10L account)
  • Many positions (10)

Expected Drawdown: 20-30% Suitable For: Experienced traders, high risk tolerance

Portfolio Risk Management

Multiple Algorithms

When running multiple algorithms, consider total portfolio risk:

Algorithm 1 (Scalping):

{
"maxPositionSize": 5.0,
"maxDailyLoss": 20000,
"maxOpenPositions": 2
}

Algorithm 2 (Swing Trading):

{
"maxPositionSize": 10.0,
"maxDailyLoss": 30000,
"maxOpenPositions": 5
}

Total Portfolio Risk:

  • Max Daily Loss: ₹50,000
  • Max Open Positions: 7
  • Max Exposure: (2 × 5%) + (5 × 10%) = 60%

Correlation Considerations

Avoid Over-Concentration:

Bad Example:

  • Algorithm 1: Trading NIFTY stocks
  • Algorithm 2: Trading BANKNIFTY stocks
  • Algorithm 3: Trading NIFTY futures
  • Problem: All correlated, no diversification

Good Example:

  • Algorithm 1: Trading equities
  • Algorithm 2: Trading commodities
  • Algorithm 3: Trading currencies
  • Benefit: Diversified, uncorrelated

Portfolio-Wide Limits

Set limits across all algorithms:

{
"portfolioRiskParameters": {
"maxTotalDailyLoss": 100000,
"maxTotalOpenPositions": 15,
"maxTotalExposure": 70.0
}
}

Verification

After configuring risk parameters, verify:

  1. Position size is appropriate

    • Not too large (over-concentration)
    • Not too small (transaction costs)
    • Matches risk tolerance
  2. Stop loss is reasonable

    • Matches volatility
    • Not too tight (false stops)
    • Not too wide (excessive risk)
  3. Daily loss limit protects capital

    • 1-5% of account
    • Prevents catastrophic losses
    • Allows recovery
  4. Max positions allows diversification

    • Not too few (concentration risk)
    • Not too many (management difficulty)
    • Matches account size
  5. Risk-reward ratio is favorable

    • Minimum 1:1.5
    • Matches win rate
    • Ensures profitability

Troubleshooting

Positions Too Small

Problem: Calculated positions are tiny.

Solutions:

  1. Increase maxPositionSize
  2. Reduce stopLoss percentage
  3. Increase risk percentage (position sizing)
  4. Check if account size is sufficient

Daily Loss Limit Hit Frequently

Problem: Algorithm pauses every day.

Solutions:

  1. Increase maxDailyLoss
  2. Reduce position sizes
  3. Tighten stop losses
  4. Improve strategy (reduce losses)
  5. Review entry conditions

Too Many Blocked Trades

Problem: Trades blocked due to max positions.

Solutions:

  1. Increase maxOpenPositions
  2. Close losing positions faster
  3. Use tighter stops
  4. Reduce entry frequency
  5. Implement position priority

Risk-Reward Blocking Trades

Problem: Trades blocked due to risk-reward ratio.

Solutions:

  1. Reduce minimum ratio
  2. Widen take profit targets
  3. Tighten stop losses
  4. Review if ratio is realistic
  5. Check historical price moves

Over-Leveraged Portfolio

Problem: Total exposure across algorithms is too high.

Solutions:

  1. Reduce maxPositionSize per algorithm
  2. Reduce maxOpenPositions per algorithm
  3. Implement portfolio-wide limits
  4. Close some algorithms
  5. Reduce number of active algorithms