PureBytes Links
Trading Reference Links
|
Mike,
1. it is the equation of a circle. The radius is small [R=1] and it
appears like a rhomboid.
2. You may mark all peaks/troughs with the
x=Cum(1);
per = 5;//Sensitivity
pR = PeakBars( H, per, 1 ) == 0;
x01= ValueWhen( pR, x );
y01 = ValueWhen( pR, H ) ;
Plot(C,"",1,64);
y0=y01;x0=x01;
Plot(IIf(x==x01,y01+0.02*abs(y01),-1e10),"",4,8);
TpR = TroughBars( L, per, 1 ) == 0;
x01T= ValueWhen( TpR, x, 1 );
y01T = ValueWhen( TpR, L, 1 ) ;
Plot(IIf(x==x01T,y01T-0.02*abs(y01T),-1e10),"",5,8);
If you have some fixed period in the past, you should express it via
the respective x=cum(1)
C1=condition;
t1=valuewhen(C1,x);
and then ask
Plot(IIf(x==x01 AND x>t1,y01+0.02*abs(y01),-1e10),"",4,8);
DT
--- In amibroker@xxxx, Mike Pham <mmqp@xxxx> wrote:
> Dimitris,
>
> Execellent application of AB codes. I have couple of
> questions for you:
>
> 1.> y=y0+m*sqrt(R^2-(x-x0)^2);
> Is this the circle equation that you use to circle the
> interesting point?
>
> 2. All your Interesting points were referenced to the
> current periods. What if I'd like to find all troughs
> and peaks starting from some fixed period in the past
> and order all those points with the first point
> referenced to the first fixed period.
>
> Can you steer me to the right direction?
> I hoped my question is clear enough. TIA.
> --- Dimitris Tsokakis <TSOKAKIS@xxxx> wrote:
> > Let us mark with a small circle the last 3 recent
> > peaks and troughs.
> > /*Marking recent peaks and troughs*/
> > R=1;//Marking circle radius
> > m=0.015*(HHV(H,159)-LLV(L,159));//scaling factor
> > x=Cum(1);
> > per = 5;//Sensitivity Calibration
> > pR = PeakBars( H, per, 1 ) == 0;//Peak condition
> > x01= LastValue(ValueWhen( pR, x, 1 ));
> > x02=LastValue(ValueWhen( pR, x, 2 ));
> > x03=LastValue(ValueWhen( pR, x, 3 ));
> > y01 = LastValue(ValueWhen( pR, H, 1 ) );
> > y02=LastValue(ValueWhen( pR, H, 2 ) );
> > y03 = LastValue( ValueWhen( pR, H, 3 ));
> > Plot(C,"",1,64);
> > y0=y01;x0=x01;
> > y=y0+m*sqrt(R^2-(x-x0)^2);
> > y1=y0-m*sqrt(R^2-(x-x0)^2);
> > Plot(y,"",4,1);Plot(y1,"",4,1);
> > y0=y02;x0=x02;
> > y=y0+m*sqrt(R^2-(x-x0)^2);
> > y1=y0-m*sqrt(R^2-(x-x0)^2);
> > Plot(y,"",4,1);Plot(y1,"",4,1);
> > y0=y03;x0=x03;
> > y=y0+m*sqrt(R^2-(x-x0)^2);
> > y1=y0-m*sqrt(R^2-(x-x0)^2);
> > Plot(y,"",4,1);Plot(y1,"",4,1);
> > TpR = TroughBars( L, per, 1 ) == 0;//Trough
> > condition
> > x01T= LastValue(ValueWhen( TpR, x, 1 ));
> > x02T=LastValue(ValueWhen( TpR, x, 2 ));
> > x03T=LastValue(ValueWhen( TpR, x, 3 ));
> > y01T = LastValue(ValueWhen( TpR, L, 1 ) );
> > y02T=LastValue(ValueWhen( TpR, L, 2 ) );
> > y03T = LastValue( ValueWhen( TpR, L, 3 ));
> > y0T=y01T;x0T=x01T;
> > y=y0T+m*sqrt(R^2-(x-x0T)^2);
> > y1=y0T-m*sqrt(R^2-(x-x0T)^2);
> > Plot(Y,"",5,1);Plot(Y1,"",5,1);
> > y0T=y02T;x0T=x02T;
> > y=y0T+m*sqrt(R^2-(x-x0T)^2);
> > y1=y0T-m*sqrt(R^2-(x-x0T)^2);
> > Plot(y,"",5,1);Plot(y1,"",5,1);
> > y0T=y03T;x0T=x03T;
> > y=y0T+m*sqrt(R^2-(x-x0T)^2);
> > y1=y0T-m*sqrt(R^2-(x-x0T)^2);
> > Plot(y,"",5,1);Plot(y1,"",5,1);
> > Title=Name()+", P1="+WriteVal(Y01,1.2)+",
> > P2="+WriteVal(Y02,1.2)+", P3="+WriteVal(Y03,1.2)
> > +", T1="+WriteVal(Y01T,1.2)+",
> > T2="+WriteVal(Y02T,1.2)+", T3="+WriteVal(Y03T,1.2);
> >
> > I suppose that you keep the default number of 159
> > quotations in a chart and you plot 2 or more charts
> > per sheet.
> > The same technique may be applied for other
> > interesting points of a certain graph. Insted of
> > Peak condition
> > you may have a cross, buy, sell, highest, lowest or
> > any other condition.
> > The marking circles are permanent and independent of
> > selected stock.
> > They are also independent of prices [the same
> > apparent size for a scale 1 to 3 as for a 2500 to
> > 5000].
> > Dimitris Tsokakis
> >
>
> > ATTACHMENT part 2 image/gif name=pt1.gif
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Games - play chess, backgammon, pool and more
> http://games.yahoo.com/
|