Skip to content
Back to search

sma-44-swingtrading

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
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/kpsrinivasan4--sma-44-swingtrading/badge.svg)](/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
  1. # SMA 44 swing trading toolkit
  2. 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.
  3. 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).
  4. > **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.
  5. >
  6. > 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.
  7. ## Quick start
  8. Requires Python 3.11+.
  9. ```
  10. pip install -r requirements.txt
  11. python -m unittest discover -s tests
  12. python -m sma44 init # creates user.toml for YOUR settings (git-ignored)
  13. python -m sma44 update-universe # downloads the Nifty 100 list from NSE
  14. python -m sma44 config # shows the settings in effect
  15. python -m sma44 prep # weekly routine: regime, screener, trade plans
  16. ```
  17. ## Your settings (`user.toml`)
  18. Nothing personal is stored in the repo. Edit `user.toml` (created by `init`, listed in `.gitignore`):
  19. ```toml
  20. [account]
  21. account_value = 25000 # your broker account value, in your currency
  22. capital_buffer = 500 # reserve for taxes and fees
  23. risk_pct = 2.0
  24. [fees] # starts at the SOP's India figures: set your own
  25. brokerage = 20.0 # per round-trip trade
  26. dp_charge = 15.34
  27. turnover_pct = 0.0 # % of buy + sell value (transaction taxes)
  28. gain_tax_rate_pct = 0.0 # % taken from a net gain
  29. [universe]
  30. file = "data/my_universe.txt" # or any CSV/TXT; default is the downloaded Nifty 100
  31. include = ["TATAMOTORS"]
  32. exclude = ["PAYTM"]
  33. ```
  34. Every key is optional. Precedence: `config/defaults.toml` (strategy) < `markets/<market>.toml` < `user.toml`. Command-line flags (`--account-value`, `--capital`) override the file.
  35. **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.
  36. **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).
  37. ## Commands
  38. | Command | SOP | Purpose |
  39. | --- | --- | --- |
  40. | `python -m sma44 config` | | Show effective settings |
  41. | `python -m sma44 regime` | 2 | Index regime: Bullish / Sideways / Bearish |
  42. | `python -m sma44 screen` | 3 | Phase 1 screener |
  43. | `python -m sma44 size SYMBOL` | 4 | Entry, stop, target, quantity, fee drag |
  44. | `python -m sma44 prep` | 5 | The whole weekly routine |
  45. | `python -m sma44 journal plan/fill/exit/telemetry/status` | 5, 6 | Tradelog (`data/tradelog.csv`, git-ignored) |
  46. | `python -m sma44 review` | 6 | Performance summary, plus an optional checklist of your own `[review]` thresholds |
  47. | `python -m sma44 backtest --start 2019-01-01` | 2 | Signals by regime, gross and net of fees |
  48. | `python -m sma44 check-data` | | Data quality report |
  49. | `python -m sma44 update-universe [--url URL]` | | Refresh the universe list |
  50. 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`.
  51. ## Claude Code skills (`.claude/skills`)
  52. `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.
  53. ## Your own rules
  54. `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.
  55. ## Assumptions made (not stated in the SOP)
  56. - Fees are per round trip; tax applies to the net gain only.
  57. - Targets are rounded to the market's tick size.
  58. - "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.
  59. - 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.
  60. ## License
  61. [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.
  62. ## Layout
  63. ```
  64. config/defaults.toml market-neutral strategy defaults
  65. markets/india.toml India profile (NSE); template.toml for new markets
  66. user.example.toml copy to user.toml for your account, fees, universe
  67. sma44/ the Python package
  68. .claude/skills/ Claude Code skills
  69. docs/SOP.md the default strategy rules (replace with your own)
  70. docs/SOP_TEMPLATE.md blank outline for writing your own SOP
  71. docs/examples/ the author's validation and scaling notes (examples only)
  72. docs/ADDING_A_MARKET.md how to adapt to another market
  73. tests/ unit tests (do not read your user.toml)
  74. ```

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.