# 2187nick/thinkscript architecture

> Architecture diagram of the GitHub repository 2187nick/thinkscript, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/2187nick/thinkscript
- Repository: https://github.com/2187nick/thinkscript

## Overview

##### Project type and purpose
- This is an open-source collection of ThinkScript indicators and strategies for the Thinkorswim (TOS) trading platform.
- Its primary goal is to organize, document and distribute dozens of custom chart studies (Unusual Options, Greeks, Open Interest & Volume, etc.) that users clone from GitHub and import into TOS.

##### File structure
- Top-level files:
- README.md, Instructions.md – project documentation, installation steps
- images/ – static assets used in the README
- Top-level directories by feature category:
- unusual_options_new – scripts for unusual options (equities, futures, combo, volume-only)
- gex, gex_chart – gamma exposure data and chart variants
- vanna, charm – Vanna and Charm (“time decay”) studies and charts
- option_volume_and_openInterest_vertical_axis – vertical-axis charts for open interest & volume
- near_the_money, modular, hurst_cycles, experimental, etc. – other indicator sets
- Each feature directory contains:
- README.md (category overview, sample images)
- one or more script files (.ts, no executable binaries)
- subfolders organizing by market (ES, SPX, NDX, stocks) or chart type
- No backend/frontend code, no build system—this is purely a script repository.

##### README for additional insights
- High-level categories and table of contents map to top-level directories.
- Installation: clone the repo, then import individual .ts ThinkScript files into TOS.
- No CI/CD pipeline; contributions are managed via GitHub PRs.

##### Detailed capture of essential elements
- Category folder as a separate sub-component cluster.
- Common files (Instructions.md, README.md, images/) into a “Docs” component.
- External dependency: TOS runtime consuming ThinkScript.

Putting it all together:
- Repo → Local Clone → End User’s Machine → Import → TOS
- TOS → Renders Charts → End User
- End User/Contributor → Fork/PR → GitHub Repo

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% GitHub Repository Cluster
    subgraph "GitHub Repository"
        direction TB
        GitHubRepo["GitHub Repository"]:::code

        subgraph "Documentation"
            direction TB
            README["README.md"]:::docs
            Instructions["Instructions.md"]:::docs
            images["images/"]:::docs
        end

        subgraph "Modules"
            direction TB
            unusual_options_new["Module: unusual_options_new"]:::code
            gex["Module: gex"]:::code
            gex_chart["Module: gex_chart"]:::code
            vanna["Module: vanna"]:::code
            charm["Module: charm"]:::code
            option_volume_and_openInterest_vertical_axis["Module: option_volume_and_openInterest_vertical_axis"]:::code
            near_the_money["Module: near_the_money"]:::code
            modular["Module: modular"]:::code
            hurst_cycles["Module: hurst_cycles"]:::code
            experimental["Module: experimental"]:::code
        end

        GitHubRepo --> README
        GitHubRepo --> Instructions
        GitHubRepo --> images
        GitHubRepo --> unusual_options_new
        GitHubRepo --> gex
        GitHubRepo --> gex_chart
        GitHubRepo --> vanna
        GitHubRepo --> charm
        GitHubRepo --> option_volume_and_openInterest_vertical_axis
        GitHubRepo --> near_the_money
        GitHubRepo --> modular
        GitHubRepo --> hurst_cycles
        GitHubRepo --> experimental
    end

    %% User and Local Clone
    GitHubRepo -->|clone/fetch| LocalClone["Local Clone"]:::code
    LocalClone --> EndUserMachine["End User's Machine"]:::user
    EndUserMachine -->|import scripts| TOS[(Thinkorswim Platform)]:::external
    TOS -->|renders charts| EndUser["End User (Trader)"]:::user
    EndUser -->|fork/PR| GitHubRepo

    %% Click Events
    click GitHubRepo "https://github.com/2187nick/thinkscript/tree/main//"
    click README "https://github.com/2187nick/thinkscript/blob/main/README.md"
    click Instructions "https://github.com/2187nick/thinkscript/blob/main/Instructions.md"
    click images "https://github.com/2187nick/thinkscript/tree/main/images/"
    click unusual_options_new "https://github.com/2187nick/thinkscript/tree/main/unusual_options_new/"
    click gex "https://github.com/2187nick/thinkscript/tree/main/gex/"
    click gex_chart "https://github.com/2187nick/thinkscript/tree/main/gex_chart/"
    click vanna "https://github.com/2187nick/thinkscript/tree/main/vanna/"
    click charm "https://github.com/2187nick/thinkscript/tree/main/charm/"
    click option_volume_and_openInterest_vertical_axis "https://github.com/2187nick/thinkscript/tree/main/option_volume_and_openInterest_vertical_axis/"
    click near_the_money "https://github.com/2187nick/thinkscript/tree/main/near_the_money/"
    click modular "https://github.com/2187nick/thinkscript/tree/main/modular/"
    click hurst_cycles "https://github.com/2187nick/thinkscript/tree/main/hurst_cycles/"
    click experimental "https://github.com/2187nick/thinkscript/tree/main/experimental/"

    %% Styles
    classDef code fill:#cce5ff,stroke:#004085
    classDef docs fill:#d4edda,stroke:#155724
    classDef external fill:#fff3cd,stroke:#856404
    classDef user fill:#f8d7da,stroke:#721c24
```
