executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
risk-managementImplements risk management techniques (position sizing, risk-reward ratios, drawdown control) to safeguard capital and enhance trading performance in algorithmic trading systems.
Independent GitHub snapshot · Automated classification · Original documentation governs
name: risk-management description: Implements risk management techniques (position sizing, risk-reward ratios, drawdown control) to safeguard capital and enhance trading performance in algorithmic trading systems. license: MIT compatibility: opencode metadata: version: "1.0.0" domain: trading triggers: position sizing, risk-reward ratio, drawdown control, trading risk, capital protection, risk management, risk percentage role: implementation scope: implementation output-format: code content-types: [code, guidance, do-dont] archetypes: [tactical, educational] anti_triggers: [naive assessments, simplistic views on trading, quick solutions] response_profile: verbosity: medium directive_strength: high abstraction_level: operational
Implements risk management techniques for traders, focusing on position sizing, risk-reward ratios, and drawdown control strategies to safeguard capital and enhance trading performance.
Use this skill when:
Avoid this skill for:
def calculate_position_size(account_equity: float, risk_percentage: float, stop_loss_distance: float) -> float:
"""Calculate the position size based on account equity and risk.
Args:
account_equity (float): Total equity in the trading account.
risk_percentage (float): The percentage of equity you are willing to risk.
stop_loss_distance (float): The distance from the entry price to the stop-loss price.
Returns:
float: The size of the position to take.
"""
risk_amount = account_equity * (risk_percentage / 100)
position_size = risk_amount / stop_loss_distance
return position_size
def evaluate_risk_reward(entry_price: float, stop_loss_price: float, take_profit_price: float) -> float:
"""Calculate the risk-reward ratio.
Args:
entry_price (float): The entry price of the trade.
stop_loss_price (float): The price where you would stop the loss.
take_profit_price (float): The target price for profit.
Returns:
float: The risk-reward ratio.
"""
risk = entry_price - stop_loss_price
reward = take_profit_price - entry_price
return reward / risk if risk != 0 else float('inf') # Prevent division by zero
def check_drawdown(current_equity: float, peak_equity: float, max_drawdown_percentage: float) -> bool:
"""Check if the drawdown exceeds the maximum allowed.
Args:
current_equity (float): Current equity of the account.
peak_equity (float): Peak equity of the account.
max_drawdown_percentage (float): The maximum allowed drawdown percentage.
Returns:
bool: True if drawdown exceeds the limit, else False.
"""
drawdown = (peak_equity - current_equity) / peak_equity
return drawdown > (max_drawdown_percentage / 100)
Authoritative documentation links for this skill's domain. The model follows markdown links at load time to resolve external references and inline content.