[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Re: metastock statement to afl



PureBytes Links

Trading Reference Links

Does this help? It's a version of Tom's TD Sequential System

Plot(C,"C",colorBlack,64);Title=Name();

for(x=5; x<20; x++)

{

S2=Sum(C<Ref(C,-3),x)==x;

Buy=s2==0 AND Ref(s2,-1);

PlotShapes((shapeHollowSmallCircle+shapePositionAbove)*s2,x);

PlotShapes(shapeUpArrow*Buy,colorBrightGreen);

Title=Title+WriteIf(s2,"["+WriteVal(x,1.0)+"]","");

}

//Title = "TD Sequential System DeMark's";

----- Original Message -----
From: aboaziz_sa
Sent: Thursday, April 19, 2007 6:54 AM
Subject: [amibroker] Re: metastock statement to afl

Rick
You are right it is Tom Demark formula that I am trying to
convert ...
I got the first part exactly just like you did, but I was not sure
how to go about the statement in question.

Thanks a bunch for your Help;

--- In amibroker@xxxxxxxxxps.com, Rick Osborn <ricko@xxx> wrote:
>
> oops
> I see that the line for TD4 should be
>
> TD4 = IIf(TD2==1 AND TD3==1,1,0);
>
> Rick
> --- Rick Osborn <ricko@xxx> wrote:
>
> > I'll have a go at it.
> >
> > The Fml("TD - SetUp-Buy" ) is a Tom Demark formula
> > which, I think translated to AB is as follows.
> >
> > TD1=IIf(C<Ref(C,-4),1,0);
> >
> > TD2 = IIf(TD1==1 AND Ref(TD1,-1)==1 AND
> > Ref(TD1,-2)==1
> > AND Ref(TD1,-3)==1 AND
> > Ref(TD1,-4)==1 AND Ref(TD1,-5)==1 AND
> > Ref(TD1,-6)==1 AND Ref(TD1,-7)==1 AND
> > Ref(TD1,-8)==1, 1,0);
> >
> > TD3 = IIf(Ref(C,-9)>=Ref(C,-13),1,0);
> >
> > TD4 = IIf(TD2=1 AND TD3=1,1,0);
> >
> > TD5 = IIf(H>=Ref(LLV(L,5),-3),1,0);
> >
> > D8 = IIf(Ref(TD4,1)==1 AND TD5==1,1,0);
> >
> > D9 = IIf(TD4==1 AND TD5==1 AND Ref(D8,-1)!= 1,1,0);
> >
> > D10 = IIf(Ref(TD4,-1)==1 AND TD5==1 AND
> > Ref(D8,-2)!=1
> > AND Ref(D9,-1)!=1,1,0);
> >
> > D11 = IIf(Ref(TD4,-2)==1 AND TD5==1 AND
> > Ref(D8,-3)!=1
> > AND Ref(D9,-2)!=1 AND
> > Ref(D10,-1)!=1,1,0);
> >
> > D12 = IIf(Ref(TD4,-3)==1 AND TD5==1 AND
> > Ref(D8,-4)!=1
> > AND Ref(D9,-3)!=1 AND
> > Ref(D10,-2)!=1 AND Ref(D11,-1)!=1,1,0);
> >
> > D13 = IIf(Ref(TD4,-4)==1 AND TD5==1 AND
> > Ref(D8,-5)!=1
> > AND Ref(D9,-4)!=1 AND
> > Ref(D10,-3)!=1 AND Ref(D11,-2)!=1 AND
> > Ref(D12,-1)!=1,1,0);
> >
> > D14 = IIf(Ref(TD4,-5)==1 AND TD5==1 AND
> > Ref(D8,-6)!=1
> > AND Ref(D9,-5)!=1 AND
> > Ref(D10,-4)!=1 AND Ref(D11,-3)!=1 AND
> > Ref(D12,-2)!=1 AND Ref(D13,-1)!=1,1,0);
> >
> > D15 = IIf(Ref(TD4,-6)==1 AND TD5==1 AND
> > Ref(D8,-7)!=1
> > AND Ref(D9,-6)!=1 AND
> > Ref(D10,-5)!=1 AND Ref(D11,-4)!=1 AND
> > Ref(D12,-3)!=1 AND Ref(D13,-2)!=1 AND
> > Ref(D14,-1)!=1,1,0);
> >
> > D16 = IIf(Ref(TD4,-7)==1 AND TD5==1 AND
> > Ref(D8,-8)!=1
> > AND Ref(D9,-7)!=1 AND
> > Ref(D10,-6)!=1 AND Ref(D11,-5)!=1 AND
> > Ref(D12,-4)!=1 AND Ref(D13,-3)!=1 AND
> > Ref(D14,-2)!=1 AND Ref(D15,-1)!=1,1,0);
> >
> > D17 = IIf(Ref(TD4,-8)==1 AND TD5==1 AND
> > Ref(D8,-9)!=1
> > AND Ref(D9,-8)!=1 AND
> > Ref(D10,-7)!=1 AND Ref(D11,-6)!=1 AND
> > Ref(D12,-5)!=1 AND Ref(D13,-4)!=1 AND
> > Ref(D14,-3)!=1 AND Ref(D15,-2)!=1 AND
> > Ref(D16,-1)!=1,1,0);
> >
> > SetUp = D8+D9+D10+D11+D12+D13+D14+D15+D16+D17;
> >
> > Then the code to convert the rest is
> >
> > value = Cum(IIf(C<Ref(Close,-2),1,0)) -
> > ValueWhen(Ref(SetUp,-1)==1,
> > Cum(IIf(C<Ref(C,-2),1,0)));
> >
> > BUT there is the Ref function seems to refer to the
> > future. I changed it to Ref(value, -1).
> >
> > Maybe somebody should check this.
> > Hope it helps
> >
> > Rick
> > --- aboaziz_sa <aboaziz_sa@...> wrote:
> >
> > > Cum(If(C<Ref(CLOSE,-2),1,0)) -
> > > ValueWhen(1,Ref(Fml("TD - SetUp-Buy" ),
> > > 1)=1,
> > > Cum(If(C<Ref(C,-2),1,0)))
> > >
> > >
> > >
> > >
> > >
> > > Could some one help convert the above metastock
> > > statement to afl
> > >
> > > Thanks
> > >
> > >
> > >
> > >
> >
> >
> > Rick Osborn & Associates
> > 885 Sorrento Ave.
> > Oshawa, Ontario L1J 6V6
> > (905) 728-8543 fax 728-0815
> >
> >
>
>
> Rick Osborn & Associates
> 885 Sorrento Ave.
> Oshawa, Ontario L1J 6V6
> (905) 728-8543 fax 728-0815
>

__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html





SPONSORED LINKS
Investment management software Investment property software Investment software
Investment tracking software Return on investment software

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___