Glossary

TermMeaning in this book
CandleData summarizing a period’s opening, highest, lowest, and closing prices and volume
TimeframeA candle’s time resolution, such as one day
OHLCVOpen, High, Low, Close, Volume: the five basic candle values
Price chartA chart displaying data in time order
IndicatorA program that calculates values from data and displays them
StrategyA program that also supplies order rules to the simulator
BacktestRunning a strategy on historical data with a specified execution model
VariableA name to which the program assigns a value
TypeThe kind of value or variable, such as a number, Boolean, or array
UDTUser-defined type: a custom type containing several related values
ObjectA particular instance of a type that stores its own field values
FieldAn object’s data item accessible by name
MethodAn operation associated with a particular type
FunctionA named operation or calculation that can be called
ParameterAn input name specified in a function definition
ArgumentThe value passed to a parameter in a call
InputA program input that the user can change
ScopeThe part of the code where a name is available
HistoryA value from an earlier candle or an earlier execution of a stateful call
StateData retained for the next execution
SeriesA variable annotation that retains values from earlier candles for history access
PersistentA variable annotation initialized once that carries its stored value between candles
naA missing, unavailable value
SMASimple moving average
EMAExponential moving average
WarmupThe initial period needed to collect sufficient data for a calculation
CrossingA change in the relative order of two values in a specified direction
BreakpointA place in the code where the debugger can pause execution
TickThe market’s smallest price increment
SlippageA modeled price adjustment that changes the fill price in an unfavorable direction
OrderAn instruction to the backtest simulator to buy or sell; submitting it does not mean it has filled
FillExecution of all or part of an order at a specific price and quantity
CommissionA trading fee charged on fills and included in backtest costs
Point valueThe monetary value of a full price-unit move for one unit of the instrument
LongA position that gains from rising prices and loses from falling prices, before costs
PositionThe holding that exists after entries fill
EquityAccount capital, including the value of open holdings
DrawdownA decline in equity relative to an earlier peak

Which notation do you need?

TaskCode form
Current closing priceclose
Previous candle’s closing priceclose[1]
Custom calculation with candle historyvalue: Series[float] = ...
Counter retained between candlescount: Persistent[int] = 0
Check for a missing valuena(value)
Five-candle simple averageta.sma(close, 5)
Upward crossingta.crossover(first, second)
Conditional operationif condition:
Choose between two valuesfirst if condition else second
Five repetitions, indexed from 0 through 4for index in range(5):
Add an element to the end of an arrayarray.push(values, value)
Long entry orderstrategy.entry("Long", strategy.long)
Market close of the named entrystrategy.close("Long")
Stop and target specified as distancesstrategy.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

GoalWhere to find it
Create a projectPyneIDE menu → Initialize Pyne Project
Set up the runtimePyneIDE menu → Setup Environment
Run a programRun Pyne code above the code
Edit inputsEdit Inputs… gear in the editor’s upper-right corner
Start debuggingDebug above the code
Next candleNext Bar on the floating debugging toolbar
Reach a specific candleRun to Bar… on the floating debugging toolbar
Trade resultsTrades in the chart’s bottom panel
Equity curvePerformance in the chart’s bottom panel
Detailed statisticsStats in the chart’s bottom panel
Strategy propertiesStrategy properties, then Properties
Export plotted valuesOpen plot output CSV on the chart toolbar
Trade exportOpen 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:

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.