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

[amibroker] AFL language from a Trade Station scan



PureBytes Links

Trading Reference Links

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