Back to search
sma-44-swingtrading
SkillWorks with Claude CodeGitHub
Rules-based swing trading toolkit for the 44-day SMA setup: market regime filter, mechanical screener, position sizing with fee drag, trade journal and regime backtest. Built for India (NSE) with configurable markets, fees and universe. Includes Claude Code skills. Not financial advice.
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Badge for your README
Markdown
[](/listings/kpsrinivasan4--sma-44-swingtrading)HTML
<a href="/listings/kpsrinivasan4--sma-44-swingtrading"><img src="/api/listings/kpsrinivasan4--sma-44-swingtrading/badge.svg" alt="findsafeskills safety rating" /></a>Install
i
Install instructions from the README
As written by the repo's author. findsafeskills has not verified these steps.
Requires Python 3.11+.
pip install -r requirements.txt python -m unittest discover -s tests python -m sma44 init # creates user.toml for YOUR settings (git-ignored) python -m sma44 update-universe # downloads the Nifty 100 list from NSE python -m sma44 config # shows the settings in effect python -m sma44 prep # weekly routine: regime, screener, trade plans
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
README.md · README · 91 lines
- # SMA 44 swing trading toolkit
- Command-line tools and [Claude Code](https://claude.com/claude-code) skills that implement a daily-chart swing trading routine based on the 44-day simple moving average (SMA): a market regime filter, a mechanical screener, position sizing with fee drag, a trade journal, and a backtest by regime.
- Built first for the **Indian market (NSE, Nifty 100)**, with a market-profile system so the same code can serve other markets. See [docs/ADDING_A_MARKET.md](docs/ADDING_A_MARKET.md).
- > **Not financial advice.** This is a research and bookkeeping tool. It does not place orders and makes no predictions. The rules were not validated by this repository. Backtests are limited by survivorship bias and daily-bar assumptions. You are responsible for every trade you take.
- >
- > The 44 SMA setup idea is attributed in [docs/SOP.md](docs/SOP.md) to Siddharth Bhanushali. This project is independent and not affiliated with or endorsed by him.
- ## Quick start
- Requires Python 3.11+.
- ```
- pip install -r requirements.txt
- python -m unittest discover -s tests
- python -m sma44 init # creates user.toml for YOUR settings (git-ignored)
- python -m sma44 update-universe # downloads the Nifty 100 list from NSE
- python -m sma44 config # shows the settings in effect
- python -m sma44 prep # weekly routine: regime, screener, trade plans
- ```
- ## Your settings (`user.toml`)
- Nothing personal is stored in the repo. Edit `user.toml` (created by `init`, listed in `.gitignore`):
- ```toml
- [account]
- account_value = 25000 # your broker account value, in your currency
- capital_buffer = 500 # reserve for taxes and fees
- risk_pct = 2.0
- [fees] # starts at the SOP's India figures: set your own
- brokerage = 20.0 # per round-trip trade
- dp_charge = 15.34
- turnover_pct = 0.0 # % of buy + sell value (transaction taxes)
- gain_tax_rate_pct = 0.0 # % taken from a net gain
- [universe]
- file = "data/my_universe.txt" # or any CSV/TXT; default is the downloaded Nifty 100
- include = ["TATAMOTORS"]
- exclude = ["PAYTM"]
- ```
- Every key is optional. Precedence: `config/defaults.toml` (strategy) < `markets/<market>.toml` < `user.toml`. Command-line flags (`--account-value`, `--capital`) override the file.
- **Fee defaults:** the India profile starts with the SOP's example figures (Rs70 brokerage, Rs15.34 DP charge, 23.92% tax on a net gain). They will not match every investor or broker, so replace them with your own. Costs are applied per round trip, and tax only to a net gain.
- **Universe:** the default is the official Nifty 100 list. To use another NSE index, set `[universe] url` to its CSV and run `update-universe`. To use your own list, point `file` at a `.txt` (one symbol per line) or `.csv` (a `Symbol` column).
- ## Commands
- | Command | SOP | Purpose |
- | --- | --- | --- |
- | `python -m sma44 config` | | Show effective settings |
- | `python -m sma44 regime` | 2 | Index regime: Bullish / Sideways / Bearish |
- | `python -m sma44 screen` | 3 | Phase 1 screener |
- | `python -m sma44 size SYMBOL` | 4 | Entry, stop, target, quantity, fee drag |
- | `python -m sma44 prep` | 5 | The whole weekly routine |
- | `python -m sma44 journal plan/fill/exit/telemetry/status` | 5, 6 | Tradelog (`data/tradelog.csv`, git-ignored) |
- | `python -m sma44 review` | 6 | Performance summary, plus an optional checklist of your own `[review]` thresholds |
- | `python -m sma44 backtest --start 2019-01-01` | 2 | Signals by regime, gross and net of fees |
- | `python -m sma44 check-data` | | Data quality report |
- | `python -m sma44 update-universe [--url URL]` | | Refresh the universe list |
- Data comes from Yahoo Finance via `yfinance` (daily, split-adjusted, cached 12 hours in `data/cache`). It is free but can have gaps and corporate-action errors: run `check-data`.
- ## Claude Code skills (`.claude/skills`)
- `sma44-regime-check`, `sma44-screener`, `sma44-visual-audit`, `sma44-position-sizer`, `sma44-trade-journal`, `sma44-review`, `sma44-sunday-prep`. Open this folder in Claude Code and they load automatically. They run the commands above and explain the results.
- ## Your own rules
- `docs/SOP.md` holds the default rules the toolkit implements. If yours differ, copy [docs/SOP_TEMPLATE.md](docs/SOP_TEMPLATE.md) over it and write your own, then match the numbers in `user.toml`. The author's personal validation and scaling notes are in [docs/examples/author-notes.md](docs/examples/author-notes.md) as an example, not as rules.
- ## Assumptions made (not stated in the SOP)
- - Fees are per round trip; tax applies to the net gain only.
- - Targets are rounded to the market's tick size.
- - "Doji" = body under 50% of the candle range; the "flat/tangled" regime warning = SMAs within 1%, or the 44 SMA moved under 0.25% in 10 sessions. Both are information only.
- - Backtest: the entry order is valid for the next session only; the stop is assumed hit first when stop and target are in one bar; the time stop exits at the open of the first session 16+ days after entry.
- ## License
- [MIT](LICENSE): you may use, modify and share this code and the SOP, including commercially, as long as the copyright and licence notice stay with it. It comes with no warranty.
- ## Layout
- ```
- config/defaults.toml market-neutral strategy defaults
- markets/india.toml India profile (NSE); template.toml for new markets
- user.example.toml copy to user.toml for your account, fees, universe
- sma44/ the Python package
- .claude/skills/ Claude Code skills
- docs/SOP.md the default strategy rules (replace with your own)
- docs/SOP_TEMPLATE.md blank outline for writing your own SOP
- docs/examples/ the author's validation and scaling notes (examples only)
- docs/ADDING_A_MARKET.md how to adapt to another market
- tests/ unit tests (do not read your user.toml)
- ```
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.