Formula for bull power

If(C < O,
If(Ref(C, -1) < O,
    Max(H-Ref(C, -1), C-L),
    Max(H-O, C-L)),
If(C > O,
If(Ref(C, -1) > O,
    H-L,
    Max(O-Ref(C, -1), H-L)),
If(H-C > C-L,
If(Ref(C, -1) < O,
    Max(H-Ref(C, -1), C-L),
    H-O),
If(H-C < C-L,
If(Ref(C, -1) > O,
    H-L,
    Max(O-Ref(C, -1), H-L)),
If(Ref(C, -1) > O,
    Max(H-O, C-L),
If(Ref(C, -1) < O,
    Max(O-Ref(C, -1), H-L),
    H-L))))))


Formula for bear power

If(C < O,
If(Ref(C, -1) > O,
    Max(Ref(C, -1)-O, H-L),
    H-L),
If(C > O,
If(Ref(C, -1) > O,
    Max(Ref(C, -1)-L, H-C),
    Max(O-L, H-C)),
If(H-C > C-L,
If(Ref(C, -1) < O,
    Max(Ref(C, -1)-O, H-L),
    H-L),
If(H-C < C-L,
If(Ref(C, -1) > O,
    Max(Ref(C, -1)-L, H-C),
    O-L),
If(Ref(C, -1) > O,
    Max(Ref(C, -1)-O, H-L),
If(Ref(C, -1) < O,
    Max(O-L, H-C),
    H-L))))))


-- V.G.