PBX2:=(EMA (closing, M2)+MA (closing, M2*2)+MA (closing, m2 * 4))/3;
PBX3:=(EMA (closing, M3)+MA (closing, M3*2)+MA (closing, m3 * 4))/3;
PBX4:=(EMA (closing, M4)+MA (closing, M4*2)+MA (closing, M4 * 4))/3;
PBX5:=(EMA (closing, M5)+MA (closing, M5*2)+MA (closing, M5 * 4))/3;
PBX6:=(EMA (closing, M6)+MA (closing, M6*2)+MA (closing, M6 * 4))/3;
HH:=MAX(PBX 1,MAX(PBX2,MAX(PBX3,MAX(PBX4,MAX(PBX5,PBX 6)))));
LL:=MIN(PBX 1,MIN(PBX2,MIN(PBX3,MIN(PBX4,MIN(PBX5,PBX 6)))));
X:REF(LL=PBX 1, 1),HH = PBX 1;
I won't say much about the relevant parameters of PBX.
Note: Do not fail the formula because the parameter (M 1-M6) is not set.