Trading strategy
Skill for backtesting and evaluating trading strategies on historical stock dataFrom its SKILL.md
npx -y skills add ai-align/finance-plugin --skill trading-strategyAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 3 stars3 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
1.9 KB, as published. Nobody here has run it
Trading Strategy
A skill for backtesting specific trading strategies, evaluating their performance, and visualizing entry/exit points.
Capabilities
- Backtesting: Simulate trading strategies on historical data
- Strategy Library:
sma_crossover: Buy when Fast SMA > Slow SMArsi_reversal: Contrarion strategy based on RSI overbought/oversold levels
- Performance Metrics:
- Total Return
- Annualized Return
- Win Rate
- Max Drawdown
- Sharpe Ratio
- Visualization: Generates charts with Buy/Sell markers
Workflow
1. Run Backtest
Users specify a ticker, strategy, and time period.
Example:
- "Test SMA crossover on AAPL for the last 2 years" ->
python3 ${CLAUDE_PLUGIN_ROOT}/skills/trading-strategy/scripts/main.py --ticker AAPL --strategy sma_crossover --period 2y
2. Parse Output
The script returns a JSON object with:
metrics: Performance summarytrades: List of executed tradeschart: Path to the visualization image
Command Options
# Basic SMA Crossover backtest
python3 main.py --ticker AAPL --strategy sma_crossover
# RSI Reversal with custom capital
python3 main.py --ticker TSLA --strategy rsi_reversal --initial-capital 50000
# Custom period
python3 main.py --ticker MSFT --strategy sma_crossover --period 5y
Strategies Details
SMA Crossover
- Logic:
- Buy when SMA(Fast) crosses above SMA(Slow)
- Sell when SMA(Fast) crosses below SMA(Slow)
- Parameters (Default):
- Fast Period: 50
- Slow Period: 200
RSI Reversal
- Logic:
- Buy when RSI < 30 (Oversold) AND RSI increases (turns up)
- Sell when RSI > 70 (Overbought) AND RSI decreases (turns down)
- Parameters (Default):
- RSI Period: 14