use super::*;
const fn input(role: &'static str, default: Option<&'static str>) -> StudyInput {
StudyInput { role, default }
}
const fn output(id: &'static str, unit: StudyUnit) -> StudyOutput {
StudyOutput { id, unit }
}
pub static STUDIES: &[StudyDescriptor] = &[
StudyDescriptor {
name: "sma",
family: StudyFamily::MovingAverage,
summary: "Simple moving average of a column",
inputs: &[input("column", Some("close"))],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: None,
example: Some(20.0),
min: Some(1.0),
max: None,
suggest: Some((5.0, 200.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("sma"),
outputs: &[output("", StudyUnit::Inherit)],
anchor: None,
},
StudyDescriptor {
name: "ema",
family: StudyFamily::MovingAverage,
summary: "Exponential moving average, span convention (α = 2/(period+1))",
inputs: &[input("column", Some("close"))],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: None,
example: Some(20.0),
min: Some(1.0),
max: None,
suggest: Some((5.0, 200.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("ema"),
outputs: &[output("", StudyUnit::Inherit)],
anchor: None,
},
StudyDescriptor {
name: "movingAverage",
family: StudyFamily::MovingAverage,
summary: "Moving average of a selectable type (the shared MaType menu)",
inputs: &[input("column", Some("close"))],
params: &[
StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: None,
example: Some(20.0),
min: Some(1.0),
max: None,
suggest: Some((5.0, 200.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "type",
kind: ParamKind::Enum {
of: &[
"sma", "ema", "wma", "smma", "dema", "tema", "trima", "hull", "kama",
"zlema",
],
default: Some("sma"),
example: None,
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Output("ma"),
outputs: &[output("", StudyUnit::Inherit)],
anchor: None,
},
StudyDescriptor {
name: "macd",
family: StudyFamily::MovingAverage,
summary: "Appel's MACD — a fast/slow EMA spread with its signal line",
inputs: &[input("column", Some("close"))],
params: &[
StudyParam {
name: "fastPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(12.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 20.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "slowPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(26.0),
example: None,
min: None,
max: None,
suggest: Some((20.0, 60.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "signalPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(9.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((3.0, 20.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Prefix("macd"),
outputs: &[
output("Line", StudyUnit::Delta),
output("Signal", StudyUnit::Delta),
output("Hist", StudyUnit::Delta),
],
anchor: None,
},
StudyDescriptor {
name: "movingAverageCross",
family: StudyFamily::MovingAverage,
summary: "Fast/slow moving-average crossings as a +1/−1 event column",
inputs: &[input("column", Some("close"))],
params: &[
StudyParam {
name: "fastPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(10.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 25.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "slowPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(30.0),
example: None,
min: None,
max: None,
suggest: Some((15.0, 200.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "maType",
kind: ParamKind::Enum {
of: &[
"sma", "ema", "wma", "smma", "dema", "tema", "trima", "hull", "kama",
"zlema",
],
default: Some("sma"),
example: None,
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Output("maCross"),
outputs: &[output("", StudyUnit::Signal)],
anchor: None,
},
StudyDescriptor {
name: "movingAverageDeviation",
family: StudyFamily::MovingAverage,
summary: "How far price sits from its moving average, in price units",
inputs: &[input("column", Some("close"))],
params: &[
StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(20.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 100.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "maType",
kind: ParamKind::Enum {
of: &[
"sma", "ema", "wma", "smma", "dema", "tema", "trima", "hull", "kama",
"zlema",
],
default: Some("sma"),
example: None,
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Output("maDev"),
outputs: &[output("", StudyUnit::Delta)],
anchor: None,
},
StudyDescriptor {
name: "guppy",
family: StudyFamily::MovingAverage,
summary: "Guppy's GMMA — the fixed twelve-average trader/investor ribbon",
inputs: &[input("column", Some("close"))],
params: &[StudyParam {
name: "type",
kind: ParamKind::Enum {
of: &[
"sma", "ema", "wma", "smma", "dema", "tema", "trima", "hull", "kama", "zlema",
],
default: Some("ema"),
example: None,
},
optional: false,
requires: None,
}],
naming: StudyNaming::Prefix("gmma"),
outputs: &[
output("S3", StudyUnit::Inherit),
output("S5", StudyUnit::Inherit),
output("S8", StudyUnit::Inherit),
output("S10", StudyUnit::Inherit),
output("S12", StudyUnit::Inherit),
output("S15", StudyUnit::Inherit),
output("L30", StudyUnit::Inherit),
output("L35", StudyUnit::Inherit),
output("L40", StudyUnit::Inherit),
output("L45", StudyUnit::Inherit),
output("L50", StudyUnit::Inherit),
output("L60", StudyUnit::Inherit),
],
anchor: None,
},
StudyDescriptor {
name: "rainbow",
family: StudyFamily::MovingAverage,
summary: "Widner's Rainbow — ten recursively smoothed moving averages",
inputs: &[input("column", Some("close"))],
params: &[
StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(2.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((2.0, 10.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "type",
kind: ParamKind::Enum {
of: &[
"sma", "ema", "wma", "smma", "dema", "tema", "trima", "hull", "kama",
"zlema",
],
default: Some("sma"),
example: None,
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Prefix("rainbow"),
outputs: &[
output("1", StudyUnit::Inherit),
output("2", StudyUnit::Inherit),
output("3", StudyUnit::Inherit),
output("4", StudyUnit::Inherit),
output("5", StudyUnit::Inherit),
output("6", StudyUnit::Inherit),
output("7", StudyUnit::Inherit),
output("8", StudyUnit::Inherit),
output("9", StudyUnit::Inherit),
output("10", StudyUnit::Inherit),
],
anchor: None,
},
StudyDescriptor {
name: "rainbowOscillator",
family: StudyFamily::MovingAverage,
summary: "ChartIQ's rainbow oscillator, banded by the stack's own width",
inputs: &[input("column", Some("close"))],
params: &[
StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(2.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((2.0, 10.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "lookback",
kind: ParamKind::Number {
integer: true,
default: Some(10.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 50.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "type",
kind: ParamKind::Enum {
of: &[
"sma", "ema", "wma", "smma", "dema", "tema", "trima", "hull", "kama",
"zlema",
],
default: Some("sma"),
example: None,
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Prefix("rbo"),
outputs: &[
output("", StudyUnit::Percent),
output("Upper", StudyUnit::Percent),
output("Lower", StudyUnit::Percent),
],
anchor: None,
},
StudyDescriptor {
name: "trix",
family: StudyFamily::MovingAverage,
summary: "Hutson's TRIX — percent rate of change of a triple EMA",
inputs: &[input("column", Some("close"))],
params: &[
StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(15.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 40.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "signalPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(9.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((3.0, 20.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Prefix("trix"),
outputs: &[
output("", StudyUnit::Percent),
output("Signal", StudyUnit::Percent),
],
anchor: None,
},
StudyDescriptor {
name: "schaffTrendCycle",
family: StudyFamily::MovingAverage,
summary: "Schaff's double stochastic of a MACD, bounded 0…100",
inputs: &[input("column", Some("close"))],
params: &[
StudyParam {
name: "fastPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(23.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((10.0, 40.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "slowPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(50.0),
example: None,
min: None,
max: None,
suggest: Some((30.0, 100.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "cyclePeriod",
kind: ParamKind::Number {
integer: true,
default: Some(10.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Output("stc"),
outputs: &[output("", StudyUnit::Percent)],
anchor: None,
},
StudyDescriptor {
name: "detrendedPriceOscillator",
family: StudyFamily::MovingAverage,
summary: "Price less a moving average displaced ⌊period/2⌋+1 bars back",
inputs: &[input("column", Some("close"))],
params: &[
StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(20.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((10.0, 50.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "maType",
kind: ParamKind::Enum {
of: &[
"sma", "ema", "wma", "smma", "dema", "tema", "trima", "hull", "kama",
"zlema",
],
default: Some("sma"),
example: None,
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Output("dpo"),
outputs: &[output("", StudyUnit::Delta)],
anchor: None,
},
StudyDescriptor {
name: "disparityIndex",
family: StudyFamily::MovingAverage,
summary: "Nison's disparity — price against its moving average, in percent",
inputs: &[input("column", Some("close"))],
params: &[
StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(14.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 50.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "maType",
kind: ParamKind::Enum {
of: &[
"sma", "ema", "wma", "smma", "dema", "tema", "trima", "hull", "kama",
"zlema",
],
default: Some("sma"),
example: None,
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Output("disparity"),
outputs: &[output("", StudyUnit::Percent)],
anchor: None,
},
StudyDescriptor {
name: "coppock",
family: StudyFamily::MovingAverage,
summary: "Coppock Curve — a WMA of two percent rates of change, summed",
inputs: &[input("column", Some("close"))],
params: &[
StudyParam {
name: "longPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(14.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((8.0, 24.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "shortPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(11.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((6.0, 20.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "wmaPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(10.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 20.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Output("coppock"),
outputs: &[output("", StudyUnit::Percent)],
anchor: None,
},
StudyDescriptor {
name: "kst",
family: StudyFamily::MovingAverage,
summary: "Pring's Know Sure Thing — four weighted smoothed percent ROCs",
inputs: &[input("column", Some("close"))],
params: &[StudyParam {
name: "signalPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(9.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((3.0, 20.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Prefix("kst"),
outputs: &[
output("", StudyUnit::Percent),
output("Signal", StudyUnit::Percent),
],
anchor: None,
},
StudyDescriptor {
name: "specialK",
family: StudyFamily::MovingAverage,
summary: "Pring's Special K — the KST extended to twelve terms",
inputs: &[input("column", Some("close"))],
params: &[],
naming: StudyNaming::Output("specialK"),
outputs: &[output("", StudyUnit::Percent)],
anchor: None,
},
StudyDescriptor {
name: "priceOscillator",
family: StudyFamily::MovingAverage,
summary: "Fast/slow MA spread, as a percent (PPO) or in points (APO)",
inputs: &[input("column", Some("close"))],
params: &[
StudyParam {
name: "fastPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(12.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 20.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "slowPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(26.0),
example: None,
min: None,
max: None,
suggest: Some((20.0, 60.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "maType",
kind: ParamKind::Enum {
of: &[
"sma", "ema", "wma", "smma", "dema", "tema", "trima", "hull", "kama",
"zlema",
],
default: Some("ema"),
example: None,
},
optional: false,
requires: None,
},
StudyParam {
name: "mode",
kind: ParamKind::Enum {
of: &["percent", "absolute"],
default: Some("percent"),
example: None,
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Output("priceOsc"),
outputs: &[output("", StudyUnit::Percent)],
anchor: None,
},
StudyDescriptor {
name: "priceMomentumOscillator",
family: StudyFamily::MovingAverage,
summary: "DecisionPoint's PMO — a double-smoothed 1-bar percent ROC",
inputs: &[input("column", Some("close"))],
params: &[],
naming: StudyNaming::Prefix("pmo"),
outputs: &[
output("", StudyUnit::Percent),
output("Signal", StudyUnit::Percent),
],
anchor: None,
},
StudyDescriptor {
name: "bollinger",
family: StudyFamily::Bands,
summary: "Bollinger Bands — an SMA middle band with bands at ±k·σ",
inputs: &[input("column", Some("close"))],
params: &[
StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: None,
example: Some(20.0),
min: Some(1.0),
max: None,
suggest: Some((10.0, 50.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "stdDev",
kind: ParamKind::Number {
integer: false,
default: Some(2.0),
example: None,
min: None,
max: None,
suggest: Some((1.0, 3.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Prefix("bb"),
outputs: &[
output("Middle", StudyUnit::Inherit),
output("Upper", StudyUnit::Inherit),
output("Lower", StudyUnit::Inherit),
],
anchor: None,
},
StudyDescriptor {
name: "bollingerBandwidth",
family: StudyFamily::Bands,
summary: "Bollinger BandWidth — the channel's width in percent of price",
inputs: &[input("column", Some("close"))],
params: &[
StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(20.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((10.0, 50.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "stdDev",
kind: ParamKind::Number {
integer: false,
default: Some(2.0),
example: None,
min: None,
max: None,
suggest: Some((1.0, 3.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Output("bbWidth"),
outputs: &[output("", StudyUnit::Percent)],
anchor: None,
},
StudyDescriptor {
name: "bollingerPercentB",
family: StudyFamily::Bands,
summary: "Bollinger %B — where price sits inside its own channel",
inputs: &[input("column", Some("close"))],
params: &[
StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(20.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((10.0, 50.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "stdDev",
kind: ParamKind::Number {
integer: false,
default: Some(2.0),
example: None,
min: None,
max: None,
suggest: Some((1.0, 3.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Output("percentB"),
outputs: &[output("", StudyUnit::Ratio)],
anchor: None,
},
StudyDescriptor {
name: "keltner",
family: StudyFamily::Bands,
summary: "Keltner Channel — an EMA of typical price with bands at ±k·ATR",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[
StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(20.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((10.0, 50.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "atrPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(10.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "multiplier",
kind: ParamKind::Number {
integer: false,
default: Some(2.0),
example: None,
min: None,
max: None,
suggest: Some((1.0, 4.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "maType",
kind: ParamKind::Enum {
of: &[
"sma", "ema", "wma", "smma", "dema", "tema", "trima", "hull", "kama",
"zlema",
],
default: Some("ema"),
example: None,
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Prefix("kc"),
outputs: &[
output("Middle", StudyUnit::Inherit),
output("Upper", StudyUnit::Inherit),
output("Lower", StudyUnit::Inherit),
],
anchor: None,
},
StudyDescriptor {
name: "starcBands",
family: StudyFamily::Bands,
summary: "STARC Bands (Stoller) — an MA of close with bands at ±k·ATR",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[
StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(20.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((10.0, 50.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "atrPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(15.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "multiplier",
kind: ParamKind::Number {
integer: false,
default: Some(2.0),
example: None,
min: None,
max: None,
suggest: Some((1.0, 4.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "maType",
kind: ParamKind::Enum {
of: &[
"sma", "ema", "wma", "smma", "dema", "tema", "trima", "hull", "kama",
"zlema",
],
default: Some("sma"),
example: None,
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Prefix("starc"),
outputs: &[
output("Middle", StudyUnit::Inherit),
output("Upper", StudyUnit::Inherit),
output("Lower", StudyUnit::Inherit),
],
anchor: None,
},
StudyDescriptor {
name: "atrBands",
family: StudyFamily::Bands,
summary: "A field with volatility bands at ±k·ATR either side of it",
inputs: &[
input("column", Some("close")),
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[
StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(14.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 50.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "multiplier",
kind: ParamKind::Number {
integer: false,
default: Some(2.0),
example: None,
min: None,
max: None,
suggest: Some((1.0, 4.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Prefix("atrb"),
outputs: &[
output("Upper", StudyUnit::Inherit),
output("Lower", StudyUnit::Inherit),
],
anchor: None,
},
StudyDescriptor {
name: "donchian",
family: StudyFamily::Bands,
summary: "Donchian channel — the window's highest high and lowest low",
inputs: &[input("high", Some("high")), input("low", Some("low"))],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(20.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((10.0, 55.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Prefix("dc"),
outputs: &[
output("Upper", StudyUnit::Inherit),
output("Lower", StudyUnit::Inherit),
output("Middle", StudyUnit::Inherit),
],
anchor: None,
},
StudyDescriptor {
name: "highLowBands",
family: StudyFamily::Bands,
summary: "High Low Bands — a smoothed median price ±percent",
inputs: &[input("high", Some("high")), input("low", Some("low"))],
params: &[
StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(10.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "percent",
kind: ParamKind::Number {
integer: false,
default: Some(1.0),
example: None,
min: None,
max: None,
suggest: Some((0.5, 5.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "maType",
kind: ParamKind::Enum {
of: &[
"sma", "ema", "wma", "smma", "dema", "tema", "trima", "hull", "kama",
"zlema",
],
default: Some("trima"),
example: None,
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Prefix("hlb"),
outputs: &[
output("Middle", StudyUnit::Inherit),
output("Upper", StudyUnit::Inherit),
output("Lower", StudyUnit::Inherit),
],
anchor: None,
},
StudyDescriptor {
name: "primeNumberBands",
family: StudyFamily::Bands,
summary: "The primes immediately bracketing each bar's high and low",
inputs: &[input("high", Some("high")), input("low", Some("low"))],
params: &[],
naming: StudyNaming::Prefix("pnb"),
outputs: &[
output("Upper", StudyUnit::Inherit),
output("Lower", StudyUnit::Inherit),
],
anchor: None,
},
StudyDescriptor {
name: "envelope",
family: StudyFamily::Bands,
summary: "Moving-average envelope — bands at ±percent of the centre line",
inputs: &[input("column", Some("close"))],
params: &[
StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: None,
example: Some(20.0),
min: Some(1.0),
max: None,
suggest: Some((10.0, 50.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "percent",
kind: ParamKind::Number {
integer: false,
default: Some(2.5),
example: None,
min: None,
max: None,
suggest: Some((0.5, 10.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "maType",
kind: ParamKind::Enum {
of: &[
"sma", "ema", "wma", "smma", "dema", "tema", "trima", "hull", "kama",
"zlema",
],
default: Some("sma"),
example: None,
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Prefix("env"),
outputs: &[
output("Middle", StudyUnit::Inherit),
output("Upper", StudyUnit::Inherit),
output("Lower", StudyUnit::Inherit),
],
anchor: None,
},
StudyDescriptor {
name: "rsi",
family: StudyFamily::Momentum,
summary: "Wilder's relative strength index, bounded 0..100",
inputs: &[input("column", Some("close"))],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(14.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("rsi"),
outputs: &[output("", StudyUnit::Percent)],
anchor: None,
},
StudyDescriptor {
name: "stochastic",
family: StudyFamily::Momentum,
summary: "Lane's stochastic — where the close sits in its recent range",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[
StudyParam {
name: "kPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(14.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "slowing",
kind: ParamKind::Number {
integer: true,
default: Some(3.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((1.0, 10.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "dPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(3.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((1.0, 10.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Prefix("stoch"),
outputs: &[
output("K", StudyUnit::Percent),
output("D", StudyUnit::Percent),
],
anchor: None,
},
StudyDescriptor {
name: "stochasticMomentumIndex",
family: StudyFamily::Momentum,
summary: "Blau's SMI — the close against the range midpoint, smoothed",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[
StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(13.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "longPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(25.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((3.0, 50.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "shortPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(2.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((1.0, 10.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "signalPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(3.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((1.0, 15.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Prefix("smi"),
outputs: &[
output("", StudyUnit::Percent),
output("Signal", StudyUnit::Percent),
],
anchor: None,
},
StudyDescriptor {
name: "stochasticRsi",
family: StudyFamily::Momentum,
summary: "Chande & Kroll's stochastic of the RSI's own range",
inputs: &[input("column", Some("close"))],
params: &[
StudyParam {
name: "rsiPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(14.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "stochPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(14.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "kPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(3.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((1.0, 10.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "dPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(3.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((1.0, 10.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Prefix("stochRsi"),
outputs: &[
output("K", StudyUnit::Percent),
output("D", StudyUnit::Percent),
],
anchor: None,
},
StudyDescriptor {
name: "williamsR",
family: StudyFamily::Momentum,
summary: "Williams %R — the close below the recent high, −100..0",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(14.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("williamsR"),
outputs: &[output("", StudyUnit::Percent)],
anchor: None,
},
StudyDescriptor {
name: "chandeMomentum",
family: StudyFamily::Momentum,
summary: "Chande's momentum oscillator — unsmoothed up/down sums",
inputs: &[input("column", Some("close"))],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(14.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("cmo"),
outputs: &[output("", StudyUnit::Percent)],
anchor: None,
},
StudyDescriptor {
name: "momentum",
family: StudyFamily::Momentum,
summary: "The change from n bars ago, in the price’s own units",
inputs: &[input("column", Some("close"))],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(10.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((1.0, 50.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("momentum"),
outputs: &[output("", StudyUnit::Delta)],
anchor: None,
},
StudyDescriptor {
name: "percentChange",
family: StudyFamily::Momentum,
summary: "Percent change from n bars ago — the rate of change",
inputs: &[input("column", Some("close"))],
params: &[StudyParam {
name: "periods",
kind: ParamKind::Number {
integer: true,
default: Some(1.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((1.0, 20.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("pctChange"),
outputs: &[output("", StudyUnit::Percent)],
anchor: None,
},
StudyDescriptor {
name: "intradayMomentumIndex",
family: StudyFamily::Momentum,
summary: "Chande's IMI — RSI's question asked of the candle body",
inputs: &[input("open", Some("open")), input("close", Some("close"))],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(14.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("imi"),
outputs: &[output("", StudyUnit::Percent)],
anchor: None,
},
StudyDescriptor {
name: "awesomeOscillator",
family: StudyFamily::Momentum,
summary: "Bill Williams' AO — fast minus slow SMA of the median price",
inputs: &[input("high", Some("high")), input("low", Some("low"))],
params: &[
StudyParam {
name: "fastPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(5.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((2.0, 20.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "slowPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(34.0),
example: None,
min: None,
max: None,
suggest: Some((10.0, 60.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Output("ao"),
outputs: &[output("", StudyUnit::Delta)],
anchor: None,
},
StudyDescriptor {
name: "ultimateOscillator",
family: StudyFamily::Momentum,
summary: "Williams' three-horizon buying pressure, weighted 4/2/1",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[
StudyParam {
name: "shortPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(7.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((3.0, 12.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "mediumPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(14.0),
example: None,
min: None,
max: None,
suggest: Some((10.0, 25.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "longPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(28.0),
example: None,
min: None,
max: None,
suggest: Some((20.0, 60.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Output("uo"),
outputs: &[output("", StudyUnit::Percent)],
anchor: None,
},
StudyDescriptor {
name: "commodityChannelIndex",
family: StudyFamily::Momentum,
summary: "Lambert's CCI — typical price in mean absolute deviations",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(20.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((10.0, 50.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("cci"),
outputs: &[output("", StudyUnit::Ratio)],
anchor: None,
},
StudyDescriptor {
name: "fisherTransform",
family: StudyFamily::Momentum,
summary: "Ehlers' Fisher transform of the normalised median price",
inputs: &[input("high", Some("high")), input("low", Some("low"))],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(10.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Prefix("fisher"),
outputs: &[
output("", StudyUnit::Ratio),
output("Signal", StudyUnit::Ratio),
],
anchor: None,
},
StudyDescriptor {
name: "psychologicalLine",
family: StudyFamily::Momentum,
summary: "The percentage of the last n bars that closed up",
inputs: &[input("column", Some("close"))],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(12.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("psy"),
outputs: &[output("", StudyUnit::Percent)],
anchor: None,
},
StudyDescriptor {
name: "prettyGoodOscillator",
family: StudyFamily::Momentum,
summary: "Johnson's PGO — distance from the SMA in average true ranges",
inputs: &[
input("column", Some("close")),
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(14.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 50.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("pgo"),
outputs: &[output("", StudyUnit::Ratio)],
anchor: None,
},
StudyDescriptor {
name: "primeNumberOscillator",
family: StudyFamily::Momentum,
summary: "The distance from the price to the prime nearest it",
inputs: &[input("column", Some("close"))],
params: &[],
naming: StudyNaming::Output("pno"),
outputs: &[output("", StudyUnit::Delta)],
anchor: None,
},
StudyDescriptor {
name: "qstick",
family: StudyFamily::Momentum,
summary: "Chande's QStick — a moving average of the candle body",
inputs: &[input("open", Some("open")), input("close", Some("close"))],
params: &[
StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(8.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((2.0, 30.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "maType",
kind: ParamKind::Enum {
of: &[
"sma", "ema", "wma", "smma", "dema", "tema", "trima", "hull", "kama",
"zlema",
],
default: Some("sma"),
example: None,
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Output("qstick"),
outputs: &[output("", StudyUnit::Delta)],
anchor: None,
},
StudyDescriptor {
name: "relativeVigorIndex",
family: StudyFamily::Momentum,
summary: "Ehlers' RVI — the body as a fraction of the range, plus signal",
inputs: &[
input("open", Some("open")),
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(10.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((4.0, 30.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Prefix("rvi"),
outputs: &[
output("", StudyUnit::Ratio),
output("Signal", StudyUnit::Ratio),
],
anchor: None,
},
StudyDescriptor {
name: "centerOfGravity",
family: StudyFamily::Momentum,
summary: "Ehlers' CG — where the window's price mass balances, in bars",
inputs: &[input("column", Some("close"))],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(10.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("cog"),
outputs: &[output("", StudyUnit::Bars)],
anchor: None,
},
StudyDescriptor {
name: "chandeForecastOscillator",
family: StudyFamily::Momentum,
summary: "Chande's CFO — the price against its own forecast, in percent",
inputs: &[input("column", Some("close"))],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(14.0),
example: None,
min: Some(2.0),
max: None,
suggest: Some((5.0, 50.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("cfo"),
outputs: &[output("", StudyUnit::Percent)],
anchor: None,
},
StudyDescriptor {
name: "trueStrengthIndex",
family: StudyFamily::Momentum,
summary: "Blau's TSI — double-smoothed net change over total change",
inputs: &[input("column", Some("close"))],
params: &[
StudyParam {
name: "longPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(25.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((10.0, 50.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "shortPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(13.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "signalPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(7.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((3.0, 20.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Prefix("tsi"),
outputs: &[
output("", StudyUnit::Percent),
output("Signal", StudyUnit::Percent),
],
anchor: None,
},
StudyDescriptor {
name: "directionalMovement",
family: StudyFamily::Trend,
summary: "Wilder's directional movement system — +DI/−DI, DX, ADX, ADXR",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(14.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 50.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Prefix("dmi"),
outputs: &[
output("PlusDi", StudyUnit::Percent),
output("MinusDi", StudyUnit::Percent),
output("Dx", StudyUnit::Percent),
output("Adx", StudyUnit::Percent),
output("Adxr", StudyUnit::Percent),
],
anchor: None,
},
StudyDescriptor {
name: "aroon",
family: StudyFamily::Trend,
summary: "Chande's Aroon — how recently the window's extremes printed",
inputs: &[input("high", Some("high")), input("low", Some("low"))],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(25.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((10.0, 50.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Prefix("aroon"),
outputs: &[
output("Up", StudyUnit::Percent),
output("Down", StudyUnit::Percent),
output("Osc", StudyUnit::Percent),
],
anchor: None,
},
StudyDescriptor {
name: "vortex",
family: StudyFamily::Trend,
summary: "Vortex Indicator — Botes & Siepman's crossed movement pair",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(14.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 50.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Prefix("vi"),
outputs: &[
output("Plus", StudyUnit::Ratio),
output("Minus", StudyUnit::Ratio),
],
anchor: None,
},
StudyDescriptor {
name: "verticalHorizontalFilter",
family: StudyFamily::Trend,
summary: "Adam White's VHF — net movement over total movement",
inputs: &[input("column", Some("close"))],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(28.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((10.0, 50.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("vhf"),
outputs: &[output("", StudyUnit::Ratio)],
anchor: None,
},
StudyDescriptor {
name: "randomWalkIndex",
family: StudyFamily::Trend,
summary: "Poulos' RWI — the move in units of a random walk's reach",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(14.0),
example: None,
min: Some(2.0),
max: None,
suggest: Some((5.0, 40.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Prefix("rwi"),
outputs: &[
output("High", StudyUnit::Ratio),
output("Low", StudyUnit::Ratio),
],
anchor: None,
},
StudyDescriptor {
name: "superTrend",
family: StudyFamily::Trend,
summary: "SuperTrend — a ratcheting ATR band that flips with the close",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[
StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(10.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "multiplier",
kind: ParamKind::Number {
integer: false,
default: Some(3.0),
example: None,
min: None,
max: None,
suggest: Some((1.0, 5.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Prefix("st"),
outputs: &[
output("", StudyUnit::Inherit),
output("Trend", StudyUnit::Signal),
],
anchor: None,
},
StudyDescriptor {
name: "parabolicSar",
family: StudyFamily::Trend,
summary: "Wilder's parabolic stop-and-reverse",
inputs: &[input("high", Some("high")), input("low", Some("low"))],
params: &[
StudyParam {
name: "step",
kind: ParamKind::Number {
integer: false,
default: Some(0.02),
example: None,
min: None,
max: None,
suggest: Some((0.01, 0.05)),
},
optional: false,
requires: None,
},
StudyParam {
name: "maxStep",
kind: ParamKind::Number {
integer: false,
default: Some(0.2),
example: None,
min: None,
max: None,
suggest: Some((0.1, 0.5)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Prefix("psar"),
outputs: &[
output("", StudyUnit::Inherit),
output("Trend", StudyUnit::Signal),
],
anchor: None,
},
StudyDescriptor {
name: "atrTrailingStop",
family: StudyFamily::Trend,
summary: "Vervoort's close-anchored ratcheting ATR stop",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[
StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(14.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 50.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "multiplier",
kind: ParamKind::Number {
integer: false,
default: Some(3.0),
example: None,
min: None,
max: None,
suggest: Some((1.0, 5.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Prefix("ats"),
outputs: &[
output("", StudyUnit::Inherit),
output("Trend", StudyUnit::Signal),
],
anchor: None,
},
StudyDescriptor {
name: "zigZag",
family: StudyFamily::Trend,
summary: "ZigZag — percent-reversal pivots and the line joining them",
inputs: &[input("high", Some("high")), input("low", Some("low"))],
params: &[StudyParam {
name: "deviation",
kind: ParamKind::Number {
integer: false,
default: Some(5.0),
example: None,
min: None,
max: None,
suggest: Some((1.0, 20.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Prefix("zz"),
outputs: &[
output("Pivot", StudyUnit::Inherit),
output("Direction", StudyUnit::Signal),
output("Line", StudyUnit::Inherit),
],
anchor: None,
},
StudyDescriptor {
name: "ichimoku",
family: StudyFamily::Trend,
summary: "Ichimoku Kinko Hyo — Hosoda's five lines",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[
StudyParam {
name: "conversionPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(9.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 20.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "basePeriod",
kind: ParamKind::Number {
integer: true,
default: Some(26.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((10.0, 60.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "spanBPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(52.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((26.0, 120.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "displacement",
kind: ParamKind::Number {
integer: true,
default: Some(26.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((10.0, 60.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Prefix("ichi"),
outputs: &[
output("Tenkan", StudyUnit::Inherit),
output("Kijun", StudyUnit::Inherit),
output("SenkouA", StudyUnit::Inherit),
output("SenkouB", StudyUnit::Inherit),
output("Chikou", StudyUnit::Inherit),
],
anchor: None,
},
StudyDescriptor {
name: "elderImpulse",
family: StudyFamily::Trend,
summary: "Elder's impulse system — EMA and MACD histogram agreeing",
inputs: &[input("column", Some("close"))],
params: &[
StudyParam {
name: "emaPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(13.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "fastPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(12.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 20.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "slowPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(26.0),
example: None,
min: None,
max: None,
suggest: Some((15.0, 50.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "signalPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(9.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 20.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Output("impulse"),
outputs: &[output("", StudyUnit::Signal)],
anchor: None,
},
StudyDescriptor {
name: "elderRay",
family: StudyFamily::Trend,
summary: "Elder Ray — the bar's high and low against an EMA",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(13.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Prefix("elder"),
outputs: &[
output("Bull", StudyUnit::Delta),
output("Bear", StudyUnit::Delta),
],
anchor: None,
},
StudyDescriptor {
name: "trendIntensityIndex",
family: StudyFamily::Trend,
summary: "M. H. Pee's trend intensity index — deviations above an SMA",
inputs: &[input("column", Some("close"))],
params: &[
StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(30.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((10.0, 60.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "maPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(60.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((20.0, 120.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Output("tii"),
outputs: &[output("", StudyUnit::Percent)],
anchor: None,
},
StudyDescriptor {
name: "ravi",
family: StudyFamily::Trend,
summary: "Chande's RAVI — the two SMAs' gap as a percent of the slow one",
inputs: &[input("column", Some("close"))],
params: &[
StudyParam {
name: "shortPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(7.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((3.0, 20.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "longPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(65.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((20.0, 130.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Output("ravi"),
outputs: &[output("", StudyUnit::Percent)],
anchor: None,
},
StudyDescriptor {
name: "swingIndex",
family: StudyFamily::Trend,
summary: "Wilder's swing index — one bar's move against the limit move",
inputs: &[
input("open", Some("open")),
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[StudyParam {
name: "limit",
kind: ParamKind::Number {
integer: false,
default: None,
example: Some(5.0),
min: None,
max: None,
suggest: None,
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("si"),
outputs: &[output("", StudyUnit::Delta)],
anchor: None,
},
StudyDescriptor {
name: "accumulativeSwingIndex",
family: StudyFamily::Trend,
summary: "Wilder's accumulative swing index — the running swing total",
inputs: &[
input("open", Some("open")),
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[StudyParam {
name: "limit",
kind: ParamKind::Number {
integer: false,
default: None,
example: Some(5.0),
min: None,
max: None,
suggest: None,
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("asi"),
outputs: &[output("", StudyUnit::Index)],
anchor: None,
},
StudyDescriptor {
name: "atr",
family: StudyFamily::Volatility,
summary: "Wilder's average true range",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(14.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 50.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("atr"),
outputs: &[output("", StudyUnit::Delta)],
anchor: None,
},
StudyDescriptor {
name: "historicalVolatility",
family: StudyFamily::Volatility,
summary: "Annualised σ of log returns, as a decimal",
inputs: &[input("column", Some("close"))],
params: &[
StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(20.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((10.0, 60.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "annualize",
kind: ParamKind::Number {
integer: false,
default: Some(252.0),
example: None,
min: None,
max: None,
suggest: Some((1.0, 365.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Output("hv"),
outputs: &[output("", StudyUnit::Ratio)],
anchor: None,
},
StudyDescriptor {
name: "chaikinVolatility",
family: StudyFamily::Volatility,
summary: "Chaikin's percent rate of change of a smoothed bar range",
inputs: &[input("high", Some("high")), input("low", Some("low"))],
params: &[
StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(10.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "rocPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(10.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Output("chaikinVol"),
outputs: &[output("", StudyUnit::Percent)],
anchor: None,
},
StudyDescriptor {
name: "massIndex",
family: StudyFamily::Volatility,
summary: "Dorsey's range-expansion sum — the reversal bulge",
inputs: &[input("high", Some("high")), input("low", Some("low"))],
params: &[
StudyParam {
name: "emaPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(9.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 20.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "sumPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(25.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((10.0, 50.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Output("mass"),
outputs: &[output("", StudyUnit::Ratio)],
anchor: None,
},
StudyDescriptor {
name: "choppinessIndex",
family: StudyFamily::Volatility,
summary: "Dreiss' Choppiness Index — trending against ranging, 0..100",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(14.0),
example: None,
min: Some(2.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("chop"),
outputs: &[output("", StudyUnit::Percent)],
anchor: None,
},
StudyDescriptor {
name: "gopalakrishnanRangeIndex",
family: StudyFamily::Volatility,
summary: "GAPO — the window's high-low range, logged in base period",
inputs: &[input("high", Some("high")), input("low", Some("low"))],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(10.0),
example: None,
min: Some(2.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("gapo"),
outputs: &[output("", StudyUnit::Ratio)],
anchor: None,
},
StudyDescriptor {
name: "ulcerIndex",
family: StudyFamily::Volatility,
summary: "Martin's RMS percent drawdown from the rolling peak",
inputs: &[input("column", Some("close"))],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(14.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("ulcer"),
outputs: &[output("", StudyUnit::Percent)],
anchor: None,
},
StudyDescriptor {
name: "relativeVolatilityIndex",
family: StudyFamily::Volatility,
summary: "Dorsey's RSI form applied to σ instead of price",
inputs: &[input("column", Some("close"))],
params: &[
StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(14.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "stdevPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(10.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Output("relVol"),
outputs: &[output("", StudyUnit::Percent)],
anchor: None,
},
StudyDescriptor {
name: "obv",
family: StudyFamily::Volume,
summary: "Granville's running total of signed volume",
inputs: &[
input("close", Some("close")),
input("volume", Some("volume")),
],
params: &[],
naming: StudyNaming::Output("obv"),
outputs: &[output("", StudyUnit::Volume)],
anchor: None,
},
StudyDescriptor {
name: "accumulationDistribution",
family: StudyFamily::Volume,
summary: "Chaikin's A/D line — volume signed by the close's place in the bar",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
input("volume", Some("volume")),
],
params: &[],
naming: StudyNaming::Output("ad"),
outputs: &[output("", StudyUnit::Volume)],
anchor: None,
},
StudyDescriptor {
name: "priceVolumeTrend",
family: StudyFamily::Volume,
summary: "Running total of volume scaled by fractional price change",
inputs: &[
input("close", Some("close")),
input("volume", Some("volume")),
],
params: &[],
naming: StudyNaming::Output("pvt"),
outputs: &[output("", StudyUnit::Volume)],
anchor: None,
},
StudyDescriptor {
name: "chaikinMoneyFlow",
family: StudyFamily::Volume,
summary: "Chaikin's A/D term as a volume-weighted mean over a window",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
input("volume", Some("volume")),
],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(20.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((10.0, 50.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("cmf"),
outputs: &[output("", StudyUnit::Ratio)],
anchor: None,
},
StudyDescriptor {
name: "chaikinOscillator",
family: StudyFamily::Volume,
summary: "MACD of the Accumulation/Distribution line",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
input("volume", Some("volume")),
],
params: &[
StudyParam {
name: "fastPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(3.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((2.0, 8.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "slowPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(10.0),
example: None,
min: None,
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Output("chaikinOsc"),
outputs: &[output("", StudyUnit::Volume)],
anchor: None,
},
StudyDescriptor {
name: "moneyFlowIndex",
family: StudyFamily::Volume,
summary: "RSI computed on money flow instead of price",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
input("volume", Some("volume")),
],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(14.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("mfi"),
outputs: &[output("", StudyUnit::Percent)],
anchor: None,
},
StudyDescriptor {
name: "twiggsMoneyFlow",
family: StudyFamily::Volume,
summary: "Twiggs' money flow — true range, Wilder-smoothed",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
input("volume", Some("volume")),
],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(21.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((10.0, 50.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("tmf"),
outputs: &[output("", StudyUnit::Ratio)],
anchor: None,
},
StudyDescriptor {
name: "forceIndex",
family: StudyFamily::Volume,
summary: "Elder's force index — price change times volume, EMA-smoothed",
inputs: &[
input("close", Some("close")),
input("volume", Some("volume")),
],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(13.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((1.0, 40.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("force"),
outputs: &[output("", StudyUnit::Volume)],
anchor: None,
},
StudyDescriptor {
name: "easeOfMovement",
family: StudyFamily::Volume,
summary: "Arms' ease of movement — midpoint travel per unit of volume",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("volume", Some("volume")),
],
params: &[
StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(14.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "maType",
kind: ParamKind::Enum {
of: &[
"sma", "ema", "wma", "smma", "dema", "tema", "trima", "hull", "kama",
"zlema",
],
default: Some("sma"),
example: None,
},
optional: false,
requires: None,
},
StudyParam {
name: "scale",
kind: ParamKind::Number {
integer: false,
default: Some(100000000.0),
example: None,
min: None,
max: None,
suggest: Some((1000000.0, 1000000000.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Output("eom"),
outputs: &[output("", StudyUnit::Ratio)],
anchor: None,
},
StudyDescriptor {
name: "klinger",
family: StudyFamily::Volume,
summary: "Klinger's volume oscillator with its signal line",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
input("volume", Some("volume")),
],
params: &[
StudyParam {
name: "fastPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(34.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((20.0, 50.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "slowPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(55.0),
example: None,
min: None,
max: None,
suggest: Some((40.0, 100.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "signalPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(13.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Prefix("kvo"),
outputs: &[
output("", StudyUnit::Volume),
output("Signal", StudyUnit::Volume),
],
anchor: None,
},
StudyDescriptor {
name: "volumeOscillator",
family: StudyFamily::Volume,
summary: "Fast minus slow moving average of volume, as a percent",
inputs: &[input("volume", Some("volume"))],
params: &[
StudyParam {
name: "fastPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(5.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((2.0, 8.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "slowPeriod",
kind: ParamKind::Number {
integer: true,
default: Some(10.0),
example: None,
min: None,
max: None,
suggest: Some((10.0, 50.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "maType",
kind: ParamKind::Enum {
of: &[
"sma", "ema", "wma", "smma", "dema", "tema", "trima", "hull", "kama",
"zlema",
],
default: Some("sma"),
example: None,
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Output("volOsc"),
outputs: &[output("", StudyUnit::Percent)],
anchor: None,
},
StudyDescriptor {
name: "tradeVolumeIndex",
family: StudyFamily::Volume,
summary: "Tick-direction volume accumulation (needs the instrument tick)",
inputs: &[
input("column", Some("close")),
input("volume", Some("volume")),
],
params: &[StudyParam {
name: "minTick",
kind: ParamKind::Number {
integer: false,
default: None,
example: Some(0.01),
min: None,
max: None,
suggest: None,
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("tvi"),
outputs: &[output("", StudyUnit::Volume)],
anchor: None,
},
StudyDescriptor {
name: "negativeVolumeIndex",
family: StudyFamily::Volume,
summary: "Fosback's index compounding returns on lower-volume bars",
inputs: &[
input("column", Some("close")),
input("volume", Some("volume")),
],
params: &[StudyParam {
name: "start",
kind: ParamKind::Number {
integer: false,
default: Some(1000.0),
example: None,
min: None,
max: None,
suggest: Some((100.0, 10000.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("nvi"),
outputs: &[output("", StudyUnit::Index)],
anchor: None,
},
StudyDescriptor {
name: "positiveVolumeIndex",
family: StudyFamily::Volume,
summary: "Fosback's index compounding returns on higher-volume bars",
inputs: &[
input("column", Some("close")),
input("volume", Some("volume")),
],
params: &[StudyParam {
name: "start",
kind: ParamKind::Number {
integer: false,
default: Some(1000.0),
example: None,
min: None,
max: None,
suggest: Some((100.0, 10000.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("pvi"),
outputs: &[output("", StudyUnit::Index)],
anchor: None,
},
StudyDescriptor {
name: "marketFacilitationIndex",
family: StudyFamily::Volume,
summary: "Bill Williams' price movement per unit of volume",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("volume", Some("volume")),
],
params: &[],
naming: StudyNaming::Output("bwmfi"),
outputs: &[output("", StudyUnit::Ratio)],
anchor: None,
},
StudyDescriptor {
name: "shinoharaIntensityRatio",
family: StudyFamily::Volume,
summary: "Shinohara's strong and weak intensity ratios",
inputs: &[
input("open", Some("open")),
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(26.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((10.0, 60.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Prefix("sir"),
outputs: &[
output("Strong", StudyUnit::Ratio),
output("Weak", StudyUnit::Ratio),
],
anchor: None,
},
StudyDescriptor {
name: "vwap",
family: StudyFamily::Volume,
summary: "Volume-weighted average price over a trailing window",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
input("volume", Some("volume")),
],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: None,
example: Some(20.0),
min: Some(1.0),
max: None,
suggest: Some((5.0, 200.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("vwap"),
outputs: &[output("", StudyUnit::Inherit)],
anchor: None,
},
StudyDescriptor {
name: "anchoredVwap",
family: StudyFamily::Volume,
summary: "VWAP accumulated from a user-chosen bar onward",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
input("volume", Some("volume")),
],
params: &[],
naming: StudyNaming::Output("avwap"),
outputs: &[output("", StudyUnit::Inherit)],
anchor: Some(StudyAnchor::Time),
},
StudyDescriptor {
name: "linearRegression",
family: StudyFamily::Statistical,
summary: "Rolling OLS fit against the bar index, with slope, angle and R²",
inputs: &[input("column", Some("close"))],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(14.0),
example: None,
min: Some(2.0),
max: None,
suggest: Some((5.0, 60.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Prefix("linreg"),
outputs: &[
output("Value", StudyUnit::Inherit),
output("Slope", StudyUnit::Delta),
output("Intercept", StudyUnit::Inherit),
output("Angle", StudyUnit::Ratio),
output("R2", StudyUnit::Ratio),
],
anchor: None,
},
StudyDescriptor {
name: "timeSeriesForecast",
family: StudyFamily::Statistical,
summary: "The rolling OLS fit projected one bar past the window",
inputs: &[input("column", Some("close"))],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(14.0),
example: None,
min: Some(2.0),
max: None,
suggest: Some((5.0, 60.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("tsf"),
outputs: &[output("", StudyUnit::Inherit)],
anchor: None,
},
StudyDescriptor {
name: "beta",
family: StudyFamily::Statistical,
summary: "Slope of a column's one-bar returns on a benchmark's",
inputs: &[input("column", Some("close")), input("benchmark", None)],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(5.0),
example: None,
min: Some(2.0),
max: None,
suggest: Some((5.0, 60.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("beta"),
outputs: &[output("", StudyUnit::Ratio)],
anchor: None,
},
StudyDescriptor {
name: "correlation",
family: StudyFamily::Statistical,
summary: "Rolling Pearson correlation against a benchmark column",
inputs: &[input("column", Some("close")), input("benchmark", None)],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(30.0),
example: None,
min: Some(2.0),
max: None,
suggest: Some((10.0, 120.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("corr"),
outputs: &[output("", StudyUnit::Ratio)],
anchor: None,
},
StudyDescriptor {
name: "priceRelative",
family: StudyFamily::Statistical,
summary: "Ratio of a column to a benchmark column, with no look-back",
inputs: &[input("column", Some("close")), input("benchmark", None)],
params: &[],
naming: StudyNaming::Output("priceRel"),
outputs: &[output("", StudyUnit::Ratio)],
anchor: None,
},
StudyDescriptor {
name: "performanceIndex",
family: StudyFamily::Statistical,
summary: "Each side's own period-bar growth, divided — 1 is parity",
inputs: &[input("column", Some("close")), input("benchmark", None)],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: Some(20.0),
example: None,
min: Some(1.0),
max: None,
suggest: Some((10.0, 60.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("perf"),
outputs: &[output("", StudyUnit::Ratio)],
anchor: None,
},
StudyDescriptor {
name: "zScore",
family: StudyFamily::Statistical,
summary: "Deviation from the rolling mean, in standard deviations",
inputs: &[input("column", Some("close"))],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: None,
example: Some(20.0),
min: Some(1.0),
max: None,
suggest: Some((10.0, 60.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("zscore"),
outputs: &[output("", StudyUnit::Ratio)],
anchor: None,
},
StudyDescriptor {
name: "rollingStdev",
family: StudyFamily::Statistical,
summary: "Rolling population standard deviation (ddof = 0)",
inputs: &[input("column", Some("close"))],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: None,
example: Some(20.0),
min: Some(1.0),
max: None,
suggest: Some((5.0, 100.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("stdev"),
outputs: &[output("", StudyUnit::Delta)],
anchor: None,
},
StudyDescriptor {
name: "rollingMin",
family: StudyFamily::Statistical,
summary: "Rolling minimum over the last period bars",
inputs: &[input("column", Some("close"))],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: None,
example: Some(20.0),
min: Some(1.0),
max: None,
suggest: Some((5.0, 100.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("min"),
outputs: &[output("", StudyUnit::Inherit)],
anchor: None,
},
StudyDescriptor {
name: "rollingMax",
family: StudyFamily::Statistical,
summary: "Rolling maximum over the last period bars",
inputs: &[input("column", Some("close"))],
params: &[StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: None,
example: Some(20.0),
min: Some(1.0),
max: None,
suggest: Some((5.0, 100.0)),
},
optional: false,
requires: None,
}],
naming: StudyNaming::Output("max"),
outputs: &[output("", StudyUnit::Inherit)],
anchor: None,
},
StudyDescriptor {
name: "rollingPercentile",
family: StudyFamily::Statistical,
summary: "Rolling q-th percentile, linearly interpolated",
inputs: &[input("column", Some("close"))],
params: &[
StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: None,
example: Some(20.0),
min: Some(1.0),
max: None,
suggest: Some((5.0, 100.0)),
},
optional: false,
requires: None,
},
StudyParam {
name: "q",
kind: ParamKind::Number {
integer: false,
default: None,
example: Some(90.0),
min: Some(0.0),
max: Some(100.0),
suggest: Some((5.0, 95.0)),
},
optional: false,
requires: None,
},
],
naming: StudyNaming::Output("p90"),
outputs: &[output("", StudyUnit::Inherit)],
anchor: None,
},
StudyDescriptor {
name: "typicalPrice",
family: StudyFamily::Price,
summary: "Typical price — (high + low + close) / 3",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[],
naming: StudyNaming::Output("typicalPrice"),
outputs: &[output("", StudyUnit::Inherit)],
anchor: None,
},
StudyDescriptor {
name: "medianPrice",
family: StudyFamily::Price,
summary: "Median price — (high + low) / 2",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[],
naming: StudyNaming::Output("medianPrice"),
outputs: &[output("", StudyUnit::Inherit)],
anchor: None,
},
StudyDescriptor {
name: "weightedClose",
family: StudyFamily::Price,
summary: "Weighted close — (high + low + 2·close) / 4",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[],
naming: StudyNaming::Output("weightedClose"),
outputs: &[output("", StudyUnit::Inherit)],
anchor: None,
},
StudyDescriptor {
name: "averagePrice",
family: StudyFamily::Price,
summary: "Average price — (open + high + low + close) / 4",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
input("open", Some("open")),
],
params: &[],
naming: StudyNaming::Output("averagePrice"),
outputs: &[output("", StudyUnit::Inherit)],
anchor: None,
},
StudyDescriptor {
name: "balanceOfPower",
family: StudyFamily::Price,
summary: "TA-Lib's per-bar (close − open)/(high − low), optionally smoothed",
inputs: &[
input("open", Some("open")),
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[
StudyParam {
name: "period",
kind: ParamKind::Number {
integer: true,
default: None,
example: Some(14.0),
min: Some(1.0),
max: None,
suggest: Some((5.0, 30.0)),
},
optional: true,
requires: None,
},
StudyParam {
name: "maType",
kind: ParamKind::Enum {
of: &[
"sma", "ema", "wma", "smma", "dema", "tema", "trima", "hull", "kama",
"zlema",
],
default: Some("sma"),
example: None,
},
optional: false,
requires: Some("period"),
},
],
naming: StudyNaming::Output("bop"),
outputs: &[output("", StudyUnit::Ratio)],
anchor: None,
},
StudyDescriptor {
name: "sessionVwap",
family: StudyFamily::Session,
summary: "Volume-weighted average price, reset at each session's open",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
input("volume", Some("volume")),
],
params: &[],
naming: StudyNaming::Output("svwap"),
outputs: &[output("", StudyUnit::Inherit)],
anchor: Some(StudyAnchor::Session),
},
StudyDescriptor {
name: "pivotPoints",
family: StudyFamily::Session,
summary: "The prior session's pivot with its support and resistance levels",
inputs: &[
input("high", Some("high")),
input("low", Some("low")),
input("close", Some("close")),
],
params: &[StudyParam {
name: "method",
kind: ParamKind::Enum {
of: &["standard", "fibonacci", "woodie", "camarilla"],
default: Some("standard"),
example: None,
},
optional: false,
requires: None,
}],
naming: StudyNaming::Prefix("pp"),
outputs: &[
output("Pivot", StudyUnit::Inherit),
output("R1", StudyUnit::Inherit),
output("R2", StudyUnit::Inherit),
output("R3", StudyUnit::Inherit),
output("S1", StudyUnit::Inherit),
output("S2", StudyUnit::Inherit),
output("S3", StudyUnit::Inherit),
],
anchor: Some(StudyAnchor::Session),
},
];