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

[amibroker] Convexity(was Re: rate of change/acceleration - Dimitri)



PureBytes Links

Trading Reference Links

The absolute convexity criterion would be
freq = 1;
y=sin( Cum( freq/10 ) );
t=1;
Convex=(y-Ref(y,-t))/t>(y-Ref(y,-(t+1)))/(t+1);
Plot(y,"",IIf(Convex,colorBrightGreen,colorRed),8);
Of course, in real life examples this would not help, even in smooth 
curves.
Try the

y=MA(StochD(50),50);
freq = 1;
//y=sin( Cum( freq/10 ) );
t=1;
Convex=(y-Ref(y,-t))/t>(y-Ref(y,-(t+1)))/(t+1);
Plot(y,"",IIf(Convex,colorBrightGreen,colorRed),8);

Although y is quite smooth, the convexity does not hold for long.
At this stage, we should sacrifice the absolute convexity for more 
useful conditions.
Try t=5 or t=10 to see what I mean

y=MA(StochD(50),50);
freq = 1;
//y=sin( Cum( freq/10 ) );
t=1;// t=5 or t=10 or higher
Convex=(y-Ref(y,-t))/t>(y-Ref(y,-(t+1)))/(t+1);
Plot(y,"",IIf(Convex,colorBrightGreen,colorRed),8);

Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx> 
wrote:
> An idea for a convexity criterion is the condition
> Convex=y>2*Ref(y,-t)-Ref(y,-2*t);
> for a given array y and a time segment t.
> Try the example
> 
> // Convexity criterion
> freq = 1;
> y=sin( Cum( freq/10 ) );
> t=5;
> Convex=y>2*Ref(y,-t)-Ref(y,-2*t);
> Plot(y,"",IIf(Convex,colorBrightGreen,colorRed),8);
> 
> in IB, if it is what you ask.
> [The non-convex area (red)is the concavity condition, since the 
above 
> condition is boolean.]
> 
> Dimitris Tsokakis
> --- In amibroker@xxxxxxxxxxxxxxx, "sidleysh" <steves@xxxx> wrote:
> > DT - the problem with this is that it gives a 2 day acceleration 
> > picture - I am looking to find the accelaration over x days 
(which 
> is 
> > easy to see visually - you simply look for a rising convex 
> pattern). 
> > 
> > Any idea how to generalise this?
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" 
> <TSOKAKIS@xxxx> 
> > wrote:
> > > The Velocity of Close should be
> > > Vc=dC/dt
> > > and the acceleration
> > > g=dVc/dt
> > > The minimum dt for daily data is 1 bar, ie
> > > Vc=dC
> > > g=dVc
> > > In AFL
> > > Vc=C-Ref(C,-1);
> > > g=Vc-Ref(Vc,-1);
> > > Plot(g,"g",1,1);
> > > 
> > > Dimitris Tsokakis
> > > --- In amibroker@xxxxxxxxxxxxxxx, "sidleysh" <steves@xxxx> 
wrote:
> > > > I am trying to find a way to find out whether, and how much, 
a 
> > > chart 
> > > > has accelerted over the previous period. This is not ROC, but 
> > more 
> > > > true 'rate of change' in a differential calculus sense. 
> > > > 
> > > > IN other words - if diff between close today snd  close 
> yesterday 
> > > 
> > > > close yesterday and the day before, then the close prices are 
> > > > ACCELERATING up over the last 3 days.
> > > > 
> > > > Can anyone think up a general way to code this?


------------------------ 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/