View Single Post
  #4 (permalink)  
Old 12-13-2006, 05:36 AM
bugkeab bugkeab is offline
Junior Member
 
Join Date: May 2006
Posts: 20
bugkeab is on a distinguished road
Wink Metastock to MT4

The code below is metastock format, Can someone help to convert to MT4 ? with option mov preriods change.

It's trend following oscillator, it's can use with break out strategies like price chanel or price chanal with ATR adjusted to make trading system.
(see attached picture for a sample system)


Bull Power/Bear Power Histogram

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}

Thank you
Attached Images
File Type: png 30 min breakout.png (34.5 KB, 410 views)
Reply With Quote