Not exactly what you are looking for but this is the formula for the Keltner Channels I use. Perhaps you can adapt if it is suitable.
Mov((H+L+C)/3,22,E);
Mov((H+L+C)/3,22,E) + Mov((H-L),22,E);
Mov((H+L+C)/3,22,E) + (2 * Mov((H-L),22,E));
Mov((H+L+C)/3,22,E) + (3 * Mov((H-L),22,E));
Mov((H+L+C)/3,22,E) - Mov((H-L),22,E);
Mov((H+L+C)/3,22,E) - (2 * Mov((H-L),22,E));
Mov((H+L+C)/3,22,E) - (3 * Mov((H-L),22,E));