Oh, missed that bit. In init, create a last candle var.
Then at the end of the check function update this:
If you'd get errors from an undefined last candle, you can set a first run check and for the very first run set lastCandle to candle before it's checked.
Code:
this.lastCandle={};
Then at the end of the check function update this:
Code:
this.lastCandle = candle
If you'd get errors from an undefined last candle, you can set a first run check and for the very first run set lastCandle to candle before it's checked.