Here is a simple oscillator made of difference between 2 Closes of Heiken Ashi candles from a shifted period to present candle.
A moving average initiate signals when it crosses the main oscillator or the “zero” level.
I haven’t test it a lot, i think it can be used to detect when it’s time to exit trades when the shifted close is near the actual one that made lines crosses each other.
//parameters
// period = 3
// MAperiod = 3
xClose = (Open+High+Low+Close)/4
Delta = xClose[0]-xClose[0+period]
aDelta = average[MAperiod](Delta)
RETURN Delta as "Heiken Ashi Delta", aDelta as "MA of Heiken Ashi Delta"