How to Setup Position Sizing
Problem
You need to determine how much capital to allocate per trade based on your risk tolerance, account size, and trading style. Proper position sizing is crucial for managing risk and maximizing returns.
Prerequisites
- Basic algorithm configuration completed (Step 1)
- Understanding of your risk tolerance
- Knowledge of your account size
Available Position Sizing Methods
x3Algo supports 6 position sizing methods:
- Percentage-based - Allocate a percentage of your capital
- Fixed Quantity - Trade a fixed number of shares/contracts
- Fixed Amount - Trade a fixed rupee amount
- Risk-based - Size based on stop loss distance
- Volatility-adjusted - Size based on ATR (Average True Range)
- Kelly Criterion - Optimal sizing based on win rate and profit factor
Method 1: Percentage-Based Sizing
When to Use
- Conservative approach for most traders
- Automatically scales with account growth
- Simple to understand and implement
Configuration
{
"positionSizing": {
"method": "percentage",
"percentage": 2.0
}
}
Examples
Small Account (₹1,00,000)
- 2% = ₹2,000 per trade
- If stock price is ₹100, buy 20 shares
Medium Account (₹10,00,000)
- 2% = ₹20,000 per trade
- If stock price is ₹100, buy 200 shares
Large Account (₹1,00,00,000)
- 2% = ₹2,00,000 per trade
- If stock price is ₹100, buy 2,000 shares
Recommended Ranges
- Conservative: 1-2%
- Moderate: 2-5%
- Aggressive: 5-10% (not recommended for beginners)
Method 2: Fixed Quantity Sizing
When to Use
- Testing strategies with consistent exposure
- Trading futures/options with fixed lot sizes
- Comparing performance across different instruments
Configuration
{
"positionSizing": {
"method": "fixed_quantity",
"quantity": 100
}
}
Examples
Equity Trading
- Always buy 100 shares regardless of price
- ₹50 stock = ₹5,000 position
- ₹500 stock = ₹50,000 position
Futures Trading (NSE)
- NIFTY lot size = 50
- BANKNIFTY lot size = 25
- Always trade 1 lot (quantity = lot size)
Options Trading
- Always buy 100 contracts
- Consistent exposure for testing
Lot Size Considerations
For futures and options, ensure quantity matches exchange lot sizes:
{
"positionSizing": {
"method": "fixed_quantity",
"quantity": 50 // NIFTY lot size
}
}
Method 3: Fixed Amount Sizing
When to Use
- Maintaining consistent rupee exposure
- Trading across different price ranges
- Simplifying position management
Configuration
{
"positionSizing": {
"method": "fixed_amount",
"amount": 50000
}
}
Examples
Different Price Levels
- ₹50,000 fixed amount
- Stock at ₹100 = 500 shares
- Stock at ₹500 = 100 shares
- Stock at ₹2,000 = 25 shares
Minimum/Maximum Limits
- Minimum: ₹1,000 (exchange requirements)
- Maximum: Based on account size and risk tolerance
Calculations
Quantity = Fixed Amount / Stock Price
Example:
- Fixed Amount = ₹50,000
- Stock Price = ₹250
- Quantity = 50,000 / 250 = 200 shares
Method 4: Risk-Based Sizing
When to Use
- Professional risk management
- Strategies with defined stop losses
- Maintaining consistent risk per trade
Configuration
{
"positionSizing": {
"method": "risk_based",
"riskPercentage": 1.0
},
"riskParameters": {
"stopLoss": 2.0 // 2% stop loss
}
}
Formula
Risk Amount = Account Balance × Risk Percentage
Position Size = Risk Amount / Stop Loss Distance
Examples
Example 1: Conservative (1% risk, 2% stop)
- Account: ₹10,00,000
- Risk: 1% = ₹10,000
- Stop Loss: 2%
- Entry: ₹500
- Stop Distance: ₹500 × 2% = ₹10
- Quantity: ₹10,000 / ₹10 = 1,000 shares
- Position Value: 1,000 × ₹500 = ₹5,00,000 (50% of account)
Example 2: Moderate (1.5% risk, 3% stop)
- Account: ₹5,00,000
- Risk: 1.5% = ₹7,500
- Stop Loss: 3%
- Entry: ₹200
- Stop Distance: ₹200 × 3% = ₹6
- Quantity: ₹7,500 / ₹6 = 1,250 shares
- Position Value: 1,250 × ₹200 = ₹2,50,000 (50% of account)
Example 3: Tight Stop (0.5% risk, 1% stop)
- Account: ₹20,00,000
- Risk: 0.5% = ₹10,000
- Stop Loss: 1%
- Entry: ₹1,000
- Stop Distance: ₹1,000 × 1% = ₹10
- Quantity: ₹10,000 / ₹10 = 1,000 shares
- Position Value: 1,000 × ₹1,000 = ₹10,00,000 (50% of account)
Recommended Risk Percentages
- Conservative: 0.5-1%
- Moderate: 1-2%
- Aggressive: 2-3% (maximum recommended)
Method 5: Volatility-Adjusted Sizing
When to Use
- Adapting to market conditions
- Trading volatile instruments
- Dynamic risk management
Configuration
{
"positionSizing": {
"method": "volatility_adjusted",
"atrPeriod": 14,
"atrMultiplier": 2.0,
"targetRisk": 1.0
}
}
How It Works
ATR (Average True Range) measures volatility:
- High ATR = High volatility = Smaller position
- Low ATR = Low volatility = Larger position
Formula
Risk Amount = Account Balance × Target Risk
Stop Distance = ATR × ATR Multiplier
Position Size = Risk Amount / Stop Distance
Examples
Example 1: Low Volatility Stock
- Account: ₹10,00,000
- Target Risk: 1% = ₹10,000
- Stock Price: ₹500
- ATR (14): ₹5
- ATR Multiplier: 2.0
- Stop Distance: ₹5 × 2.0 = ₹10
- Quantity: ₹10,000 / ₹10 = 1,000 shares
- Position Value: ₹5,00,000
Example 2: High Volatility Stock
- Account: ₹10,00,000
- Target Risk: 1% = ₹10,000
- Stock Price: ₹500
- ATR (14): ₹25
- ATR Multiplier: 2.0
- Stop Distance: ₹25 × 2.0 = ₹50
- Quantity: ₹10,000 / ₹50 = 200 shares
- Position Value: ₹1,00,000 (smaller due to volatility)
ATR Period Selection
- 14 periods (default): Standard for most strategies
- 20 periods: Smoother, less sensitive
- 10 periods: More responsive to recent volatility
ATR Multiplier Effects
- 1.5: Tighter stops, more trades stopped out
- 2.0: Balanced (recommended)
- 2.5: Wider stops, fewer false stops
Method 6: Kelly Criterion Sizing
When to Use
- Advanced traders with performance history
- Optimizing long-term growth
- Strategies with proven edge
Configuration
{
"positionSizing": {
"method": "kelly_criterion",
"fractionalKelly": 0.25
}
}
Formula
Kelly % = (Win Rate × Avg Win - Loss Rate × Avg Loss) / Avg Win
Position Size = Account Balance × Kelly % × Fractional Kelly
Examples
Example 1: Strong Strategy
- Win Rate: 60%
- Avg Win: ₹5,000
- Avg Loss: ₹2,000
- Kelly % = (0.6 × 5000 - 0.4 × 2000) / 5000 = 0.44 (44%)
- Fractional Kelly: 0.25 (quarter Kelly)
- Position Size: 44% × 0.25 = 11% of account
Example 2: Moderate Strategy
- Win Rate: 50%
- Avg Win: ₹3,000
- Avg Loss: ₹2,000
- Kelly % = (0.5 × 3000 - 0.5 × 2000) / 3000 = 0.167 (16.7%)
- Fractional Kelly: 0.5 (half Kelly)
- Position Size: 16.7% × 0.5 = 8.35% of account
Fractional Kelly Recommendations
- 0.25 (Quarter Kelly): Conservative, reduces volatility
- 0.5 (Half Kelly): Moderate, balanced approach
- 1.0 (Full Kelly): Aggressive, maximum growth but high volatility
Requirements
- Minimum 30 trades of performance history
- Consistent strategy (no major changes)
- Positive expectancy (profitable strategy)
Advanced: Pyramiding Configuration
What is Pyramiding?
Pyramiding allows you to add to winning positions as they move in your favor (scaling in).
Configuration
{
"positionSizing": {
"method": "percentage",
"percentage": 2.0,
"pyramiding": {
"enabled": true,
"maxLevels": 3,
"sizingMethod": "decreasing",
"profitThreshold": 2.0
}
}
}
Sizing Methods
1. Equal Sizing
Each add-on is the same size as the initial position.
{
"pyramiding": {
"sizingMethod": "equal"
}
}
Example:
- Initial: 100 shares at ₹500 = ₹50,000
- Add-on 1: 100 shares at ₹510 = ₹51,000
- Add-on 2: 100 shares at ₹520 = ₹52,000
- Total: 300 shares, Avg Price: ₹510
2. Decreasing Sizing
Each add-on is 50% of the previous level.
{
"pyramiding": {
"sizingMethod": "decreasing"
}
}
Example:
- Initial: 100 shares at ₹500 = ₹50,000
- Add-on 1: 50 shares at ₹510 = ₹25,500
- Add-on 2: 25 shares at ₹520 = ₹13,000
- Total: 175 shares, Avg Price: ₹506.29
3-Level Pyramid Calculation:
- Level 1: 100% (₹50,000)
- Level 2: 50% (₹25,000)
- Level 3: 25% (₹12,500)
- Total Exposure: ₹87,500
3. Increasing Sizing
Each add-on is 1.5x the previous level (aggressive).
{
"pyramiding": {
"sizingMethod": "increasing"
}
}
Example:
- Initial: 100 shares at ₹500 = ₹50,000
- Add-on 1: 150 shares at ₹510 = ₹76,500
- Add-on 2: 225 shares at ₹520 = ₹1,17,000
- Total: 475 shares, Avg Price: ₹513.16
Risk Warning: Increasing sizing is aggressive and can lead to large losses if the trade reverses.
Maximum Pyramid Levels
{
"pyramiding": {
"maxLevels": 3 // 1-10 allowed
}
}
- 1-2 levels: Conservative
- 3-4 levels: Moderate
- 5+ levels: Aggressive (not recommended)
Profit Threshold
Add-ons only trigger after the position is profitable by the threshold percentage.
{
"pyramiding": {
"profitThreshold": 2.0 // Add after 2% profit
}
}
Example:
- Entry: ₹500
- Threshold: 2%
- Add-on 1 triggers at: ₹510 (2% profit)
- Add-on 2 triggers at: ₹520 (4% profit from entry)
Total Exposure Limits
Always consider total exposure when pyramiding:
{
"riskParameters": {
"maxPositionSize": 20.0 // Maximum 20% of account
}
}
This prevents over-concentration even with multiple add-ons.
Position Size Limits
Minimum Position Size
{
"positionSizing": {
"minPositionSize": 0.001 // 0.1% of account
}
}
Prevents tiny positions that aren't worth the transaction costs.
Maximum Position Size
{
"riskParameters": {
"maxPositionSize": 10.0 // 10% of account
}
}
Prevents over-concentration in a single position.
Broker-Specific Lot Sizes
For futures and options, respect exchange lot sizes:
NSE Futures:
- NIFTY: 50
- BANKNIFTY: 25
- FINNIFTY: 40
MCX Commodities:
- CRUDEOIL: 100 barrels
- GOLD: 100 grams
- SILVER: 30 kg
{
"positionSizing": {
"method": "fixed_quantity",
"quantity": 50, // Must match lot size
"respectLotSize": true
}
}
Verification
After configuring position sizing, verify:
-
Position size matches your risk tolerance
- Calculate maximum loss per trade
- Ensure it's within your comfort zone
-
Total exposure is reasonable
- Single position shouldn't exceed 10-20% of account
- Multiple positions shouldn't exceed 50-70% of account
-
Lot sizes are correct (for futures/options)
- Check exchange specifications
- Ensure quantity is a multiple of lot size
-
Pyramiding settings are appropriate
- Total exposure with all add-ons is acceptable
- Profit thresholds are realistic
Troubleshooting
Position Size Too Large
Problem: Calculated position size exceeds account balance.
Solution:
- Reduce percentage/risk percentage
- Increase stop loss distance (for risk-based)
- Use maxPositionSize limit
Position Size Too Small
Problem: Position size is too small to be meaningful.
Solution:
- Increase percentage/risk percentage
- Reduce stop loss distance (for risk-based)
- Consider if the strategy is suitable for your account size
Lot Size Mismatch
Problem: Quantity doesn't match exchange lot size.
Solution:
{
"positionSizing": {
"respectLotSize": true,
"roundingMethod": "down" // or "up", "nearest"
}
}
Pyramiding Not Triggering
Problem: Add-ons never execute.
Solution:
- Reduce profitThreshold
- Check that maxLevels > 1
- Verify position is profitable before expecting add-ons