This is a simple query language develop inhouse to write custom logic to view and trigger alerts based on the chart technical tools.
ma(close, 5)
- moving average on close price with value 5.
- args:
price_type
(optional),period
,ma_type
- return: none
macd(close, 16, 26, 9).value
- params:
price_type
,fast_period
,slow_period
,signal_period
- return:
.value
,.signal
,.divergence
The logics works by combination of the following pattern.
identifier operator operand extops
As long as it fulfil the above logic, you can combo with
... AND ...
(...) OR ...
to establish precedence.
cross
,crossover
,crossunder
- Flags when "left" value cross "right" value.
- "right" value can be an indicator or value.
- eg.
ma(close, 5) crossover ma(close, 14)
macd(close, 16, 26).signal crossunder 0
above
,below
,eq
,lt
,gt
,=
,<
,>
- The usual arithmetic for equation to compare value.
by
- To apply some multiplier to the operand value.
- eg.
ma(close, 5) crossover ma(close, 15) by 5%
- means that alert will only triggered after ma(5) crosses more than 5% of the ma(15).
for
- To extend the comparison of logic to remain true for X period of time.
- eg.
ma(close, 5) was crossover ma(close, 15) for 5t
- means that upon crossover, alert will be triggered after 5 ticks.
was
andfor
- To ensure the logic has happened before the alert.
- eg.
ma(close, 5) was crossover ma(close, 15) for 5t
- Noted* "was" need too be coupled together with the "for" keyword.
combination everything
was
,for
andby
- eg.
ma(close, 5) was crossover ma(close, 15) by 5% for 5t