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

RE: [amibroker] AFL language from a Trade Station scan



PureBytes Links

Trading Reference Links

Mark,
 
The code below should work fine in an exploration.  You'd need to add columns and filter on the AverageEff.  I think the filter would look something like:
 
Buy = Averageeff > some number;
Sell = Averageeff < some number;
Filter = Buy or Sell;
 
Regards,
 
Dan.
-------------- Original message --------------
From: "Mark Keitel" <mkeitel@xxxxxxxxxxxxxxx>

Dan,

 

Alright I was trying to use it as an Explore or something like that and did not try it as just an indicator

 

 

Mark

 

 


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Dan Clark
Sent: Tuesday, December 20, 2005 9:50 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: RE: [amibroker] AFL language from a Trade Station scan

 

Mark,

 

When you say “…will not work…”, what do you mean?  When I tried it, it worked fine. 

 

Regards,

 

Dan.

 

p.s. Just so we are on the same page, here’s the code that I used:

 

ATRD180 = ATR(180);

ATRD90 = ATR(90);

ATRD45 = ATR(45);

ATRD20 = ATR(20);

ATRD5 = ATR(5);

 

DifferenceD180 = Close - Ref(Close,-180);

DifferenceD90 = Close - Ref(Close,-90);

DifferenceD45 = Close - Ref(Close,-45);

DifferenceD20 = Close - Ref(Close,-20);

DifferenceD5 = Close - Ref(Close,-5);

 

EfficiencyD180 = IIf(ATRD180!=0,DifferenceD180/ATRD180,1);

EfficiencyD90 = IIf(ATRD90!=0,DifferenceD90/ATRD90,1);

EfficiencyD45 = IIf(ATRD45!=0,DifferenceD45/ATRD45,1);

EfficiencyD20 = IIf(ATRD20!=0,DifferenceD20/ATRD20,1);

EfficiencyD5 = IIf(ATRD5!=0,DifferenceD5/ATRD5,1);

 

Averageeff = (EfficiencyD180 + EfficiencyD90 + EfficiencyD45 +

EfficiencyD20 ) / 4;

 

Plot( averageeff, "AvgEff", colorRed, styleLine );


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Mark Keitel
Sent: Tuesday, December 20, 2005 6:00 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: RE: [amibroker] AFL language from a Trade Station scan

 

Thank you

Though it will not work using the exact format as below

I must be missing something here

 

 

 

Mark

 

 

 


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Graham
Sent: Tuesday, December 20, 2005 12:24 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] AFL language from a Trade Station scan

 

Why is I see an error as soon as sent it
Change this line

DifferenceD5 = Close - Ref(Close,-5);



--
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://e-wire.net.au/~eb_kavan/ab_write.htm


