Loading, please wait...
The complete formula guide for algorithmic traders. Search mathematical definitions, input parameters, and real-world condition recipes for every token in Strategy Builder.
smaCalculates the unweighted arithmetic mean of a selected price field over a specified period.
SMA = (P1 + P2 + ... + Pn) / n
Smooths price fluctuations to identify trend direction. Price crossing above SMA indicates upward momentum; crossing below indicates downward momentum.
| Parameter | Default | Description |
|---|---|---|
| Timeframe | Daily | Lookback interval (e.g. 1m, 5m, 15m, Daily) |
| OHLC | close | Price component evaluated (open, high, low, close, volume) |
| Period | 9 | Number of lookback bars included in calculation |
[0]Daily close > [0]Daily sma(close, 50)emaA weighted moving average that assigns greater weight and significance to recent price data.
EMA_t = (Price_t * (2 / (n + 1))) + (EMA_{t-1} * (1 - (2 / (n + 1))))Reacts faster to recent price action than an SMA. Widely used for short-term swing trading and momentum entries.
| Parameter | Default | Description |
|---|---|---|
| Timeframe | Daily | Lookback interval (e.g. 1m, 5m, 15m, Daily) |
| OHLC | close | Price component evaluated |
| Period | 9 | Number of periods (e.g. 9, 21, 50, 200) |
[0]Daily ema(close, 9) > [0]Daily ema(close, 21)rsiA momentum oscillator measuring the speed and velocity of recent price movements on a scale from 0 to 100.
RSI = 100 - (100 / (1 + RS)), where RS = Average Gain / Average Loss over period n
RSI above 70 suggests overbought conditions (potential reversal or strong trend); RSI below 30 suggests oversold conditions. Values above 50 indicate bullish momentum.
| Parameter | Default | Description |
|---|---|---|
| Timeframe | Daily | Lookback interval |
| OHLC | close | Price component evaluated |
| Period | 14 | Standard default is 14 periods |
[0]Daily rsi(close, 14) < 30BBbasisThe middle band of the Bollinger Bands indicator, representing the baseline moving average.
BBbasis = SMA(Close, Period)
Acts as dynamic fair value or median price. Serves as mean reversion target when price stretches away towards the outer bands.
| Parameter | Default | Description |
|---|---|---|
| Timeframe | Daily | Lookback interval |
| Period | 20 | Base moving average period |
| MA Type | sma | Underlying smoothing type (SMA/EMA) |
| OHLC | close | Price series used |
| Std Dev | 2 | Standard deviation multiplier |
[0]Daily close > [0]Daily BBbasis(20, sma, close, 2)BBupperThe upper volatility envelope of Bollinger Bands set k standard deviations above the middle baseline.
BBupper = BBbasis + (StdDevMultiplier * StandardDeviation(Period))
Prices touching or piercing BBupper indicate statistically stretched high prices or strong upward volatility breakout.
| Parameter | Default | Description |
|---|---|---|
| Timeframe | Daily | Lookback interval |
| Period | 20 | Base moving average period |
| MA Type | sma | Smoothing method |
| OHLC | close | Price series |
| Std Dev | 2 | Standard deviation multiplier (typically 2.0) |
[0]Daily close > [0]Daily BBupper(20, sma, close, 2)BBlowerThe lower volatility envelope of Bollinger Bands set k standard deviations below the middle baseline.
BBlower = BBbasis - (StdDevMultiplier * StandardDeviation(Period))
Indicates statistically oversold extreme. Piercing below BBlower followed by closing back above is a common dip-buying setup.
| Parameter | Default | Description |
|---|---|---|
| Timeframe | Daily | Lookback interval |
| Period | 20 | Base moving average period |
| MA Type | sma | Smoothing method |
| OHLC | close | Price series |
| Std Dev | 2 | Standard deviation multiplier |
[0]Daily close < [0]Daily BBlower(20, sma, close, 2)macdLineCalculates the difference between a fast exponential moving average and a slow exponential moving average.
macdLine = EMA(Close, FastPeriod) - EMA(Close, SlowPeriod)
Positive MACD line values denote bullish momentum; negative values denote bearish momentum. Direction of slope reflects acceleration.
| Parameter | Default | Description |
|---|---|---|
| Timeframe | Daily | Lookback interval |
| Fast Period | 12 | Fast EMA length |
| Slow Period | 26 | Slow EMA length |
| Signal Period | 9 | Signal smoothing length |
| OHLC | close | Price field |
[0]Daily macdLine(12, 26, 9, close) > 0signalLineAn exponential moving average of the MACD Line, serving as a trigger for buy and sell signals.
signalLine = EMA(macdLine, SignalPeriod)
When MACD Line crosses above Signal Line, it confirms bullish acceleration; when it falls below, it signals weakening momentum.
| Parameter | Default | Description |
|---|---|---|
| Timeframe | Daily | Lookback interval |
| Fast Period | 12 | Fast EMA length |
| Slow Period | 26 | Slow EMA length |
| Signal Period | 9 | Signal smoothing period |
| OHLC | close | Price field |
[0]Daily macdLine(12, 26, 9, close) > [0]Daily signalLine(12, 26, 9, close)macdHistogramRepresents the distance between the MACD Line and the Signal Line.
macdHistogram = macdLine - signalLine
Expanding bars indicate increasing momentum; contracting bars indicate momentum slowdown (early reversal signal).
| Parameter | Default | Description |
|---|---|---|
| Timeframe | Daily | Lookback interval |
| Fast Period | 12 | Fast EMA length |
| Slow Period | 26 | Slow EMA length |
| Signal Period | 9 | Signal smoothing period |
| OHLC | close | Price field |
[0]Daily macdHistogram(12, 26, 9, close) > 0supertrendA trend-following overlay based on Average True Range (ATR) that generates clean trailing stops and directional trend switches.
UpperBand = (High + Low)/2 + (Multiplier * ATR); LowerBand = (High + Low)/2 - (Multiplier * ATR)
When price is above the Supertrend line, the market is in an uptrend (Supertrend acts as support). When price breaks below, it flips to an active downtrend.
| Parameter | Default | Description |
|---|---|---|
| Timeframe | Daily | Lookback interval |
| Period | 10 | ATR period length |
| Multiplier | 3 | ATR multiplier distance |
[0]Daily close > [0]Daily supertrend(10, 3)atrA market volatility indicator showing how much an asset moves, on average, during a given time-frame.
TR = Max(High - Low, |High - Close_prev|, |Low - Close_prev|); ATR = RMA(TR, Period)
High ATR indicates high market volatility (large price swings); low ATR indicates consolidation or quiet ranges.
| Parameter | Default | Description |
|---|---|---|
| Timeframe | Daily | Lookback interval |
| Period | 14 | Number of lookback bars |
| Smoothing | RMA | Running moving average (Wilder's) |
[0]Daily atr(14, RMA) > 15ichimokuA comprehensive trend indicator comprising Tenkan-sen (Conversion), Kijun-sen (Base), Senkou Span A/B, and Chikou Span (Lagging).
Conversion = (9-period High + 9-period Low) / 2; Base = (26-period High + 26-period Low) / 2
Bullish when Price is above Cloud (Span A & B) and Conversion Line is above Base Line. Bearish when below Cloud.
| Parameter | Default | Description |
|---|---|---|
| Conversion Line (Tenkan) | 9 | Short-term cycle |
| Base Line (Kijun) | 26 | Medium-term cycle / trend benchmark |
| Leading Span B (Senkou B) | 52 | Long-term cycle |
| Displacement | 26 | Projection shift into future/past |
[0]Daily conversionLineIC(9, 26, 52, 26) > [0]Daily baseLineIC(9, 26, 52, 26)momentumMeasures the velocity of price changes by comparing the current closing price with the closing price n bars ago.
Momentum = Close_t - Close_{t-n}Values above 0 mean price is higher than n bars ago (positive momentum); values below 0 denote downward velocity.
| Parameter | Default | Description |
|---|---|---|
| Timeframe | Daily | Lookback interval |
| Period | 10 | Number of bars ago |
| OHLC | close | Price component |
[0]Daily momentum(10, close) > 0rocA percentage-based momentum oscillator measuring the percentage change between current price and price n periods ago.
ROC = ((Close_t - Close_{t-n}) / Close_{t-n}) * 100Cross above 0 indicates bullish trend shift; sharp spikes in ROC denote strong breakout power or exhaustion.
| Parameter | Default | Description |
|---|---|---|
| Timeframe | Daily | Lookback interval |
| Period | 10 | Lookback period |
| OHLC | close | Price component |
[0]Daily roc(10, close) > 0cciAn oscillator that measures an asset's current price level relative to an average price level over a given period.
CCI = (TypicalPrice - SMA(TP, n)) / (0.015 * MeanDeviation(TP, n))
Values above +100 signal strong uptrend or overbought; values below -100 signal strong downtrend or oversold condition.
| Parameter | Default | Description |
|---|---|---|
| Timeframe | Daily | Lookback interval |
| Period | 20 | Lookback bars |
| Price | hlc | Typical price (High + Low + Close) / 3 |
[0]Daily cci(20, hlc) < -100williamsPercentRA momentum indicator that measures overbought and oversold levels, oscillating between 0 and -100.
%R = (HighestHigh_n - Close) / (HighestHigh_n - LowestLow_n) * -100
Readings between 0 and -20 indicate overbought; readings between -80 and -100 indicate oversold.
| Parameter | Default | Description |
|---|---|---|
| Timeframe | Daily | Lookback interval |
| Period | 20 | Lookback bars |
| OHLC | close | Price field |
[0]Daily williamsPercentR(20, close) < -80cmoCalculates momentum on both up and down days, oscillating between +100 and -100.
CMO = ((SumGains - SumLosses) / (SumGains + SumLosses)) * 100
CMO above +50 indicates extreme overbought; CMO below -50 indicates extreme oversold; 0-line cross indicates momentum shift.
| Parameter | Default | Description |
|---|---|---|
| Timeframe | Daily | Lookback interval |
| Period | 14 | Lookback period |
| OHLC | close | Price field |
[0]Daily cmo(14, close) > 0cmfMeasures Money Flow Volume over a set period, reflecting institutional accumulation or distribution.
MFV = ((Close - Low) - (High - Close)) / (High - Low) * Volume; CMF = Sum(MFV, n) / Sum(Volume, n)
CMF > 0 indicates institutional buying pressure (accumulation); CMF < 0 indicates selling pressure (distribution).
| Parameter | Default | Description |
|---|---|---|
| Timeframe | Daily | Lookback interval |
| Period | 20 | Lookback period |
[0]Daily cmf(20) > 0.05donchianFormed by taking the highest high and the lowest low of the last n periods (famous for Turtle Trading breakouts).
Upper = Max(High, n); Lower = Min(Low, n); Middle = (Upper + Lower) / 2
Price piercing Donchian Upper marks a new n-period high; price piercing Donchian Lower marks a new n-period low.
| Parameter | Default | Description |
|---|---|---|
| Timeframe | Daily | Lookback interval |
| Period | 20 | Lookback bars (e.g. 20, 55 for Turtle rules) |
[0]Daily close > [0]Daily donchianUpper(20)keltnerVolatility-based envelopes set above and below an exponential moving average, spaced using Average True Range.
Basis = EMA(Close, n); Upper = Basis + (Multiplier * ATR); Lower = Basis - (Multiplier * ATR)
Combines trend (EMA) with volatility (ATR). Used with Bollinger Bands to detect volatility 'squeezes'.
| Parameter | Default | Description |
|---|---|---|
| Timeframe | Daily | Lookback interval |
| Period | 20 | EMA baseline period |
| Multiplier | 2.0 | ATR distance multiplier |
[0]Daily close > [0]Daily keltnerUpper(20, 2.0)camarillaIntraday support and resistance levels derived from previous session high, low, and close, providing key reversal and breakout trigger points.
H4 = Close + (High - Low) * 1.1 / 2; H3 = Close + (High - Low) * 1.1 / 4; L3 = Close - (High - Low) * 1.1 / 4; L4 = Close - (High - Low) * 1.1 / 2
H3/L3 are mean-reversion reversal zones (range traders buy at L3, short at H3). H4/L4 are breakout thresholds.
| Parameter | Default | Description |
|---|---|---|
| Timeframe | Daily | Session lookback (Daily) |
| Level | H3 / L3 / H4 / L4 | Target support or resistance tier |
[0]Daily close > [0]Daily H4cprA 3-level price band comprising Pivot Point (PP), Bottom Central (BC), and Top Central (TC), defining the daily market bias.
PP = (High + Low + Close) / 3; BC = (High + Low) / 2; TC = (PP - BC) + PP
Narrow CPR signals an imminent trending day; wide CPR signals sideways consolidation. Price opening above TC signals bullish day.
| Parameter | Default | Description |
|---|---|---|
| Timeframe | Daily | Base lookback period |
| Level | CPRPP / CPRBC / CPRTC | CPR component |
[0]Daily close > [0]Daily CPRTCpivotClassic floor trader pivot support (S1-S4) and resistance (R1-R4) levels calculated from prior day's range.
PP = (H + L + C) / 3; R1 = 2*PP - L; S1 = 2*PP - H; R2 = PP + (H - L); S2 = PP - (H - L)
R1-R4 represent progressive resistance hurdles; S1-S4 represent progressive support floors.
| Parameter | Default | Description |
|---|---|---|
| Timeframe | Daily | Base lookback period |
| Level | pivotR1 .. pivotR4, pivotS1 .. pivotS4 | Support / Resistance tier |
[0]Daily close > [0]Daily pivotR1stochasticRSIApplies the Stochastic oscillator formula to RSI values rather than standard price data, creating an ultra-sensitive momentum tool.
StochRSI = (RSI - Min(RSI, n)) / (Max(RSI, n) - Min(RSI, n)); K = SMA(StochRSI, smoothK); D = SMA(K, smoothD)
Oscillates between 0 and 100. Oversold below 20; overbought above 80. Bullish cross occurs when K crosses above D below 20.
| Parameter | Default | Description |
|---|---|---|
| Timeframe | Daily | Lookback interval |
| Smooth K | 3 | K line smoothing |
| Smooth D | 3 | D line smoothing |
| RSI Length | 14 | Underlying RSI period |
| Stoch Length | 14 | Stochastic lookback |
| OHLC | close | Price field |
[0]Daily stochasticRSIK(3, 3, 14, 14, close) < 20ceilRounds any numerical expression or indicator output upwards to the nearest integer.
ceil(x) = smallest integer >= x
Ensures whole number values without truncation (e.g. ceil(4.1) = 5).
| Parameter | Default | Description |
|---|---|---|
| Expression | formula | Any indicator, price value, or math computation |
ceil( [0]Daily close / 100 ) > 5floorRounds any numerical expression or indicator output downwards to the nearest integer.
floor(x) = largest integer <= x
Drops fractional remainder (e.g. floor(4.9) = 4).
| Parameter | Default | Description |
|---|---|---|
| Expression | formula | Any indicator, price value, or math computation |
floor( [0]Daily close / 50 ) > 10absReturns the non-negative magnitude of a number or expression regardless of sign.
abs(x) = |x|
Converts negative values to positive (e.g. abs(-15) = 15).
| Parameter | Default | Description |
|---|---|---|
| Expression | formula | Any numerical difference or indicator value |
abs( [0]Daily close - [0]Daily sma(close, 20) ) > 10log10Computes the base-10 logarithm of a positive numerical expression.
y = log10(x) <=> 10^y = x
Compresses exponential volume and price magnitudes into linear decibel scales.
| Parameter | Default | Description |
|---|---|---|
| Expression | formula | Positive numerical value |
log10( [0]Daily volume ) > 6logComputes the natural base-e logarithm of a positive numerical expression.
y = ln(x) <=> e^y = x
Standard mathematical tool for continuously compounded returns and statistical log-normal distribution modeling.
| Parameter | Default | Description |
|---|---|---|
| Expression | formula | Positive numerical value |
log( [0]Daily close ) > 4maxReturns the maximum value of an indicator or price series over a specified lookback window.
Max(Series, Period) = highest value in the last n bars
Identifies swing highs or indicator peaks over the specified lookback.
| Parameter | Default | Description |
|---|---|---|
| Period | 20 | Lookback window length |
[0]Daily close >= max( 20, [0]Daily high )minReturns the minimum value of an indicator or price series over a specified lookback window.
Min(Series, Period) = lowest value in the last n bars
Identifies swing lows or indicator troughs over the specified lookback.
| Parameter | Default | Description |
|---|---|---|
| Period | 20 | Lookback window length |
[0]Daily close <= min( 20, [0]Daily low )+Arithmetic addition operator to sum two values, indicators, or offsets.
A + B
Adds numeric terms together.
| Parameter | Default | Description |
|---|---|---|
| Left Operand | Value A | First number or indicator |
| Right Operand | Value B | Second number or indicator |
[0]Daily close + [0]Daily atr(14, RMA) > 100-Arithmetic subtraction operator to calculate difference or buffer between values.
A - B
Subtracts the right operand from the left operand.
| Parameter | Default | Description |
|---|---|---|
| Left Operand | Value A | Minuend |
| Right Operand | Value B | Subtrahend |
[0]Daily close - [0]Daily atr(14, RMA) < 500*Arithmetic multiplication operator for scaling factors, ratios, and percentages.
A * B
Multiplies two quantities.
| Parameter | Default | Description |
|---|---|---|
| Left Operand | Value A | Base indicator |
| Right Operand | Multiplier | Scale factor (e.g. 1.05 for +5%) |
[0]Daily close * 1.05 > [0]Daily high/Arithmetic division operator to compute ratios, relative performance, or proportions.
A / B
Divides numerator by denominator.
| Parameter | Default | Description |
|---|---|---|
| Numerator | Value A | Value to divide |
| Denominator | Value B | Divisor value |
[0]Daily close / [0]Daily sma(close, 20) > 1.02<Relational operator evaluating true if left operand is strictly less than right operand.
A < B
Evaluates to true when A is lower than B.
| Parameter | Default | Description |
|---|---|---|
| Left Side | Indicator A | Value to compare |
| Right Side | Indicator B | Threshold or reference value |
[0]Daily rsi(close, 14) < 30>Relational operator evaluating true if left operand is strictly greater than right operand.
A > B
Evaluates to true when A is higher than B.
| Parameter | Default | Description |
|---|---|---|
| Left Side | Indicator A | Value to compare |
| Right Side | Indicator B | Threshold or reference value |
[0]Daily close > [0]Daily sma(close, 50)<=Relational operator evaluating true if left operand is less than or equal to right operand.
A <= B
Returns true if value is on or below the ceiling threshold.
| Parameter | Default | Description |
|---|---|---|
| Left Side | Indicator A | Value to compare |
| Right Side | Indicator B | Cap threshold |
[0]Daily rsi(close, 14) <= 30>=Relational operator evaluating true if left operand is greater than or equal to right operand.
A >= B
Returns true if value is on or above the floor threshold.
| Parameter | Default | Description |
|---|---|---|
| Left Side | Indicator A | Value to compare |
| Right Side | Indicator B | Floor threshold |
[0]Daily volume >= 500000==Relational equality operator evaluating true if both operands have identical values.
A == B
Exact identity check.
| Parameter | Default | Description |
|---|---|---|
| Left Side | State/Value A | Primary state |
| Right Side | Target B | Exact match target |
[0]Daily open_trade == 0!=Relational inequality operator evaluating true if left and right operands differ.
A != B
True if values do not match.
| Parameter | Default | Description |
|---|---|---|
| Left Side | State A | Current value |
| Right Side | Excluded B | Forbidden state |
[0]Daily open_trade != 0closeThe final traded price of a completed or active candlestick interval.
Close price of candle at offset [n]
The most widely referenced price point in technical analysis and backtesting.
| Parameter | Default | Description |
|---|---|---|
| Offset | 0 | 0 = Current candle, 1 = Previous candle, etc. |
| Timeframe | Daily | Interval timeframe (1m to Monthly) |
[0]Daily close > [1]Daily highopenThe first traded price recorded when a candlestick interval opened.
Open price of candle at offset [n]
Reflects overnight sentiment or initial session momentum.
| Parameter | Default | Description |
|---|---|---|
| Offset | 0 | Candle lookback index |
| Timeframe | Daily | Selected timeframe |
[0]Daily close > [0]Daily openhighThe peak price reached during the candlestick interval.
High price of candle at offset [n]
Represents maximum buying power / upward reach during the period.
| Parameter | Default | Description |
|---|---|---|
| Offset | 0 | Candle lookback index |
| Timeframe | Daily | Selected timeframe |
[0]Daily high > [1]Daily highlowThe lowest price reached during the candlestick interval.
Low price of candle at offset [n]
Represents maximum selling pressure / bottom floor during the period.
| Parameter | Default | Description |
|---|---|---|
| Offset | 0 | Candle lookback index |
| Timeframe | Daily | Selected timeframe |
[0]Daily low > [1]Daily lowvolumeThe total number of shares or contracts traded during the candlestick interval.
Sum of all shares executed in candle [n]
Validates price moves. High volume on breakouts suggests institutional accumulation; low volume suggests false breakouts.
| Parameter | Default | Description |
|---|---|---|
| Offset | 0 | Candle lookback index |
| Timeframe | Daily | Selected timeframe |
[0]Daily volume > 1000000numberA fixed constant numerical value entered into a condition equation (e.g. 50, 100, 0.05).
Constant numeric scalar
Serves as constant thresholds, levels, or multipliers.
| Parameter | Default | Description |
|---|---|---|
| Value | 20 | Fixed numeric scalar |
[0]Daily close > 50number_of_tradesTracks the total number of trades executed within a Daily, Weekly, Monthly, or Yearly window.
Count(Completed_Trades, Window)
Prevents overtrading by limiting how many positions a strategy can initiate per day or week.
| Parameter | Default | Description |
|---|---|---|
| Frequency | Daily | Daily, Weekly, Monthly, Yearly |
| Metric | count | count, value, quantity |
| Type | entry | entry, exit, or all |
| Label | Optional specific trade label filter |
Daily number_of_trades(count, entry) < 2timeThe current intra-day bar time (e.g. 09:30, 15:15) used for session timing and intraday square-offs.
Current Bar Clock (HH:MM)
Allows intraday rules to trade only during specific market hours.
| Parameter | Default | Description |
|---|---|---|
| Format | HH:MM | Market session timestamp |
time >= 09:30datetimeFull calendar timestamp (YYYY-MM-DD HH:MM) for absolute date-time conditioning.
ISO Timestamp
Controls trade execution around specific calendar events, earnings dates, or holiday expirations.
| Parameter | Default | Description |
|---|---|---|
| Format | YYYY-MM-DD HH:MM | Full calendar timestamp |
datetime >= 2024-01-01 09:15rememberSaves and stores dynamic runtime variables (e.g., initial entry price, indicator peak, breakout level) for later recall in exit logic.
variable_store[key] = evaluated_expression
Enables multi-step stateful trading: remember entry price, remember highest high since entry, or trail custom stops.
| Parameter | Default | Description |
|---|---|---|
| Scope | entry | Context scope (entry, exit, session) |
| Type | entry | Reference type |
| Key | first_entry | Unique variable name key |
[0]Daily close > remember(entry, entry, first_entry)open_tradeReflects the current active position state, trade count, or open quantity in the backtested asset.
Current Open Positions Count / Quantity
0 indicates no open position (flat); > 0 indicates an active open position.
| Parameter | Default | Description |
|---|---|---|
| Metric | count | count, value, quantity |
| Type | entry | entry, exit, all |
| Label | Optional trade tag |
open_trade(count, entry) == 0percentage_quantityDefines partial position exit fractions (e.g. exit 50% at Target 1, remaining 50% at Target 2).
Exit_Quantity = Total_Position * (Percent / 100)
Enables partial profit-taking without closing the entire position.
| Parameter | Default | Description |
|---|---|---|
| Percent | 100 | Percentage of active position to close (e.g. 50, 100) |
percentage_quantity == 50first_entryRetrieves the fill price and timestamp of the initial trade entry in a multi-step pyramid order.
price_of(Trade.first_entry)
Maintains reference to original cost basis even after scaling in or pyramiding.
| Parameter | Default | Description |
|---|---|---|
| Attribute | price | Price or timestamp of first fill |
[0]Daily close > first_entry * 1.03add_datetimeCalculates an offset calendar datetime by adding days, hours, or minutes to a trade entry timestamp.
TargetDateTime = EntryDateTime + Days + Hours + Minutes
Enforces time-based exits (e.g. 'exit trade exactly 5 trading days after entry').
| Parameter | Default | Description |
|---|---|---|
| Reference | first_entry | first_entry or previous_entry |
| Days | 0 | Days to add |
| Hours | 0 | Hours to add |
| Minutes | 0 | Minutes to add |
datetime >= add_datetime(first_entry, 5, 0, 0)add_timeCalculates an intraday time offset by adding hours and minutes to entry execution time.
TargetTime = EntryTime + Hours + Minutes
Enforces intraday bar holding time limits (e.g. exit after 45 minutes).
| Parameter | Default | Description |
|---|---|---|
| Reference | first_entry | first_entry or previous_trade |
| Hours | 0 | Hours to add |
| Minutes | 0 | Minutes to add |
time >= add_time(first_entry, 0, 30)()Grouping brackets that control the order of precedence in mathematical and logical condition expressions.
(Expression A) AND (Expression B)
Expressions inside parentheses are evaluated first, resolving arithmetic precedence and boolean grouping.
| Parameter | Default | Description |
|---|---|---|
| Expression | inner | Nested sub-expression |
( [0]Daily high + [0]Daily low ) / 2 > 100optimization(Wraps parameter variables to define range scans (start, stop, step) during automated Parameter Optimization mode.
optimization(Start, Stop, Step, Label)
Replaces hardcoded indicator values with a dynamic parameter grid to test multiple parameter iterations concurrently.
| Parameter | Default | Description |
|---|---|---|
| Label | opt_label | Unique parameter label |
| Value Range | [min, max, step] | Tested parameter values during grid scan |
optimization( 14 ) > 10opt_labelAssigns a designated human-readable identifier and step value to a parameter in the Optimization Config Panel.
opt_label: { name: 'RSI_Period', default: 14 }Tags parameters so their results are clearly columned in the Optimization Results Table.
| Parameter | Default | Description |
|---|---|---|
| Label | default | Label name string |
| Index | 1 | Parameter index sequence |
opt_label( 1 ) > 10