Function Reference
This page lists every function the toolbox adds to AmiBroker, grouped by what it does. Each name links to its own page, where you'll find the full signature, the parameters, and an example. If you just want to find a function quickly, start here.
The signature on each function's own page is the authoritative one. A few functions take an optional Engine argument that selects the cycle estimator — see Cycle Engines for what the engine numbers mean.
Pattern & trendline scanners
These scan a chart for classic patterns or draw lines automatically. See Pattern Exploration for the bigger picture.
| Function | What it does |
|---|---|
| AutoTrendline | Detects swing points and draws trendlines on the chart automatically. |
| AutoSupport | Finds horizontal support and resistance levels from price. |
| AutoPivots | Marks swing pivot highs and lows. |
| FindFibRetracement | Finds the most recent swing and projects its Fibonacci retracement levels. |
| FindGartley | Scans for the Gartley harmonic pattern. |
| FindHeadAndShoulders | Scans for the head-and-shoulders pattern. |
| FindDoublePattern | Scans for double tops and double bottoms. |
Variable-period indicators
These are the usual indicators, but their lookback period can change from bar to bar — feed them a period array (for example from DominantCycle) to make them adaptive. See the Adaptive Indicators overview.
| Function | What it does |
|---|---|
| VariablePeriodEMA | Exponential moving average with a per-bar period. |
| VariablePeriodWildersMA | Wilder's smoothing average with a per-bar period. |
| VariablePeriodRSI | RSI with a per-bar period. |
| VariablePeriodCCI | CCI with a per-bar period. |
| VariablePeriodMFI | Money Flow Index with a per-bar period. |
| VariablePeriodCMO | Chande Momentum Oscillator with a per-bar period. |
| VariablePeriodFastStochastic | Fast stochastic %K with a per-bar period. |
| VariablePeriodWilliamsR | Williams %R with a per-bar period. |
| VariablePeriodTrix | TRIX with a per-bar period. |
| VariablePeriodDMI | Directional movement (DI+, DI− and ADX) with a per-bar period. |
| VariablePeriodATR | Average True Range with a per-bar period. |
| VariablePeriodStDev | Standard deviation with a per-bar period. |
| VariablePeriodRef | Like AFL's Ref(), but the number of bars back can vary each bar. |
| VariablePeriodHHV | Highest high over a per-bar lookback. |
| VariablePeriodLLV | Lowest low over a per-bar lookback. |
| VariablePeriodSum | Running sum over a per-bar lookback. |
Cycle & signal-processing
These treat price as a signal and measure its cycles. Several accept an optional Engine argument — see Digital Signal Processing and Cycle Engines.
| Function | What it does |
|---|---|
| DominantCycle | Estimates the dominant cycle period at each bar (engine-selectable). |
| HilbertPeriod | Dominant cycle period via the Hilbert transform. |
| CyberCycle | Ehlers' Cyber Cycle oscillator. |
| MAMA | MESA Adaptive Moving Average (returns the MAMA and FAMA lines). |
| SineWave | Sine and lead-sine of the cycle phase, for turning points (engine-selectable). |
| HilbertOscillator | Oscillator of the cycle component of price (engine-selectable). |
| InstantTrendline | Ehlers' instantaneous trendline, a low-lag trend line (engine-selectable). |
| SignalNoiseRatio | Cycle signal-to-noise ratio, in decibels. |
| EnhancedSignalNoiseRatio | Spectral signal-to-noise ratio (engine-selectable). |
| PolynomialInterpolation | Smooths price by fitting a polynomial over a lookback. |
| Goertzel | Scans the frequency spectrum and can project cycles forward. |
| EndPointFFT | End-point FFT frequency filter that does not repaint. |
Pivots & levels
| Function | What it does |
|---|---|
| PivotPoint | Returns the price of a numbered swing pivot. |
| PivotPointBar | Returns the bar index of a numbered swing pivot. |
| PercentDifference | The percentage difference between two values. |
System rotation
Rotate between two and seven trading systems, staying in whichever has been strongest over a lookback. See System Rotation.
| Function | What it does |
|---|---|
| RotateSignals2 … RotateSignals7 | Rank 2–7 systems by recent performance and trade only the leader. The number sets how many systems you pass in. |
Neural networks
The network functions come in two styles: fixed-arity calls where you pass the inputs directly (the numbered families), and multi-input calls where you build the input set up first. The full workflow is on the Neural Network Functions page.
| Function | What it does |
|---|---|
| TrainNeuralNetwork3 … TrainNeuralNetwork10 | Train a network on the given inputs and one output, then save it to a file. The number is the total argument count. |
| RunNeuralNetwork3 … RunNeuralNetwork10 | Load a saved network and run it over the given inputs to produce a prediction. |
| NeuralNetworkIndicator3 … NeuralNetworkIndicator20 | Train-and-plot helper that runs a network straight onto a chart, with a lookback for walk-forward. |
| AddNeuralNetworkInput | Adds one input to the set used by the multi-input train/run functions. |
| AddNeuralNetworkOutput | Sets the output (target) for the multi-input functions. |
| AddNeuralNetworkAmplify | Repeats (amplifies) chosen inputs so the network weights them more. |
| ClearNeuralNetworkInputs | Clears the accumulated inputs so you can start a fresh set. |
| TrainMultiInputNeuralNetwork | Trains a network using the inputs you added — any number, no fixed arity. |
| RunMultiInputNeuralNetwork | Runs a saved network using the inputs you added. |
Network configuration
Before training, you shape the network and the training run with a family of
Set… calls (plus a few Enable…/Disable… toggles).
Every one of these is listed, with its values, on the
Settings Reference. They are grouped across these pages:
| Topic | Settings |
|---|---|
| Architecture | SetNeuralNetworkType (0 MLP, 1 LSTM, 2 GRU, 3 TCN, 4 Transformer), SetRecurrentParams, SetNetworkLayer1…4, SetNetworkWithActivationLayer1…4. |
| TCN, Transformer & advanced | SetTcnParams, SetTransformerParams, SetEnsembleSize, SetLayerNorm, SetCategoricalInput. |
| Training algorithm | SetLearningAlgorithm, SetLearningRate, SetMomentum, SetSarpropTemperature, SetBatchSize, SetMaximumEpochs, the learning-rate schedule and optimizer setters (SetLearningRateSchedule, SetLRScheduleStep, SetLRStepDecayFactor, SetLRScheduleMinPercent, SetSGDRCycleMultiplier, SetAdamBeta1/2, SetAdamEpsilon, SetAdamWeightDecay, SetRMSPropDecay, SetAdadeltaRho, SetAdadeltaEpsilon), and EnableShuffleData/DisableShuffleData. |
| Input & output scaling | SetScalingAlgorithm, SetInputScalingMinMax, SetOutputScalingMinMax. |
| Accuracy & overfitting | SetPercentTestingData, SetEarlyStoppingPatience, SetDropoutRate, SetWeightInit, SetGradientClipNorm, SetErrorAlgorithm, SetHuberDelta. |
| Housekeeping | SetSeed, SetVersion, SetMaximumThreads, RestoreDefaults, EnableProgress/DisableProgress, EnableNetworkToAFL/DisableNetworkToAFL. |