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

Re: [amibroker] Expanded Aroon Indicator



PureBytes Links

Trading Reference Links

>From long ago. Never got around to changing it.

Period = Param("Periods",14,2,100,1);
LLVBarsSince = LLVBars(L, Period);
HHVBarsSince = HHVBars(H, Period);

AD = 100 * (Period - LLVBarsSince) / Period ;
AU   = 100 * (Period - HHVBarsSince) / Period ;
AO  = AU - AD;
GraphXSpace=6;
Plot(AD,"Aroon Down",0,1);
Plot(AU,"Aroon Up",1,1);
//Plot(AO,"Aroon Osc",3,1);PlotGrid(50,0);PlotGrid(-50,0);
Title=" Aroon     Periods:"+Period+" ";

-CS


----- Original Message ----- 
From: "Ken Close" <closeks@xxxxxxxx>
To: "AmiBroker List" <amibroker@xxxxxxxxxxxxxxx>
Sent: Monday, September 27, 2004 2:40 PM
Subject: [amibroker] Expanded Aroon Indicator


> I pulled the Aroon indicator, written by Tomasz, from the library.
> While you can see it in its entirety there, let me reproduce one part of
> it in order to ask my question.
> 
> Here is the indicator (one half of it), AroonUp:
> 
> H14 = HHV( High, 14 );
> 
> AroonUp =
> 100 * ( 14 - ( ( IIf(Ref(H ,-1) == H14 ,1 ,
> IIf(Ref(H ,-2 ) == H14 ,2,
> IIf(Ref(H ,-3 ) == H14 ,3, 
> IIf(Ref(H ,-4 ) == H14 ,4 ,
> IIf(Ref(H ,-5 ) == H14 ,5 ,
> IIf(Ref(H ,-6 ) == H14 ,6 ,
> IIf(Ref(H ,-7 ) == H14 ,7 ,
> IIf(Ref(H ,-8 ) == H14 ,8 , 
> IIf(Ref(H ,-9 ) == H14 ,9 ,
> IIf(Ref(H ,-10 ) == H14 ,10 ,
> IIf(Ref(H ,-11 ) == H14 ,11 ,
> IIf(Ref(H ,-12 ) == H14 ,12 ,
> IIf(Ref(H ,-13) == H14 ,13 ,
> IIf(Ref(H ,-14 ) == H14 ,14 ,0 ) ) ) ) ) )
> ) ) ) ) ) ) ) ) ) ) ) / 14;
> 
> Now, putting in a Parameter statement for the HHV length of 14 is
> obviously meaningless because the ArronUp statement has 14 IIf
> comparisons. 
> 
> My question for those loop writers who are more experienced than me is
> this: how do you construct a loop structure which increase the
> comparison sections as the lookback period increases or decreases the
> comparison sections as the lookback period decreases.
> 
> Tomasz wrote this Aroon structure in the days (2001) before Amibroker
> had loops and functions etc.  So how could it be written today in order
> to easily change the lookback period without massive changes to the IIf
> comparisons?
> 
> I hope the question is clear; if not, ask and I will attempt another
> explanation.
> 
> Any ideas?
> 
> Thanks,
> 
> Ken


[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/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/