Notes
Notes - notes.io |
_SECTION_BEGIN("TD Sequential");
GraphXSpace =10;
Compress= Param("Compress",1,1,100,1);
TimeFrameSet(Compress* Interval());
/********Optimize***********/
Opt1=Param("Opt1",9,5,21,1);
Opt2=Param("Opt2",13,1,21,1);
/*********Setup Buy*********/
TD1=IIf(Close<Ref(Close,-4),1,0);
TD2=IIf(BarsSince(BarsSince(TD1))==Opt1, 1,0); //Sum(TD1,9)==9;
TD3= Ref(H,-1)>=Ref(LLV(L,Opt1-4),-3);
TD4= Ref(C,-Opt1)>=Ref(C,-Opt2);
SetupBuy= TD3 AND TD2 AND TD4;
/***********SetupSell************/
TD1=IIf(Close>Ref(Close,-4),1,0);
TD2=IIf(BarsSince(BarsSince(TD1))==Opt1, 1,0);
TD3= Ref(L,-1)<=Ref(HHV(H,Opt1-4),-3);
TD4= Ref(C,-Opt1)<=Ref(C,-Opt2);
SetupSell= TD3 AND TD2 AND TD4 ;
/*********Count Buy ********/
CountBuy= Sum(IIf(C<Ref(C,-2),1,0),BarsSince(SetupBuy));
//or C<Ref(H,-2)
/*********Count Sell ********/
CountSell= Sum(IIf(C>Ref(C,-2),1,0),BarsSince(SetupSell));
//or C>Ref(L,-2)
/***********A***********/
B1= CountBuy >=Opt2;
B1= Hold(B1==0,2) AND B1;
Timing=(BarsSince(SetUpbuy)< BarsSince(SetUpsell));
Ccount=IIf(CountBuy >=Opt2,ValueWhen(B1,HHV(C,BarsSince(SetupBuy))),Null);
Hsetup=IIf(CountBuy >=Opt2,ValueWhen(SetupBuy,HHV(H,Opt1)),Null);
BuyA=B1 AND Timing AND Hsetup > Ccount;
/******B**********/
B2= CountBuy >Opt2 AND Close > Ref(Close,-4);
B2=Hold(B2==0,2) AND B2;
B2=ExRem(B2,B1);
BuyB=B2 AND Timing AND Hsetup > Ccount;
/*************C***********/
B3= CountBuy >Opt2 AND Close > Ref(High,-2);
B3= Hold(B3==0,2) AND B3;
B3=ExRem(B3,B1);
BuyC= B3 AND Timing AND Hsetup > Ccount;
/************Buy Signal********/
Buy=BuyB OR BuyC ;
////////////////////////////////
//SHORT
/////////////////////////////////
/***********A***********/
S1= CountSell >=Opt2;
S1= Hold(S1==0,2) AND S1;
Timing=(BarsSince(SetUpSell)< BarsSince(SetUpbuy));
Ccount=IIf(CountSell >=Opt2,ValueWhen(S1,LLV(C,BarsSince(SetupSell))),Null);
Lsetup=IIf(CountSell >=Opt2,ValueWhen(SetupSell,LLV(L,Opt1)),Null);
SellA=S1 AND Timing AND Lsetup < Ccount;
/******B**********/
S2= CountSell >Opt2 AND Close < Ref(Close,-4);
S2=Hold(S2==0,2) AND S2;
S2=ExRem(S2,S1);
SellB=S2 AND Timing AND Lsetup < Ccount;
/*************C***********/
S3= CountSell >Opt2 AND Close < Ref(Low,-2);
S3= Hold(S3==0,2) AND S3;
S3=ExRem(S3,S1);
SellC= S3 AND Timing AND Lsetup < Ccount;
/***********Short Signal********/
Short= SellB OR SellC ;
StyleList= ParamList("Chart Style", "Bar,Candle");
style =IIf(StyleList== "Bar", styleBar,styleCandle);
PlotShapes(IIf(Short,
shapeDownArrow,shapeNone),colorRed,0,H,-10);
PlotShapes(IIf(Buy,
shapeUpArrow,shapeNone),colorBrightGreen,0,L,-10);
PlotShapes(IIf(SetupSell,
shapeDigit9,shapeNone),colorRed,0,H,10);
PlotShapes(IIf(SetupBuy,
shapeDigit9,shapeNone),colorGreen,0,L,-10);
Color= IIf(SetupSell OR SetupBuy,colorYellow,
IIf(Buy, colorBrightGreen,
IIf(Short,colorRed, 39)));
Plot(C,"",color,style);
Title = Name() +" ("+ FullName()+ ")" +" TD Sequential"+"n"+
"Timeframe: " + Interval(2) +"n"+
Date() +"n"
;
_SECTION_END();
Write a note in this area. It's really easy to share with others. Click here ...
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team