On 12/20/05, Graham <kavemanperth@xxxxxxxxx> wrote:
> Try this
> ATRD180 = ATR(180);
> ATRD90 = ATR(90);
> ATRD45 = ATR(45);
> ATRD20 = ATR(20);
> ATRD5 = ATR(5);
>
> DifferenceD180 = Close - Ref(Close,-180);
> DifferenceD90 = Close - Ref(Close,-90);
> DifferenceD90 = Close - Ref(Close,-90);
> DifferenceD45 = Close - Ref(Close,-45);
> DifferenceD20 = Close - Ref(Close,-20);
> DifferenceD5 = Close - Ref(Close,5);
>
> EfficiencyD180 = IIf(ATRD180!=0,DifferenceD180/ATRD180,1);
> EfficiencyD90 = IIf(ATRD90!=0,DifferenceD90/ATRD90,1);
> EfficiencyD45 = IIf(ATRD45!=0,DifferenceD45/ATRD45,1);
> EfficiencyD20 = IIf(ATRD20!=0,DifferenceD20/ATRD20,1);
> EfficiencyD5 = IIf(ATRD5!=0,DifferenceD5/ATRD5,1);
>
> Averageeff = (EfficiencyD180 + EfficiencyD90 + EfficiencyD45 +
> EfficiencyD20 ) / 4;
>
> Plot( averageeff, "AvgEff", colorRed, styleLine );
>
>
> --
> Cheers
> Graham
> AB-Write >< Professional AFL Writing Service
> Yes, I write AFL code to your requirements
> http://e-wire.net.au/~eb_kavan/ab_write.htm
>
>
> On 12/20/05, aajohnah <aajohnah@xxxxxxxxxxxxxxx> wrote:
> >
> >
> > Efficiency Rating for stocks. It is a system for picking stocks that have a
> > strong trending action and go up 'no matter what'. The concept is credited
> > to Van K Tharpe,
> >
> >
> >
> >
> >
> > Below is the code from a Tradestation Indicator
> >
> > works fine as a plot or as a RadarScreen indicator for those of you who use
> > Tradestation.
> >
> >
> >
> > Thank you for any help on this
> >
> >
> >
> >
> >
> > Tradestation EasyLanguage.
> >
> >
> >
> > {Indicator: Avg Eff.}
> >
> >
> >
> >             inputs:
> >
> >                         Price(close),
> >
> >                         Length1(20),
> >
> >                         Length2(20),
> >
> >                         Displace(0),
> >
> >                         D180( 180 ),
> >
> >                         D90( 90 ),
> >
> >                         D45( 45 ),
> >
> >                         D20( 20 ),
> >
> >                         D5( 5 );
> >
> >
> >
> >             variables:
> >
> >                         ATRD180(0),
> >
> >                         ATRD90(0),
> >
> >                         ATRD45(0),
> >
> >                         ATRD20(0),
> >
> >                         ATRD5(0),
> >
> >                         DifferenceD180(0),
> >
> >                         DifferenceD90(0),
> >
> >                         DifferenceD45(0),
> >
> >                         DifferenceD20(0),
> >
> >                         DifferenceD5(0),
> >
> >                         EfficiencyD180(0),
> >
> >                         EfficiencyD90(0),
> >
> >                         EfficiencyD45(0),
> >
> >                         EfficiencyD20(0),
> >
> >                         EfficiencyD5(0),
> >
> >                         AverageEff(0);
> >
> >
> >
> >
> >
> >                         ATRD180 = AvgTrueRange(D180);
> >
> >                         ATRD90 = AvgTrueRange(D90);
> >
> >                         ATRD45 = AvgTrueRange(D45);
> >
> >                         ATRD20 = AvgTrueRange(D20);
> >
> >                         ATRD5 = AvgTrueRange(D5);
> >
> >
> >
> >                         DifferenceD180 = close - close[180];
> >
> >                         DifferenceD90 = close - close[90];
> >
> >                         DifferenceD90 = close - close[90];
> >
> >                         DifferenceD45 = close - close[45];
> >
> >                         DifferenceD20 = close - close[20];
> >
> >                         DifferenceD5 = close - close[5];
> >
> >
> >
> >                         EfficiencyD180 =
> > IFF(ATRD180<>0,DifferenceD180/ATRD180,1);
> >
> >                         EfficiencyD90 =
> > IFF(ATRD90<>0,DifferenceD90/ATRD90,1);
> >
> >                         EfficiencyD45 =
> > IFF(ATRD45<>0,DifferenceD45/ATRD45,1);
> >
> >                         EfficiencyD20 =
> > IFF(ATRD20<>0,DifferenceD20/ATRD20,1);
> >
> >                         EfficiencyD5 =
> > IFF(ATRD5<>0,DifferenceD5/ATRD5,1);
> >
> >                         Averageeff = (EfficiencyD180 + EfficiencyD90 +
> > EfficiencyD45 + EfficiencyD20 ) / 4;
> >
> >
> >
> >
> >
> >
> >
> > Plot1( AverageEff, "AverageEff" ) ;
> >
> >
> >
> >
> >
> > Mark
> >
>





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 other support material please check also:
http://www.amibroker.com/support.html





YAHOO! GROUPS LINKS