PureBytes Links
Trading Reference Links
|
hello,
below was a try for TD sequential
yhis can be a starting point
stephane
MaxGraph=14<FONT
size=1>;
/********Optimize***********/
Opt1=9;
Opt2=13;
/*********Setup Buy*********/
TD1=IIf<FONT
size=1>(Close<Ref<FONT
size=1>(Close,-4<FONT
size=1>),1,<FONT
color=#ff00ff size=1>0);
TD2=IIf(<FONT
color=#0000ff size=1>BarsSince(<FONT color=#0000ff
size=1>BarsSince(TD1))==Opt1, <FONT color=#ff00ff
size=1>1,0<FONT
size=1>);
TD3= H>=Ref<FONT
size=1>(LLV<FONT
size=1>(L,BarsSince<FONT
size=1>(BarsSince<FONT
size=1>(TD1))),-3);
TD4= Ref<FONT
size=1>(C,-Opt1)>=Ref<FONT
size=1>(C,-Opt2);
SetupBuy= TD3 AND TD2 AND TD4;<FONT color=#008000
size=1>
/***********SetupSell************/
TD1=IIf<FONT
size=1>(Close>Ref<FONT
size=1>(Close,-4<FONT
size=1>),1,<FONT
color=#ff00ff size=1>0);
TD2=IIf(<FONT
color=#0000ff size=1>BarsSince(<FONT color=#0000ff
size=1>BarsSince(TD1))==Opt1, <FONT color=#ff00ff
size=1>1,0<FONT
size=1>);
TD3= L<=Ref<FONT
size=1>(HHV<FONT
size=1>(H,BarsSince<FONT
size=1>(BarsSince<FONT
size=1>(TD1))),-1);
TD4= Ref<FONT
size=1>(C,-Opt1)<=Ref<FONT
size=1>(C,-Opt2);
SetupSell= TD3 AND TD2 AND TD4 ;<FONT color=#008000
size=1>
/*********Count Buy ********/
CountBuy= Sum<FONT
size=1>(IIf<FONT
size=1>(C<Ref<FONT
size=1>(C,-2<FONT
size=1>),1,<FONT
color=#ff00ff size=1>0),<FONT color=#0000ff
size=1>BarsSince(SetupBuy)+<FONT color=#ff00ff
size=1>1);
/*********Count Sell ********/
CountSell= Sum<FONT
size=1>(IIf<FONT
size=1>(C>Ref<FONT
size=1>(C,-2<FONT
size=1>),1,<FONT
color=#ff00ff size=1>0),<FONT color=#0000ff
size=1>BarsSince(SetupSell)+<FONT color=#ff00ff
size=1>1);
/***********A***********/
B1= CountBuy >=Opt2;
B1= Hold<FONT
size=1>(B1==0,<FONT
color=#ff00ff size=1>2) AND B1;
Sell= SetUpsell;
Buy= SetUpbuy;
Ccount=IIf<FONT
size=1>(B1,ValueWhen<FONT
size=1>(B1,HHV<FONT
size=1>(C,BarsSince<FONT
size=1>(Buy))),0<FONT
size=1>);
Hsetup=IIf<FONT
size=1>(B1,ValueWhen<FONT
size=1>(Buy,HHV<FONT
size=1>(H,Opt1)),0<FONT
size=1>);
BuyA=B1 AND (<FONT color=#0000ff
size=1>HighestSinceBars<FONT
size=1>(Buy,Buy)<
HighestSinceBars(Sell,Sell)) AND
Hsetup > Ccount;
/******B**********/
B1= CountBuy >=Opt2;
B2= CountBuy >Opt2 AND Close > <FONT color=#0000ff
size=1>Ref(Close,-<FONT color=#ff00ff
size=1>4);
Ccount=IIf<FONT
size=1>(B1,ValueWhen<FONT
size=1>(B1,HHV<FONT
size=1>(C,BarsSince<FONT
size=1>(Buy))),0<FONT
size=1>);
Hsetup=IIf<FONT
size=1>(B1,ValueWhen<FONT
size=1>(Buy,HHV<FONT
size=1>(H,Opt1)),0<FONT
size=1>);
B1=Hold<FONT
size=1>(B1==0,<FONT
color=#ff00ff size=1>2) AND B1;
B2=Hold<FONT
size=1>(B2==0,<FONT
color=#ff00ff size=1>2) AND B2;
BuyB=ExRem(B2,B1)
AND
(HighestSinceBars<FONT
size=1>(Buy,Buy)<
HighestSinceBars(Sell,Sell)) AND
Hsetup > Ccount;
/*************C***********/
B1= CountBuy >=Opt2;
B3= CountBuy >Opt2 AND Close > <FONT color=#0000ff
size=1>Ref(High,-<FONT color=#ff00ff
size=1>2);
Ccount=IIf<FONT
size=1>(B1,ValueWhen<FONT
size=1>(B1,HHV<FONT
size=1>(C,BarsSince<FONT
size=1>(Buy))),0<FONT
size=1>);
Hsetup=IIf<FONT
size=1>(B1,ValueWhen<FONT
size=1>(Buy,HHV<FONT
size=1>(H,Opt1)),0<FONT
size=1>);
B1= Hold<FONT
size=1>(B1==0,<FONT
color=#ff00ff size=1>2) AND B1;
B3= Hold<FONT
size=1>(B3==0,<FONT
color=#ff00ff size=1>2) AND B3;
BuyC= ExRem(B3,B1)
AND
(HighestSinceBars<FONT
size=1>(Buy,Buy)<
HighestSinceBars(Sell,Sell)) AND
Hsetup > Ccount;
/***********D************/
B1= CountBuy >=Opt2;
B4= CountBuy >Opt2 AND Close>Open AND
(C-O) > ((H-C)+(O-L)) ;
Ccount= IIf<FONT
size=1>(B1,ValueWhen<FONT
size=1>(B1,HHV<FONT
size=1>(C,BarsSince<FONT
size=1>(Buy))),0<FONT
size=1>);
Hsetup=IIf<FONT
size=1>(B1,ValueWhen<FONT
size=1>(Buy,HHV<FONT
size=1>(H,Opt1)),0<FONT
size=1>);
B1=Hold<FONT
size=1>(B1==0,<FONT
color=#ff00ff size=1>2) AND B1;
B4=Hold<FONT
size=1>(B4==0,<FONT
color=#ff00ff size=1>2) AND B4;
BuyD= ExRem(B4,B1)
AND
(HighestSinceBars<FONT
size=1>(Buy,Buy)<
HighestSinceBars(Sell,Sell)) AND
Hsetup > Ccount;
/************Buy Signal********/
Buy=(BuyB OR BuyC OR BuyD) ;<FONT color=#0000ff
size=1>
Plot(C,<FONT color=#ff00ff
size=1>"",IIf<FONT
size=1>(Buy,5<FONT
size=1>,1),<FONT
color=#ff00ff size=1>64);<FONT color=#0000ff
size=1>
Plot(Buy*C,<FONT color=#ff00ff
size=1>"",2<FONT
size=1>,2);
<BLOCKQUOTE
>
----- Original Message -----
<DIV
>From:
Brian
To: <A title=amibroker@xxxxxxxxxxxxxxx
href="">amibroker@xxxxxxxxxxxxxxx
Sent: Tuesday, May 04, 2004 7:01 AM
Subject: [amibroker] Re: AFL Syntax
Question #2 (New)
I am trying to get this so a yellow arrow shows a cancelled
buy setup. If a post-setup intraday high exceeds the highest close (from
during the 9-day setup), the buy is cancelled. I'm not sure how to
properly pull the highest close from the setup, so that it may be
compared to the highest high during the post-setup. Any
ideas?Thanks!Brian/*Tom DeMark's Sequential (TD
Sequential)*/// Set variables herevarTDSCompare = C; //
default C, may also use H, L, O// End set
variablesvarTDSBuy=IIf(C<Ref(varTDSCompare,-4)AND
Ref(varTDSCompare,-1)<Ref(varTDSCompare,-5)AND
Ref(varTDSCompare,-2)<Ref(varTDSCompare,-6)AND
Ref(varTDSCompare,-3)<Ref(varTDSCompare,-7)AND
Ref(varTDSCompare,-4)<Ref(varTDSCompare,-8)AND
Ref(varTDSCompare,-5)<Ref(varTDSCompare,-9)AND
Ref(varTDSCompare,-6)<Ref(varTDSCompare,-10)AND
Ref(varTDSCompare,-7)<Ref(varTDSCompare,-11)AND
Ref(varTDSCompare,-8)<Ref(varTDSCompare,-12)AND
Ref(varTDSCompare,-9)>=Ref(varTDSCompare,-13)AND
L<Ref(L,-5),1,0);Plot(Close, "Close",1,64);// Setup
Cancellation #1// Post-setup intraday high exceeds highest close of 10-day
setupIIf(varTDSBuy>0,varHighestClose =
HHV(Close,9),0);varTDSBarcount =
BarsSince(varTDSBuy>0);varTDSCancel_1 =
IIf(HHV(High,varTDSBarcount)>varHighestClose,1,0);IIf(varTDSBuy>0
AND
varTDSCancel_1<1,PlotShapes(shapeUpArrow*varTDSBuy,colorGreen),0);IIf(varTDSBuy>0
AND
varTDSCancel_1>0,PlotShapes(shapeUpArrow*varTDSBuy,colorYellow),0);Send
BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to
suggest@xxxxxxxxxxxxx-----------------------------------------Post
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A
href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check
group FAQ at: <A
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
__________
NOD32 1.749 (20040503) Information __________This message was checked
by NOD32 antivirus system.<A
href="">http://www.nod32.com
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Sponsor
ADVERTISEMENT
Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/amibroker/
To unsubscribe from this group, send an email to:amibroker-unsubscribe@xxxxxxxxxxxxxxx
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
|