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

Re: [amibroker] Yahoo EOD data not always correct ?



PureBytes Links

Trading Reference Links

Arthur,

Per TASC June,2002 Your tradestation formula is the Trend Intensity 
Index and not Trend Intensity Indicator. Well actually all you are 
missing is
if TII >80 then
  Buy next bar at market
else if TII < 20 then 
  Sell next bar at market; 
Do you need the Trend Intensity Index?
If so this is what I have

x=Param("number of periods", 5,5,100,5);
Mov=MA(C,2*x);
sdp=Sum(IIf(C-Mov>0, C-Mov,0),x);
sdm=Sum(IIf(Mov-C>0, Mov-C,0),x);
TII = sdp / ( sdp + sdm ) * 100 ;
Plot(TII,"TII",1,1); 
//IIf(TII>=80, 1, IIf(TII<=20,-1, 0));



Hope This Helps,

John


--- In amibroker@xxxxxxxxxxxxxxx, Bundy <bundy@xxxx> wrote:
> I have a tradestation formula for an indicator called the Trend 
Intensity Indicator.

I am aware there is an indicator called the Trade Intensity Index 
that has already been covered in the mailing list, but I am led to 
understand that this indicator is different.

I am wondering if someone could please translate the code to AFL?

inputs:
        AvgLength( 60 ), 
        DevCalcLength( 30 ) ;
variables:
        Avg( 0 ), 
        SDPlus( 0 ), 
        SDMinus( 0 ), 
        Dev( 0 ), 
        Offset( 0 ), 
        TII( 0 ) ;
Avg = Average( Close, AvgLength ) ;
SDPlus = 0 ;
SDMinus = 0 ;
for Offset = 0 to DevCalcLength - 1
        begin
        Dev = Close[Offset] - Avg ;
        if Dev > 0 then
                SDPlus = SDPlus + Dev
        else
                SDMinus = SDMinus - Dev ;
        end ;
TII = SDPlus / ( SDPlus + SDMinus ) * 100 ;
Plot1(TII,"TrendInten");

Arthur




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/