Binary Operator "[]"

QuantScript's binary time travel

[]
operator implements historic value reference.

Time travel is capped at 500 bars into the past.

Examples:

1 5[5] # -> 5
2 open[5] # -> open price 5 bars ago
3 (open + close)[5] # -> sum of open and close 5 bars ago
4 close[500] # -> unknown

An explanation on time travel can be found here.

Table of Operands

Anything not listed here results in an Unknown.
This operator is not commutative -

x[y]
is not always the same as
y[x]
.
This operator is not type-commutative - the type of
x[y]
is not always the same as the type of
y[x]
.
This operator is right associative -
x[y][z]
is the same as
x[y + z]
.

Left OperandOperatorRight OperandResult
Number[]Number < 500Number
Boolean[]Number < 500Boolean
Day[]Number < 500Day
Time[]Number < 500Time
Function[]Number < 500Function
Series<Any>[]Number < 500Series<Any>