WiseTrader Toolbox

Settings Reference

This is the lookup page for every neural-network configuration function. Each is shown with its arguments, a one-line description, and its default value where it has one. For fuller explanations, follow the cross-links to the themed pages. Call these functions before you train, and call RestoreDefaults() at the end of your formula.

Warning

Settings persist for the formula until you reset them. Always finish a neural-network formula with RestoreDefaults() so leftover settings don't carry into the next run or formula.

Model & architecture

See Network Architectures, TCN & Transformer and Activation Functions for detail.

FunctionDescription — default
SetNeuralNetworkType(type)Model: 0 = MLP, 1 = LSTM, 2 = GRU, 3 = TCN, 4 = Transformer. Default 0 (MLP).
SetRecurrentParams(hidden, layers, seqLen)Hidden units, recurrent layers, and window length for LSTM/GRU. layers builds a genuinely stacked multi-layer network. Ignored for the MLP.
SetTcnParams(channels, kernelSize, levels)TCN only. channels ≥ 1, kernelSize ≥ 2, levels ≥ 1. Default 16, 2, 4. Receptive field 1 + (kernelSize−1)·(2levels−1) is computed automatically.
SetTransformerParams(dModel, numHeads, numBlocks, seqLen)Transformer only. all ≥ 1 and dModel divisible by numHeads. Default 16, 2, 2, 16. Feed-forward width is 4·dModel.
SetNetworkLayer1…4(n1[, n2[, n3[, n4]]])Hidden-layer neuron counts (sigmoid activation on every layer). 1–4 layers, 1–100 neurons each. MLP.
SetNetworkWithActivationLayer1…4(n1, a1, …, outAct)Hidden-layer (neurons, activation) pairs plus the output-layer activation. Activation codes 0–9. MLP.
SetLayerNorm(flag)MLP only. 0 = off (default), 1 = on. Layer Normalization on every hidden layer (output layer never normalized). Disables AFL export while on.
SetCategoricalInput(channelIndex, numCategories, embedDim)MLP only. channelIndex ≥ 0, numCategories ≥ 2, embedDim ≥ 1. Marks an input channel as categorical (integer IDs) mapped to a learned embedding; bypasses input scaling. Call once per categorical channel (accumulates). Disables AFL export. Default: none declared.

Training algorithm, rate & schedule

See Training Algorithms for detail and the full optimizer code table. The learning-rate schedule is honoured by every model type (MLP, LSTM, GRU, TCN, Transformer), not just the MLP.

FunctionDescription — default
SetLearningAlgorithm(code)Optimizer, codes 0–13. Default 0 (Backpropagation).
SetLearningRate(rate)Weight-update step size (0–20). Default 0.2. Adam family wants ~0.001–0.005.
SetMomentum(m)Momentum for Backprop / Nesterov (0–1). Default 0.
SetSarpropTemperature(t)SARPROP temperature (0–1). Default 0.02.
SetLearningRateSchedule(type)0 const, 1 step, 2 cosine, 3 SGDR. Default 0.
SetLRScheduleStep(epochs)Step size / cosine length / first SGDR cycle (≥1). Default 50.
SetLRStepDecayFactor(f)Step-decay multiplier (0–1). Default 0.5.
SetLRScheduleMinPercent(p)Schedule floor as a fraction of base rate (0–<1). Default 0.
SetSGDRCycleMultiplier(m)SGDR cycle-length growth (≥1). Default 2.0.

Optimizer hyperparameters

FunctionDescription — default
SetAdamBeta1(b)First-moment decay, 0<b<1. Default 0.9.
SetAdamBeta2(b)Second-moment decay, 0<b<1. Default 0.999.
SetAdamEpsilon(e)Numerical-stability constant, e>0. Default 1e-8.
SetAdamWeightDecay(wd)AdamW weight decay, wd≥0. Default 0.01.
SetRMSPropDecay(r)RMSProp decay, 0<r<1. Default 0.9.
SetAdadeltaRho(r)Adadelta rho, 0<r<1. Default 0.95.
SetAdadeltaEpsilon(e)Adadelta epsilon, e>0. Default 1e-6.

Accuracy & regularization

See Accuracy & Avoiding Overfitting — the most important settings here.

FunctionDescription — default
SetPercentTestingData(pct)Hold back the most recent pct% as unseen test data and select the best test-error network (0–100). Default 0 (off).
SetEarlyStoppingPatience(n)Stop if test error hasn't improved for n epochs (≥0). Default 0 (off).
SetDropoutRate(p)Hidden-unit dropout while training (0–<1). Default 0 (off).
SetWeightInit(mode)0 uniform, 1 Xavier, 2 He. Default 0.
SetGradientClipNorm(n)Cap the gradient size to stabilise training (≥0). Default 0 (off).
SetErrorAlgorithm(code)Loss: 0 linear, 1 tanh, 2 Huber. Default 1 (tanh).
SetHuberDelta(d)Huber transition point, d>0 (with error code 2). Default 1.0.

Scaling

See Input & Output Scaling for detail.

FunctionDescription — default
SetScalingAlgorithm(algo)0 = Mean/StdDev (default), 1 = Min/Max.
SetInputScalingMinMax(min, max)Internal range inputs are scaled into (−2 to 2, min<max). Default 0..1.
SetOutputScalingMinMax(min, max)Internal range the output is scaled into (−2 to 2, min<max). Default 0..1.

Data & training control

FunctionDescription — default
SetMaximumEpochs(n)Maximum training passes over the data.
SetBatchSize(n)0 = full batch (default); n>0 = minibatch of n. Honoured by the sequence models (LSTM/GRU/TCN/Transformer) too — real mini-batch over whole sequences — as well as the MLP.
EnableShuffleData() / DisableShuffleData()Reshuffle data order each epoch (for minibatch mode). Default disabled.
SetMaximumThreads(n)Worker threads for the interactive train (1 … number of CPUs).
SetEnsembleSize(k)Train k seed-varied networks and average their predictions (k ≥ 1; default 1). Any model type. Members save as <file>.0…<file>.{k−1}; the run path discovers and averages them automatically. Disables AFL export while k > 1. See Ensembling.

Reproducibility & versioning

FunctionDescription
SetSeed(n)Fix the random seed (n ≥ 1) so a run is repeatable.
SetVersion(n)Version tag (n ≥ 0) used to bust the Walk-Forward indicator cache — bump it to force a retrain. See Neural Network Functions.

Output, progress & cleanup

FunctionDescription
EnableProgress() / DisableProgress()Show or hide the training progress window.
EnableNetworkToAFL() / DisableNetworkToAFL()Export the trained MLP as an AFL formula alongside the saved network. Auto-skipped (with a trace message) when the config can't be a formula — any sequence model, LayerNorm on, categorical embeddings declared, or ensemble size > 1. See Neural Network Functions.
RestoreDefaults()Reset every neural-network setting to its default. Call this at the end of every formula.
Note

Every setting defaults to "off / no change", so a formula that sets nothing trains a plain MLP with the standard defaults. Out-of-range values are rejected with a trace message and leave the setting unchanged.