📢
Loading...
On this page
article
Glossary and quick reference
Terms and code patterns used in the book, with links to detailed documentation.
Glossary
| Term | Meaning in this book |
|---|---|
| Candle | Data summarizing a period’s opening, highest, lowest, and closing prices and volume |
| Timeframe | A candle’s time resolution, such as one day |
| OHLCV | Open, High, Low, Close, Volume: the five basic candle values |
| Price chart | A chart displaying data in time order |
| Indicator | A program that calculates values from data and displays them |
| Strategy | A program that also supplies order rules to the simulator |
| Backtest | Running a strategy on historical data with a specified execution model |
| Variable | A name to which the program assigns a value |
| Type | The kind of value or variable, such as a number, Boolean, or array |
| UDT | User-defined type: a custom type containing several related values |
| Object | A particular instance of a type that stores its own field values |
| Field | An object’s data item accessible by name |
| Method | An operation associated with a particular type |
| Function | A named operation or calculation that can be called |
| Parameter | An input name specified in a function definition |
| Argument | The value passed to a parameter in a call |
| Input | A program input that the user can change |
| Scope | The part of the code where a name is available |
| History | A value from an earlier candle or an earlier execution of a stateful call |
| State | Data retained for the next execution |
Series | A variable annotation that retains values from earlier candles for history access |
Persistent | A variable annotation initialized once that carries its stored value between candles |
na | A missing, unavailable value |
| SMA | Simple moving average |
| EMA | Exponential moving average |
| Warmup | The initial period needed to collect sufficient data for a calculation |
| Crossing | A change in the relative order of two values in a specified direction |
| Breakpoint | A place in the code where the debugger can pause execution |
| Tick | The market’s smallest price increment |
| Slippage | A modeled price adjustment that changes the fill price in an unfavorable direction |
| Order | An instruction to the backtest simulator to buy or sell; submitting it does not mean it has filled |
| Fill | Execution of all or part of an order at a specific price and quantity |
| Commission | A trading fee charged on fills and included in backtest costs |
| Point value | The monetary value of a full price-unit move for one unit of the instrument |
| Long | A position that gains from rising prices and loses from falling prices, before costs |
| Position | The holding that exists after entries fill |
| Equity | Account capital, including the value of open holdings |
| Drawdown | A decline in equity relative to an earlier peak |
Which notation do you need?
| Task | Code form |
|---|---|
| Current closing price | close |
| Previous candle’s closing price | close[1] |
| Custom calculation with candle history | value: Series[float] = ... |
| Counter retained between candles | count: Persistent[int] = 0 |
| Check for a missing value | na(value) |
| Five-candle simple average | ta.sma(close, 5) |
| Upward crossing | ta.crossover(first, second) |
| Conditional operation | if condition: |
| Choose between two values | first if condition else second |
| Five repetitions, indexed from 0 through 4 | for index in range(5): |
| Add an element to the end of an array | array.push(values, value) |
| Long entry order | strategy.entry("Long", strategy.long) |
| Market close of the named entry | strategy.close("Long") |
| Stop and target specified as distances | strategy.exit("Exit", "Long", loss=100, profit=200) |
The table shows fragments, not complete programs. Full files and imports are in the corresponding chapters and the example package.
PyneIDE actions
| Goal | Where to find it |
|---|---|
| Create a project | PyneIDE menu → Initialize Pyne Project |
| Set up the runtime | PyneIDE menu → Setup Environment |
| Run a program | Run Pyne code above the code |
| Edit inputs | Edit Inputs… gear in the editor’s upper-right corner |
| Start debugging | Debug above the code |
| Next candle | Next Bar on the floating debugging toolbar |
| Reach a specific candle | Run to Bar… on the floating debugging toolbar |
| Trade results | Trades in the chart’s bottom panel |
| Equity curve | Performance in the chart’s bottom panel |
| Detailed statistics | Stats in the chart’s bottom panel |
| Strategy properties | Strategy properties, then Properties |
| Export plotted values | Open plot output CSV on the chart toolbar |
| Trade export | Open trades output CSV on the chart toolbar |
Detailed documentation
The PyneCore documentation lists all function arguments and additional types. These sections are useful alongside the book’s examples:
- Types and variable annotations
- Inputs
- Writing programs
- Debugging and logging
- Strategies
- Function library overview
For an unfamiliar call, first find its input types, result type, and history or state behavior. Then try it in a small, separate program where you can follow the expected result by hand too.