Metastock to Mt4

 

The code below is metastock format, Can someone help to convert to MT4 ? 
it is called Bull And Bear Balance Indicator by Vadim Gimelfarb 

 Regards

 

 

r1:=If(Ref(C,-1)<O,Max(O-Ref(C,-1),H-L),H-L);
r2:=If(Ref(C,-1)>O,Max(Ref(C,-1)-O,H-L),H-L);
bull:=If(C=O,
If(H-C=C-L,
If(Ref(C,-1)>O,
Max(H-O,C-L),
r1),
If(H-C>C-L,
If(Ref(C,-1)<O,
Max(H-Ref(C,-1),C-L),
H-O),
r1)),
If(C<O,
If(Ref(C,-1)<O,
Max(H-Ref(C,-1),C-L),
Max(H-O,C-L)),
r1));
bear:=If(C=O,
If(H-C=C-L,
If(Ref(C,-1)<O,
Max(O-L,H-C),
r2),
If(H-C>C-L,
r2,
If(Ref(C,-1)>O,
Max(Ref(C,-1)-L,H-C),
O-L))),
If(C<O,
r2,
If(Ref(C,-1)>O,
Max(Ref(C,-1)-L,H-C),
Max(O-L,H-C))));
BB:=Mov(bull-bear,30,S); { need option mov preriods change}
slowBB:= mov(BB,89,s); { need option mov preriods change}
fastBB:= mov(BB,13,s); { need option mov preriods change}

 

Metastock to Mt4

 

Sure. Click here to do the conversion: https://www.mql5.com/en/job