That syntax is error free but it did not work somehow. Nevertheless, I got the idea and also learnt how to break IIF line in multiple and changed it suitably. Below code is working
SetBarFillColor(
IIf(C < Ref(L, -1) AND ((Ref(C, -1) > Ref(H, -2)) OR (Ref(C, -2) > Ref(H, -3)))...