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)
Recommended Values
| Risk Profile | Max Position Size | Use Case |
|---|---|---|
| Conservative | 2-5% | Capital preservation |
| Moderate | 5-10% | Balanced approach |
| Aggressive | 10-20% | Growth-focused |
| Very Aggressive | 20-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.
Recommended Values
| Volatility | Stop Loss % | Use Case |
|---|---|---|
| Low | 1-2% | Large caps, stable stocks |
| Medium | 2-3% | Mid caps, normal volatility |
| High | 3-5% | Small caps, volatile stocks |
| Very High | 5-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
}
}
Recommended Values
| Strategy | Take Profit % | Holding Period |
|---|---|---|
| Scalping | 0.5-1% | Minutes |
| Day Trading | 2-4% | Hours |
| Swing Trading | 5-10% | Days |
| Position Trading | 15-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
- Tracking: System tracks P&L from midnight (00:00 IST)
- Calculation: Includes realized + unrealized losses
- Trigger: When daily loss reaches limit
- Action: Algorithm automatically pauses
- Reset: Resets at midnight for next trading day
Example:
Account: ₹10,00,000 Max Daily Loss: ₹50,000 (5% of account)
| Time | Trade | P&L | Cumulative | Status |
|---|---|---|---|---|
| 09:30 | Trade 1 | -₹15,000 | -₹15,000 | ✅ Active |
| 11:00 | Trade 2 | -₹20,000 | -₹35,000 | ✅ Active |
| 13:00 | Trade 3 | -₹18,000 | -₹53,000 | ⛔ Paused! |
Algorithm pauses and won't take new trades until next day.
Recommended Values
| Risk Profile | Daily Loss % | Daily Loss Amount |
|---|---|---|
| Conservative | 1-2% | ₹10,000 - ₹20,000 (₹10L account) |
| Moderate | 2-5% | ₹20,000 - ₹50,000 (₹10L account) |
| Aggressive | 5-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:
- Pause algorithm
- Close all open positions (optional)
- Send notification
- Log event
- 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
| Time | Action | Open Positions | Status |
|---|---|---|---|
| 09:30 | Buy RELIANCE | 1 | ✅ Executed |
| 10:00 | Buy TCS | 2 | ✅ Executed |
| 11:00 | Buy INFY | 3 | ✅ Executed |
| 12:00 | Buy HDFC | 3 | ⛔ Blocked (limit reached) |
| 13:00 | Sell RELIANCE | 2 | Position closed |
| 14:00 | Buy HDFC | 3 | ✅ Executed (slot available) |
Recommended Values
| Strategy | Max Positions | Reason |
|---|---|---|
| Focused | 1-3 | Deep analysis, high conviction |
| Balanced | 3-5 | Diversification, manageable |
| Diversified | 5-10 | Spread risk, more opportunities |
| Portfolio | 10-20 | Full 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
Recommended Ratios
| Win Rate | Min Ratio | Breakeven | Use Case |
|---|---|---|---|
| 60%+ | 1:1 | 40% win rate | High probability |
| 50% | 1:1.5 | 40% win rate | Balanced |
| 40% | 1:2 | 33% win rate | Standard |
| 30% | 1:3 | 25% win rate | Trend-following |
| 20% | 1:4 | 20% win rate | Home 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:
-
Position size is appropriate
- Not too large (over-concentration)
- Not too small (transaction costs)
- Matches risk tolerance
-
Stop loss is reasonable
- Matches volatility
- Not too tight (false stops)
- Not too wide (excessive risk)
-
Daily loss limit protects capital
- 1-5% of account
- Prevents catastrophic losses
- Allows recovery
-
Max positions allows diversification
- Not too few (concentration risk)
- Not too many (management difficulty)
- Matches account size
-
Risk-reward ratio is favorable
- Minimum 1:1.5
- Matches win rate
- Ensures profitability
Troubleshooting
Positions Too Small
Problem: Calculated positions are tiny.
Solutions:
- Increase maxPositionSize
- Reduce stopLoss percentage
- Increase risk percentage (position sizing)
- Check if account size is sufficient
Daily Loss Limit Hit Frequently
Problem: Algorithm pauses every day.
Solutions:
- Increase maxDailyLoss
- Reduce position sizes
- Tighten stop losses
- Improve strategy (reduce losses)
- Review entry conditions
Too Many Blocked Trades
Problem: Trades blocked due to max positions.
Solutions:
- Increase maxOpenPositions
- Close losing positions faster
- Use tighter stops
- Reduce entry frequency
- Implement position priority
Risk-Reward Blocking Trades
Problem: Trades blocked due to risk-reward ratio.
Solutions:
- Reduce minimum ratio
- Widen take profit targets
- Tighten stop losses
- Review if ratio is realistic
- Check historical price moves
Over-Leveraged Portfolio
Problem: Total exposure across algorithms is too high.
Solutions:
- Reduce maxPositionSize per algorithm
- Reduce maxOpenPositions per algorithm
- Implement portfolio-wide limits
- Close some algorithms
- Reduce number of active algorithms