From concept to code.

Each project below represents a complete, working system built by the Coronet Berkley team. The source code is published with full documentation so learners can study how professional trading infrastructure is designed, not just what it does, but why each decision was made.

Available

APEX Automated Trading Engine

// five-module Python system with broker API integration
Python Schwab API Futures REST API Pandas

What this system teaches

A complete automated trading engine that connects to a brokerage API, reads live market data, evaluates configurable signal conditions, executes orders, and manages positions with automated stop-loss and take-profit logic. Built for micro futures contracts on the Schwab platform.

Studying this codebase teaches the full architecture of a production trading system: how to structure modular signal evaluation, how to implement risk management as a separate concern from signal generation, how to build trade logging for post-session analysis, and how to handle the real-world complexities of API authentication, rate limiting, and order lifecycle management.

System architecture

config.env
Environment configuration. API credentials, trading symbol, risk parameters, and session settings. Demonstrates separation of config from logic.
apex_signals.py
Signal evaluation engine. Computes trend, momentum, volatility, and volume conditions, then outputs a composite score against configurable thresholds.
apex_risk.py
Risk management module. Enforces per-trade position sizing, daily loss limits, and maximum concurrent exposure. Operates independently of the signal engine.
apex_logger.py
Trade journal and logging system. Records every signal evaluation, order placement, fill, and exit to CSV for post-session review and strategy refinement.
apex_bot.py
Main execution loop. Orchestrates the signal engine, risk manager, and logger. Handles API connection, market data polling, order routing, and exit management.

Concepts covered

Modular system design Broker API integration Signal scoring frameworks Position sizing algorithms Risk management as a separate concern Automated order execution Stop-loss and take-profit automation Trade logging and journaling Environment-based configuration API authentication patterns
Available

APEX Breakout Indicator Suite

// four-module ThinkScript system for thinkorswim
ThinkScript thinkorswim Technical Analysis Breakout Strategy

What this system teaches

A four-module indicator suite written in ThinkScript for the thinkorswim (Schwab) charting platform. The system evaluates trend structure, momentum conditions, volume confirmation, and volatility breakout levels, then presents the analysis through visual overlays, a real-time dashboard HUD, and configurable alert conditions.

Studying this codebase teaches how professional charting indicators are structured: how to layer multiple analytical frameworks into a cohesive system, how to build visual feedback that communicates signal quality at a glance, how to use VWAP deviation bands for context-aware entries, and how to design alerts that fire only when multiple independent conditions align.

System architecture

Module 1: APEX_Main
Core indicator. EMA structure, VWAP deviation bands, ATR-based breakout zones, RSI momentum filter, ADX trend strength, and composite signal scoring with visual entry/exit markers.
Module 2: APEX_Dashboard
Real-time heads-up display. Aggregates all signal components into a single visual panel showing trend bias, signal score, momentum state, and volume confirmation status.
Module 3: APEX_Alerts
Alert engine. Configurable notifications that fire when the composite signal score meets user-defined thresholds. Supports sound, popup, and email alert delivery.
Module 4: APEX_Volume
Volume analysis engine. Computes volume surge ratios, relative volume profiles, and confirms whether current participation supports the breakout thesis.

Concepts covered

Multi-timeframe analysis EMA trend structure VWAP deviation bands ATR-based breakout detection RSI momentum filtering ADX trend strength measurement Volume surge confirmation Composite signal scoring HUD dashboard design Alert condition engineering
Available
v2.0

APEX Breakout Indicator Suite v2.0

// dynamic trend state engine + 8-point signal scoring
ThinkScript thinkorswim Technical Analysis Trend State Machine EMA Slope Detection

What this system teaches

The second-generation APEX indicator suite introduces a dynamic trend state engine that replaces the static EMA stack check used in v1. Where v1 could only report BULLISH, BEARISH, or MIXED, often lagging behind violent reversals, v2 detects trend weakening in real time by measuring EMA slope direction independently from stack alignment. The result is a five-state system (Trending Bull, Weakening Bull, Transition, Weakening Bear, Trending Bear) that catches momentum shifts before the moving averages cross.

Studying this codebase teaches how to evolve a first-generation indicator into a more responsive system: how to add leading indicators alongside lagging ones, how to build state machines in ThinkScript, how EMA slope detection works as an early-warning mechanism, and how to expand a scoring system from 6 to 8 conditions while recalibrating entry thresholds.

What changed from v1

New 5-state trend engine replaces 3-state EMA stack check
New EMA8 slope detection — catches reversals before crossovers
New Price-to-EMA8 proximity check — filters overextended entries
New 8-point scoring (up from 6) with recalibrated thresholds
New Trend shift and slope flip alerts — earliest possible warnings
New 5-color candle system with dark green/red early-warning states
Fix All known ThinkScript compilation bugs resolved

System architecture

Module 1: APEX_Main_v2
Core indicator. Dynamic trend state engine, EMA slope detection, VWAP deviation bands, ATR breakout zones, 8-point composite signal scoring, 5-color candle system, and visual entry/exit markers.
Module 2: APEX_Dashboard_v2
Real-time heads-up display. 5-state trend label, EMA8 slope direction, signal scores out of 8, and all momentum/volume/session indicators from v1.
Module 3: APEX_Alerts_v2
Alert engine. Trend shift alerts, slope flip alerts, VWAP reclaim/reject, volume surge, ADX activation, and partial setup building notifications.
Module 4: APEX_VolumeEngine_v2
Volume analysis engine. Colored surge histogram, cumulative delta with session reset, delta divergence detection, volume profile markers, and buy/sell pressure labels.

Concepts covered

