Announcement

Collapse
No announcement yet.

Fractal code help in converting

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Fractal code help in converting

    Hello,

    This is a very nice Fractal code from Metastock, I'm having a hard time converting it to EFS

    any help would be very nice

    Long Signal

    F1:=ValueWhen(1,H<Ref(H,-2) AND Ref(H,-1)<Ref(H,-2) AND Ref(H,-3)<Ref(H,-2) AND Ref(H,-4)<Ref(H,-2),Ref(H,-2));
    F2:=ValueWhen(1,L>Ref(L,-2) AND Ref(L,-1)>Ref(L,-2) AND Ref(L,-3)>Ref(L,-2) AND Ref(L,-4)>Ref(L,-2),Ref(L,-2));

    a:=Cross(H,F1);
    b:=Cross(F2,L);

    state:=If(BarsSince(a)<BarsSince(b),1,0);

    state=1


    Short Signal

    F1:=ValueWhen(1,H<Ref(H,-2) AND Ref(H,-1)<Ref(H,-2) AND Ref(H,-3)<Ref(H,-2) AND Ref(H,-4)<Ref(H,-2),Ref(H,-2));
    F2:=ValueWhen(1,L>Ref(L,-2) AND Ref(L,-1)>Ref(L,-2) AND Ref(L,-3)>Ref(L,-2) AND Ref(L,-4)>Ref(L,-2),Ref(L,-2));

    a:=Cross(H,F1);
    b:=Cross(F2,L);

    state:=If(BarsSince(a)<BarsSince(b),1,0);

    state=0



    Thank you

    Ketoma
    Attached Files
Working...
X