{"id":51674783,"url":"https://github.com/monch1962/stratus","last_synced_at":"2026-07-15T04:04:08.770Z","repository":{"id":370715647,"uuid":"1296400980","full_name":"monch1962/stratus","owner":"monch1962","description":"LISP-syntax Strategy DSL for Pine Script — write strategies in Clojure, generate idiomatic Pine Script v6, test with clojure.test","archived":false,"fork":false,"pushed_at":"2026-07-10T13:55:14.000Z","size":117,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-10T14:06:21.726Z","etag":null,"topics":["babashka","clojure","pinescript","testing","tradingview"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/monch1962.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-07-10T10:55:40.000Z","updated_at":"2026-07-10T13:56:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/monch1962/stratus","commit_stats":null,"previous_names":["monch1962/stratus"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/monch1962/stratus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monch1962%2Fstratus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monch1962%2Fstratus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monch1962%2Fstratus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monch1962%2Fstratus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monch1962","download_url":"https://codeload.github.com/monch1962/stratus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monch1962%2Fstratus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35489696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-15T02:00:06.706Z","response_time":131,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["babashka","clojure","pinescript","testing","tradingview"],"created_at":"2026-07-15T04:04:05.231Z","updated_at":"2026-07-15T04:04:08.762Z","avatar_url":"https://github.com/monch1962.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stratus — LISP-Syntax DSL for Pine Script\n\n**Write TradingView indicators and strategies in LISP syntax. Generate idiomatic Pine Script v6.\nTest with Clojure's full ecosystem. Import existing Pine. Simulate backtests.**\n\nStratus lets you author both **indicators** and **strategies** using parenthesized\nLISP-style syntax (`.stratus` files) and produces clean, production-ready Pine Script v6.\nBecause the DSL source is valid Clojure/EDN data, you get **unit testing,\nproperty-based testing, CI integration, and backtesting** — none of which exist\nin native Pine Script.\n\n---\n\n## Quick Start\n\n```bash\n# Install Babashka (15MB native Clojure)\nbrew install borkdude/brew/babashka\n\n# Clone and run tests\ngit clone https://github.com/monch1962/stratus\ncd stratus\nmake test\n# → 393 tests, 0 failures\n\n# Write a strategy\ncat \u003e crossover.stratus \u003c\u003c 'EOF'\n(strategy \"Crossover\" :default-qty 100)\n(def fast (sma 50))\n(def slow (sma 200))\n(on-bar\n  (when (crosses-above fast slow) (long \"GO\"))\n  (when (crosses-below fast slow) (close \"EXIT\")))\n(plot fast \"Fast MA\" :color blue :linewidth 2)\n(plot slow \"Slow MA\" :color red :linewidth 2)\nEOF\n\n# Or write an indicator\ncat \u003e rsi-indicator.stratus \u003c\u003c 'EOF'\n(indicator \"RSI Detector\" :overlay false :precision 2)\n(input-int \"RSI Period\" :def 14)\n(def r (rsi rsi-period))\n(plot r \"RSI\" :color purple :linewidth 2)\n(hline 70 \"Overbought\" :color red :linestyle dashed)\n(hline 30 \"Oversold\" :color green :linestyle dashed)\nEOF\n\n# Compile and copy to clipboard\n./stratus compile crossover.stratus --clip\n\n# View the conversion guide\n./stratus import\n\n# Or backtest\n./stratus simulate crossover.stratus --bars 500\n# ┌──────────────────────────────────────┐\n# │ Simulation Results                    │\n# ├──────────────────────────────────────┤\n# │  Trades:       12                    │\n# │  Net P\u0026L:      +3.42                 │\n# └──────────────────────────────────────┘\n```\n\nOpen TradingView → Pine Editor → **Ctrl+V** → **Ctrl+S** — your indicator or strategy is live.\n\n---\n\n## Documentation\n\n| Document | Description |\n|---|---|\n| [`docs/TUTORIAL.md`](docs/TUTORIAL.md) | Step-by-step walkthrough: build a volatility-adaptive RSI from scratch |\n| [`docs/REFERENCE.md`](docs/REFERENCE.md) | Pine Script ↔ Stratus cross-reference: 150+ construct mappings |\n|| [`docs/CLI.md`](docs/CLI.md) | Full CLI reference: compile, check, simulate, watch, repl, import guide, list |\n| [`docs/TESTING.md`](docs/TESTING.md) | Testing guide: unit tests, property tests, simulator, CI |\n| [`docs/DEPLOYMENT.md`](docs/DEPLOYMENT.md) | TradingView deployment guide: paste, configure, iterate |\n\n## Coverage\n\n**393 tests, 3792 assertions, 0 failures** across 22 suites (`make test`).\n**393 tests, 3792 assertions, 0 failures** across all 22 suites.\n\n~150 constructs across indicators, conditions, logic, arithmetic, strategy actions,\nplotting, colours, arrays, tables, matrix, map, strings, drawing objects,\nsecurity/request, type conversions, inputs, and Clojure expansions.\n\n### Examples\n\n| File | Features |\n|---|---|\n| `examples/golden-cross.stratus` | SMA crossover with colour-coded plots |\n| `examples/rsi-divergence.stratus` | RSI divergence with plotshape + alertcondition |\n| `examples/adaptive-regime.stratus` | ADX regime detection with regime-dependent entries |\n| `examples/trailing-bollinger.stratus` | BB with trailing stop, var/varip, strategy.exit |\n| `examples/multi-timeframe-macd.stratus` | request.security, macd, multiset, na/nz/iff |\n| `examples/inputs-library.stratus` | library, input-*, defn, export, tostring |\n| `examples/math-and-stats.stratus` | 15 math/stat constructs, cumulative functions |\n| `examples/array-table-drawing.stratus` | arrays, tables, line/label drawing |\n| `examples/control-flow.stratus` | if/elseif/else, for loops, persistent state |\n| `examples/color-fills-bg.stratus` | barcolor, bgcolor, color.rgb, from-gradient |\n| `examples/advanced-exit.stratus` | strategy.exit with stops/targets/trailing |\n| `examples/clojure-destructuring.stratus` | let tuple destructuring (macd, bb, stoch) |\n| `examples/clojure-threading.stratus` | -\u003e, -\u003e\u003e, some-\u003e, cond-\u003e, as-\u003e threading |\n| `examples/clojure-macros.stratus` | defmacro compile-time code templates |\n| `examples/clojure-comprehension.stratus` | for comprehension + multi-arity defn |\n\n## Project Structure\n\n```\nstratus/\n├── stratus              CLI wrapper script\n├── Makefile             make test, make compile\n├── bb.edn               Babashka project config\n├── src/stratus/        9 source files\n│   ├── core.clj         CLI entry point\n│   ├── reader.clj       .stratus parser\n│   ├── generator.clj    Pine Script code generator\n│   ├── inliner.clj      Compile-time inline expansion\n│   ├── expander.clj     Clojure expansion macros\n│   ├── validator.clj    Pre-compile validation\n│   ├── import-guide.clj Pine Script → Stratus conversion guide\n│   ├── simulator.clj    Strategy backtesting engine\n│   └── exporter.clj     OHLCV data export\n├── test/stratus/        22 test suites, 393 tests, 3792 assertions\n├── examples/            11 example .stratus strategies\n├── docs/                Split documentation\n└── .vscode/             VS Code syntax highlighting\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonch1962%2Fstratus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonch1962%2Fstratus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonch1962%2Fstratus/lists"}