State machine design EMA slope analysis Leading vs lagging indicators Dynamic trend detection Expanded signal scoring Price-to-EMA proximity Trend shift alerts Multi-state candle coloring Cumulative delta divergence Indicator version evolution

Installation guide

1
Download and extract

Download the zip file below. Right-click the zip, select Extract All. You will get five files: four .ts ThinkScript modules and a README_v2.txt.

2
Open each .ts file in Notepad

Windows may associate .ts files with a media player. Right-click each file, choose Open With, then select Notepad to see the ThinkScript code inside.

3
Create studies in thinkorswim

Open thinkorswim. Go to the Charts tab, click the beaker icon (Studies), then Edit Studies, then Create. For each module: clear the editor, paste the code from Notepad (Ctrl+A, Ctrl+C, Ctrl+V), name the study exactly as shown below, then click Reformat Code to verify zero errors before saving.

APEX_Main_v2 APEX_Dashboard_v2 APEX_Alerts_v2 APEX_VolumeEngine_v2
4
Apply to your chart

In Edit Studies, check all four v2 modules. Modules 1 through 3 are upper-chart studies. Module 4 is a lower subgraph (volume panel). If upgrading from v1, uncheck the old modules but do not delete them.

5
Configure chart settings

Recommended timeframes: 1-minute or 5-minute for day trading, 15-minute for intraday swing. Remove the default Volume study if present, as Module 4 replaces it. Resize the volume panel to approximately 20 to 25 percent of total chart height.

Signal scoring v2.0

Score Action
8/8 Maximum conviction — full position
7/8 High-conviction entry — standard position
6/8 Setup building — watch closely, not ready
5/8 Conditions aligning — patience required
≤4/8 No trade — system holds you out

Launch price: $79. Educational ThinkScript source code and documentation for thinkorswim.

Available

Options Flow Scanner

// real-time unusual options activity detection engine
Python ThinkScript Schwab API Options Data Statistical Analysis

What this system teaches

A two-part options flow analysis system: a Python scanning engine that monitors options chains across a configurable watchlist, detecting unusual volume, premium flow imbalances, IV surface anomalies, and large institutional trades; and a ThinkScript overlay that provides real-time options context directly on thinkorswim charts including IV percentile, put/call ratios, and composite flow scoring.

Studying this codebase teaches how institutional options positioning can be inferred from publicly available data: how to compare volume against open interest to identify new positions, how to calculate net premium flow to gauge directional conviction, how to detect IV surface anomalies (skew inversions, term structure inversions) that signal expected catalysts, and how to aggregate multiple independent signals into a composite score.

System architecture

flow_auth.py
OAuth2 authentication with the Schwab API. Token management, auto-refresh, and connection validation.
flow_fetcher.py
Options chain data retrieval and ETL. Fetches nested chain data, flattens into analyzable records with Greeks and volume metrics.
flow_detector.py
Core analysis engine. Unusual volume detection, premium flow analysis, IV surface analysis, large trade identification, and composite scoring.
flow_logger.py
Console display formatting with color-coded severity, plus CSV and JSON export for historical analysis and backtesting.
flow_scanner.py
Main execution engine. Orchestrates the scan-analyze-display-export pipeline in a continuous loop with market hours awareness.
APEX_FlowOverlay.ts
ThinkScript companion indicator. IV percentile, put/call ratio, options/stock volume ratio, and composite flow status labels for thinkorswim charts.

Concepts covered

Volume/open interest analysis Premium flow calculation IV percentile ranking Volatility skew analysis Term structure detection Put/call ratio interpretation Composite signal scoring Options chain ETL pipelines API rate limit management Real-time data processing

Real code teaches what textbooks cannot.

Textbooks explain concepts. Source code shows how those concepts survive contact with reality. A chapter on risk management describes the theory; a working risk module shows how that theory handles edge cases, API failures, and the difference between a backtest and a live market. We publish our code because we believe the architecture of a trading system teaches as much as the strategy behind it.

Every project in this library is built by the Coronet Berkley team using the same engineering standards we teach in our programs. The code is annotated, the design decisions are documented, and the systems are functional. Learners are free to study, fork, modify, and build upon anything published here. The only thing we ask is that you understand the risks of deploying trading systems with real capital, and that you take responsibility for your own decisions.

Code Library
Get notified when new projects are released.

We publish new open-source trading systems and indicator suites periodically. Leave your email to hear about them first.

Code releases only. No marketing, no spam.

Before you download.

Is this code free to use?

Yes. All source code in this library is provided at no cost for educational study. You are free to read, modify, and learn from it. If you choose to deploy any code in a live trading environment, you do so at your own risk and are solely responsible for the outcome.

Can I use this code to trade real money?

The code is functional, but it is published as educational material, not as a production-ready trading product. If you deploy it, you should thoroughly understand every module, test extensively in a paper trading environment first, and never risk capital you cannot afford to lose. We do not guarantee the profitability or reliability of any system.

Will you provide support or setup help?

The source code is provided as-is with documentation. For guided instruction on trading system architecture, signal design, and risk management frameworks, explore our educational programs, which cover these topics in depth with structured curriculum and direct instruction.

Do I need programming experience?

For the ThinkScript indicator suite, minimal programming knowledge is needed. ThinkScript is a domain-specific language designed for non-programmers. For the Python trading engine, intermediate Python experience and familiarity with API concepts are recommended. Both projects include documentation that explains the code line by line.

How is this different from buying a trading bot?

Most commercial trading bots are black boxes: you pay, you run them, you hope they work. This library takes the opposite approach. Every line of logic is visible, documented, and explained. The goal is not to give you a tool to run blindly, but to teach you how trading systems are engineered so you can build, evaluate, and improve your own.