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

Re: [amibroker] Re: afl help, suggestion needed



PureBytes Links

Trading Reference Links

Thanks for your reply, I'll give it a try

Sent from my iPhone

On Mar 17, 2008, at 5:14 AM, "brian_z111" <brian_z111@xxxxxxxxx> wrote:

Alma Miranda,

I have added a homemade 'smoothness' indicator to Ian/Tomasz's
RSquared (it is a interesting comparison).

Run in an exploration and sort columns by R2 or SLR(StraightLineRatio)
to see that they report similar things.

The logic of SLR is "how long is a piece of string?"

I added every daily $move and compared that to the point to point
$Value as a ratio - it is not an abolute indicator - it only shows
relative smoothness - I tried % changes but that doesn't work.

Other candidates for smoothness that I can think of are StDev and
StandardError (the regression version?).

I have been a little bit interested ever since I studied Professor
John Prices techno-fundamental method (he picks stocks based
on 'smooth' earnings growth) - I figured 'smooth' charts might be a
TA surrogate for 'smooth' earnings and save the trouble of doing the
fundamental calculations.

http://www.conscious-investor.com/index.html

Here is the modified formula:

//F_RSquared
//Tomasz Janeczko
//Adapted by Ian Watts

//I have changed it slightly to use R * R instead
//of R^2 to speed up the calculation.

//The exploration aims to find stocks that are
//currently going up OR down relatively
//smoothly.

function RSquared(array, periods)
{
R = Correlation(BarIndex(), array,
periods );
R2 = R * R;
return R2;
}

Periods = 250;

R2 = RSquared(C, Periods);
LVR2 = LastValue(R2);

//Filter = LVR2 > 0.9;

Filter = 1;

AddColumn(R2, "RSquared",1.1);

/////////////////////////////////////////////////////////

//P_StraightLineRatio

//Periods = 250;

Change = abs(C - Ref(C,-1));

Total = Sum(Change,Periods);

StraightLine = abs(C - Ref(C,-Periods));

StraightLineRatio = Total/StraightLine;

Filter = 1;
//Filter = StraightLineRatio <= 30;
//Filter = BarCount == 1305;

AddColumn(StraightLineRatio,"SLR",1.1);
AddColumn(BarCount,"BarCount",1);

Plot(StraightLineRatio,"SLR",1,1);

Have fun,

brian_z

--- In amibroker@xxxxxxxxxps.com, "Ian Watts" <idw456@xxx> wrote:
>
> Brian
>
> The function was written by Thomasz and can be
> found here:
> http://www.traders.com/Documentation/
> FEEDbk_docs/Archive/122007/TradersTips/
> TradersTips.html#amibroker
>
>
> function RSquared(array, periods)
> {
> R = Correlation(BarIndex(), array,
> periods );
> R2 = R * R;
> return R2;
> }
>
> R2 = RSquared(C, NoPeriods);
> LVR2 = LastValue(R2);
> Filter = LVR2 > 0.9;
>
> I have changed it slightly to use R * R instead
> of R^2 to speed up the calculation.
>
> The exploration aims to find stocks that are
> currently going up or down relatively
> smoothly.
>
> All the Best
>
> Ian
>
> --- In amibroker@xxxxxxxxxps.com,
> "brian_z111" <brian_z111@> wrote:
> >
> > Ian Watts,
> >
> > How can I do that in AFL?
> > Have you seen the R-Squared formula at the
> AFL library - any comment
> > on that?
> >
> > Any hints greatly appreciated.
> >
> > Thanks,
> >
> > brian_z
> >
> >
> > --- In amibroker@xxxxxxxxxps.com, "Ian
> Watts" <idw456@> wrote:
> > >
> > > A method I use is to fit a least squares
> line
> > > to the last 20 or so bars. Then calculate
> R
> > > Squared and select the stocks with the
> highest
> > > values of R Squared.
> > >
> > > Regards
> > >
> > > Ian
> > >
> > >
> > > --- In amibroker@xxxxxxxxxps.com,
> > > "safetrading" <safetrading@> wrote:
> > > >
> > > > With every strategy I have used, I have
> > > always noticed that I get
> > > > whipsawed out more often with stocks that
> > > don't flow smoothly and
> > > > therefore have tried to create a filter
> that
> > > does nothing more than
> > > > find stocks which flow smoothly up and
> down.
> > > >
> > > > The best I have come up with is one that
> > > simply limits the number of
> > > > up and down fractals in a given time
> period.
> > > While this helps, it
> > > > does not really produce what I was hoping
> to
> > > get.
> > > >
> > > > Can anyone offer any help or suggestions
> with
> > > this?
> > > >
> > > > Thanks,
> > > >
> > > > Safetrading
> > > >
> > >
> >
>

8px 0; } #ygrp-sponsor .ad #hd1{ font-family: Arial; font-weight: bold; color: #628c2a; font-size: 100%; line-height: 122%; } #ygrp-sponsor .ad a{ text-decoration: none; } #ygrp-sponsor .ad a:hover{ text-decoration: underline; } #ygrp-sponsor .ad p{ margin: 0; } o{font-size: 0; } .MsoNormal{ margin: 0 0 0 0; } #ygrp-text tt{ font-size: 120%; } blockquote{margin: 0 0 0 4px;} .replbq{margin:4} -->


Looking for last minute shopping deals? Find them fast with Yahoo! Search. __._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___