Operators and expressions

and, or, not, between, in, if-then-else.

AlgoBarsX
in_band = rsi(close, 14) between 40 and 60
morning = hour in 8..11
bias = if close > ema(close, 200) then 1 else -1
power = 2 ** 3
calm = not (atr(14) > atr(14)[10])
first_hour = time_of_day between 08:00 and 09:00
OperatorMeaning
+ - * / % **Arithmetic. ** is power and groups from the right, so 2 ** 3 ** 2 is 512.
== != < <= > >=Comparison.
and or notLogic, in words.
x between a and bTrue when x is inside the range.
x in 8..11True when x is in a range or a list.
if c then a else bChooses a value inside an expression.
2% of account.balanceTurns a percent into an amount.
+= -= *= /=Update a state value in place.

Time variables available everywhere: hour, minute, day_of_week and time_of_day.

Try this in the Terminal. AlgoBars is free: $0 a month, no card needed.

Create my free account