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

[amibroker] Re: FW: [RT] Next Week Nikkei



PureBytes Links

Trading Reference Links

Another, interesting test:
Explore for the n=1 last quotations with
// Percentage threshold for H&S formation
HS=0;
for(per = 1;per<20;per++)
{
x = Cum(1);
back=100;
inter=200;
s11=H;s12=L;R=0;RR=0;
/* H & S */
pR = PeakBars( s11, per, 1 ) == 0;
endt1= LastValue(ValueWhen( pR, x, R+1 ));
medt1=LastValue(ValueWhen( pR, x, R+2));
startt1=LastValue(ValueWhen( pR, x, R+3 ));
dt1=endt1-startt1;
C1=x==endt1 OR x==medt1 OR x==startt1;
endR = LastValue(ValueWhen( pR, s11, R+1 ) );
medR=LastValue(ValueWhen( pR, s11, R+2 ) );
startR = LastValue( ValueWhen( pR, s11, R+3  ));
Filter1=medR>endR AND medR>startR AND abs(startR-endR)<0.02*
(startR+endR) AND
dt1<inter AND endt1>LastValue(x)-back;
AddColumn(Filter1,"H&S"+WriteVal(per,1.0),1.0);
HS=HS+Filter1;
}
Filter=HS>0 ;
AddColumn(HS,"HS");
The recent ^N225 H&S was detectable for per=1, 2 and 3.
This sensitivity is very low for the usual N100 trends, I prefer 
per=5 for the N100 to avoid repetitive [false] signals.
If you explore the database for the n=1 last quotations you will see 
the per= distribution and choose the best per= value.
Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx> 
wrote:
> Franko,
> The Historical H&S [and inv H&S] together with the necklines is
> 
> x = Cum(1);
> per = 3;
> back=100;
> inter=200;
> s11=H;s12=L;R=0;RR=0;
> /* H & S */
> pR = PeakBars( s11, per, 1 ) == 0;
> endt1= SelectedValue(ValueWhen( pR, x, R+1 ));
> medt1=SelectedValue(ValueWhen( pR, x, R+2));
> startt1=SelectedValue(ValueWhen( pR, x, R+3 ));
> dt1=endt1-startt1;
> C1=x==endt1 OR x==medt1 OR x==startt1;
> endR = SelectedValue(ValueWhen( pR, s11, R+1 ) );
> medR=SelectedValue(ValueWhen( pR, s11, R+2 ) );
> startR = SelectedValue( ValueWhen( pR, s11, R+3  ));
> Filter1=medR>endR AND medR>startR AND abs(startR-endR)<0.02*
> (startR+endR) AND
> dt1<inter AND endt1>SelectedValue(x)-back;
> MaxGraph=12;Graph1=C;Graph1Style=64;GraphXSpace=5;
> /*H&S Neck Line*/
> Aper=medt1-startt1;bper=endt1-medt1;
> La=  SelectedValue(ValueWhen(x==medt1,LLV(L,Aper)));
> Lb=SelectedValue(ValueWhen(x==-1+endt1,LLV(L,bper)));
> Fa=L==La AND x>startt1 AND x<medt1;
> Fb=L==Lb AND x>medt1 AND x<endt1;
> endt= SelectedValue(ValueWhen( Fb, x ));
> startt=SelectedValue(ValueWhen( Fa, x ));
> dtS =endt-startt;endS = Lb;startS = La;
> aS = (endS-startS)/dtS;bS = endS;
> trendlineS = aS * ( x  -endt ) + bS; 
> Graph3 = IIf(Filter1 AND x>startt-5 AND x<endt+back,trendlineS,-
> 1e10);Graph3BarColor=7;
> /*Inverted H & S*/
> tpR = TroughBars( s12, per, 1 ) == 0;
> tendt1=SelectedValue(ValueWhen(tpr,x,RR+1));
> tmedt1=SelectedValue(ValueWhen(tpr,x,RR+2));
> tstartt1=SelectedValue(ValueWhen(tpr,x,RR+3));
> tdt1=tendt1-tstartt1;
> C2=x==tendt1 OR x==tmedt1 OR x==tstartt1;
> tendR = SelectedValue(ValueWhen( tpR, s12, RR+1 ) );
> tmedR=SelectedValue(ValueWhen( tpR, s12, RR+2 ) );
> tstartR = SelectedValue( ValueWhen( tpR, s12, RR+3  ));
> Filter2=tmedR<tendR AND tmedR<tstartR AND
> abs(tstartR-tendR)<0.02*(tstartR+tendR) AND tdt1<inter AND
> tendt1>SelectedValue(x)-back;
> /*Inverted H&S Neck Line*/
> tAper=tmedt1-tstartt1;tbper=tendt1-tmedt1;
> Ha=  SelectedValue(ValueWhen(x==tmedt1,HHV(H,tAper)));
> Hb=SelectedValue(ValueWhen(x==-1+tendt1,HHV(H,tbper)));
> tFa=H==Ha AND x>tstartt1 AND x<tmedt1;
> tFb=H==Hb AND x>tmedt1 AND x<tendt1;
> Rendt= SelectedValue(ValueWhen(tFb, x ));
> Rstartt=SelectedValue(ValueWhen( tFa, x ));
> Rdt =Rendt-Rstartt;endR = Hb;startR = Ha;
> aR = (endR-startR)/Rdt;bR = endR;
> trendlineR = aR * ( x  -Rendt ) + bR; 
> Graph4 = IIf(Filter2 AND x>Rstartt-5 AND x<Rendt+back,trendlineR,-
> 1e10);Graph4BarColor=10;
> upcr=filter2 AND Cross(C,trendlineR) AND x>tendt1;
> dncr=filter1 AND Cross(trendlineS,C) AND x>endt1;
> /*H&S target*/
> diff1=ValueWhen(x==medt1,C-trendlineS);
> target1=trendlineS-diff1;
> target1cross=Cross(target1,C) AND Filter1;
> Graph5=IIf(filter1 AND x>endt1 AND x<endt1+back,target1,-1e10);
> Graph5Style=8;Graph5BarColor=7;
> /*Inverted H&S target*/
> diff2=ValueWhen(x==tmedt1,trendlineR-C);
> target2=trendlineR+diff2;
> target2cross=Cross(C,target2) AND Filter2;
> Graph6=IIf(Filter2 AND x>tendt1 AND x<tendt1+back,target2,-
> 1e10);Graph6Style=8;Graph6BarColor=10;
> Graph1BarColor=IIf(C1 AND Filter1,7,IIf(C2 AND Filter2,10,IIf(upcr 
OR 
> target2cross,5,IIf(dncr OR target1cross,4,1))));
> 
> The recent ^N225 H&S was visible for per=3 [per stands for the zig 
> percentage...]
> Move your cursor to the right to see previous H&S formations.
> For the ^N225 go to the beginning of 2003 to see the simultaneous 
H&S 
> and invH&S.
> This is the objective side. Same per for both Nov and Jan, same H&S 
> detection, no matter if someone "sees" it or not.
> 
> --- In amibroker@xxxxxxxxxxxxxxx, Franco Gornati 
<francogornati@xxxx> 
> wrote:
> > DIMITRIS TSOKAKIS wrote:
> > 
> > > When the statistics is not on your side, then the decision is 
not 
> due 
> > > the the H&S pattern.[10 or 100 other important reasons but not 
> H&S].
> > 
> > Dimitris, sorry for the delay of the answer. I don't know exactly 
> the 
> > statistics you employ here but, on the methodological ground, you 
> should 
> > make them conditional on the information available.
> > If you are going to assign a probability to an event you 
shouldn't 
> drop 
> > bit of information. Counting the number of times something has 
> happened 
> > is only a part of the information available.
> > TA patterns (per se) are useless. For example, when we talk of 
> inversion 
> > H&S we are talking of a subset of all H&S. H&S for their very 
> > configuration are likely to be found at inversion point (just as 
> > divergences). But, think, I just discovered somewhere on the 
> Internet 
> > that also a H&S of continuation exist. Yes. They have exhausted 
> every 
> > possible world.
> > That's why I said that the simple mechanical H&S strategy is a 
poor 
> > strategy.
> > But if you have additional information, and Yuki amply provided 
it, 
> that 
> > you can synthesize in a coherent forecast and you gauge its 
> > probabilities (that are *always* subjective) positive for your 
> setup, 
> > then you go for the trade.
> 
> > Anyway, the only existence of a H&S configuration is not 
sufficient 
> > reason to take that trade.
> 
> I will agree 100%. We need more evidence. If there are any 
> suggestions from experience, we may add them to the above code to 
> make it better, as I wrote to Yuki. I would try to code additional 
> inputs, if the subject is interesting.
> Dimitris Tsokakis
> 
> > 
> > > For your further analysis, I may provide you with the 
Historical 
> H&S 
> > > code [similar to the Historical trendlines already posted here] 
> to 
> > > see the severe reality of the past right on your amibroker 
screen.
> > > Just let me know if you are interested...
> > 
> > It would be nice.
> > 
> > Take care,
> > 
> > Franco


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

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 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/