onTick
What is it?
Syntax
onTick = (length, _moment, _, ta, inputs) => {
// per-tick or per-bar logic here
}What Happens in "onTick"
Example
// This is the main function. It is called every time a new candle is received.
// Here you can calculate the indicator values and draw the indicator on the chart.
onTick = (length, _moment, _, ta, inputs) => {
const show = inputs.show;
const extend = inputs.extend;
if (show) {
if(high(2) < low(0) && (low(0)-high(2) > (closeC(1)-openC(1)) * 0.65)){
rectangle(time(2), high(2), time(0), low(0),{backgroundColor: color.rgba(0, 128, 0, 0.2), color: color.green, extendRight: extend});
}
}
};Why It Matters
Last updated