in Search

Forum DLL latch function-exit extended more than it should

Last post 01-17-2006, 5:37 by Patrick. 1 replies.
Sort Posts: Previous Next
  •  01-17-2006, 1:20 14030

    Forum DLL latch function-exit extended more than it should

    I can't figure out what i'm doing wrong or am I using it it the wrong way .Here's my formula (its a modify version of Patricks "dll latch function"):
    {ENTER LONG }
    {LE:=H>=Ref(HHV(H,10),-1);
    LX:=BarsSince(H>=Ref(HHV(H,10),-1))=10;
    {SE:=your Condition here;}
    {SX:=your Condition here;}
    Z:= ExtFml("forum.Latch",LE,LX,0,0);
    EnterLong:=Z = 1 AND Ref(Z,-1) <> 1;
    ExitLong:=Z = 0 AND Ref(Z,-1) = 1;
    EnterLong-ExitLong; }.

    If plotted on a chart in its own window and plot {10} day price channels on price chart I get some signals exiting somtimes {20} days later. I can't figure out why.Why? Thanks in advance Ralph.
  •  01-17-2006, 5:37 14047 in reply to 14030

    Re: Forum DLL latch function-exit extended more than it should

    Let me know if it is ok for you:

    {Enter Long}
    LE:=Cross(H,Ref(HHV(H,10),-1));
    LX:=BarsSince(LE)=10;
    Z:= ExtFml("forum.Latch",LE,LX,0,0);
    Z = 1 AND Ref(Z,-1) <> 1

    {Exit Long}
    LE:=Cross(H,Ref(HHV(H,10),-1));
    LX:=BarsSince(LE)=10;
    Z:= ExtFml("forum.Latch",LE,LX,0,0);
    Z = 0 AND Ref(Z,-1) = 1

    Patrick :mrgreen:
    My Site
View as RSS news feed in XML