This documentation is organized around PyP's two strategy-authoring paths:
- PyPScript for rule-language strategies
- Quant Mode for Python-based model workflows
If you are here for Quant Mode, start with What Is Quant Mode? instead of the PyPScript language reference.
If you are new to the language, do not start with the reference pages. Start with the pages that explain how a .ppc file is structured and how rules are evaluated.
- Read PyPScript Basics to understand file structure, imports, assignments, and rule flow.
- Read Syntax Reference to see the exact shape of expressions and pattern clauses.
- Read Variables & Data to understand what data your rules can safely use.
- Read Pattern Matching to learn how the engine chooses the final signal.
- Use Indicator Reference and Function Reference when you need exact signatures.
- Read What Is Quant Mode? to understand when Quant Mode is the right fit.
- Read Research Workspace to understand the supported project shape.
- Read Strategy Contract to see the exact
train()andpredict()expectations. - Read quant.config.json to understand runtime, parameters, and requirements.
- Continue into Artifacts & Model Formats and Releases & Simulations.
PyPScript is a rule-oriented strategy language for expressing market logic clearly.
You use it to define:
- the market pairs and timeframes a strategy targets
- the indicators and helper functions it imports
- intermediate signals such as trend, momentum, confirmation, and filters
- final pattern rules that emit
UP,DOWN, orHOLD
PyPScript is designed to make strategies:
- readable by humans
- deterministic in evaluation order
- easy to revise without turning into unreadable spaghetti
A strong .ppc file usually has three layers:
- Inputs and indicators
- moving averages, RSI, ATR, MACD, or other raw components
- Intermediate logic
- named conditions such as
bullish_trend,volatile_enough, orcross_confirmed
- named conditions such as
- Pattern rules
- final ordered entries inside
patterns { ... }
- final ordered entries inside
That structure matters. When a strategy is too clever too early, it becomes hard to debug. When it is broken into named stages, the intent stays obvious.
- Rules are evaluated in order.
- The first matching pattern wins.
default -> HOLD(...)should be explicit.- Confidence is part of the output, not just decoration.
- Intermediate variables are there to improve clarity, not to mimic general-purpose programming.
- What Is Quant Mode?
- Research Workspace
- Strategy Contract
- quant.config.json
- Training Jobs
- Artifacts & Model Formats
- Releases & Simulations
- Live Deployment
- Marketplace for Quants
- Quant FAQ
Think of a .ppc file like this:
config {
pairs: ["EURUSD"]
timeframes: ["1m"]
}
use indicators.sma
use indicators.rsi
use functions.above
use functions.cross
fast = sma(20)
slow = sma(50)
strength = rsi(14)
patterns {
cross(fast, slow) and above(strength, 55) -> UP(0.82)
default -> HOLD(0.40)
}
That is the rhythm of the language:
- define the market scope
- import what you need
- compute named intermediate values
- emit final ordered signals
If you want to write your first serious strategy, go straight to PyPScript Basics. If you already know the rough shape of the language and just need exact grammar, open Syntax Reference.