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

[amibroker] Re: Darvas Box



PureBytes Links

Trading Reference Links

Dan,
The Keltner channels AFL is at
http://www.amibroker.com/library/detail.php?id=43, comment III
The calculations are aligned to the international literature on the 
subject.
Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, "Dan" <amarones@xxxx> wrote:
> Does anyone in the group have expertise in Tradestation and 
EasyLanguage as well as AFL?
> I am trying to duplicate the Tradestation Keltner channel in 
Amibroker and have had no success so far. The Keltner Channel in the 
formula library does not duplicate the Tradestation Keltner Channel. 
I have written custom indicators for Amibroker based on the 
Tradestation webpage definition and explanation of the Keltner 
Channel and Average True Range. I suspect that Tradestation uses a 
SMA method to smooth the ATR unlike the Amibroker version.
> These are the parameters from the Tradestation website for the 
Keltner Channel:
> 
> Input Information
>       Name
>      Expression
>      Default
>      Description
>      
>       Price
>      Numeric
>      Close
>      Price used to calculate the midline.
>      
>       Length
>      Numeric
>      20
>      Length used to calculate the midline.
>      
>       Factor
>      Numeric
>      1.5
>      Factor applied to the average true range used to determine the 
Keltner Channel bands.
>      
>       Displace
>      Numeric
>      0
>      The number of bars to displace the plot of the Keltner Channel 
bands.
>      
> 
> 
> The midline is the key. I assumed it's default is a 20 period sma 
of the ATR.
> 
> Their parameters for the ATR are:
> 
> In his book, New Concepts in Technical Trading Systems, Welles 
Wilder, Jr. uses a value known as true range in his directional 
movement calculations. He defines true range as the larger of the 
following: 
> 
> ·      The distance between today's High and today's Low.
> 
> ·      The distance between today's High and yesterday's Close.
> 
> ·      The distance between today's Low and yesterday's Close.
> 
> AvgTrueRange is simply an average of the True Range values over a 
period of time. For more information, see TrueRange.
> 
> Function
> AvgTrueRange(Length)
> 
> Parameters
>       Length
>      Number of bars in the average.
>      
> 
> Returns
> A numeric value containing the average of the true range over 
Length bars.
> 
> Usage
> The AvgTrueRange tends to smooth out price bars of higher or lower 
than average volatility.
> 
> 
> 
> 
> 
> With this in mind I wrote the following indicator to add to the 
price window in Amibroker using my inputs of 8 periods and a 1.3 
factor(which doesn't duplicate the Tradestation result using those 
same inputs): 
> 
> RangeH=IIf(((H+L)/2)>((H+Ref(C,-1))/2),(H+L)/2,(H+Ref(C,-1))/2);
> 
> Range=IIf(RangeH>(L+Ref(C,-1))/2,RangeH,(L+Ref(C,-1))/2);
> 
> TruHi=IIf(H>Ref(C,-1),H,Ref(C,-1));
> 
> TruLo=IIf(L<Ref(C,-1),L,Ref(C,-1));
> 
> AvTR=MA(C,8);
> 
> MABand=(MA((TruHi-TruLo),8)*1.3);
> 
> UBand=AvTR+MABand;
> 
> LBand=AvTR-MABand;
> 
> Plot(AvTR,"AvTR",1,1);
> 
> Plot(UBand,"UBand",1,1);
> 
> Plot(LBand,"LBand",1,1); 
> 
> I don't own Tradestation, so their website is the only resource I 
have for them.
> If anyone has any insight to my problem I would greatly appreciate 
any help. 
> 
> 
> Dan



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
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/