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

[amibroker] Understanding the Harmonic Mean, I



PureBytes Links

Trading Reference Links

This one fixes the problem even when you've got a H=Ltwo days in a 
row!Even better!
Thanks Harvey! I ve never noticed this "Nz" function...
Friendly, 
Gilles


--- In amibroker@xxxxxxxxxxxxxxx, HarveyHP <harveyhp@xxxx> wrote:
> Gilles,
> 
> Look up "NZ" in the function reference.  Your line
> TSVd= ( ( C-Ref(C,-1)) / ( H-L ) ) * V; would become
> TSVd= NZ( ( ( C-Ref(C,-1)) / ( H-L ) ) * V ) ;
> and similar for the line
> TSV_ref= NZ( ( Sum((( C-Ref(C,-1)) / ( H-L ))*V, T ) ) / 1000000 ) ;
> 
> HHP
> =========================
> 
> At 08:19 AM 12/04/2004, you wrote:
> >Dear all, below is the formula of one of the TSV emulators - 
Worden's
> >proprietary indicator-; I like it a lot, but there is a light
> >problem: if one day H=L, TSVd is divided by 0, and the indicator 
get
> >stucked at -1 for ever...( This happens with KERX on March 28, 2001
> >for ex)
> >Could somebody help me adding a condition as if H=L, the indicator
> >keeps the previous day value? I'm tired out hitting my head against
> >the wall, it becomes painful with time...
> >
> >
> >
> >
> >T = 18; // For a TSV with 18 day period
> >
> >TMA = 9; // For MA of TSV
> >
> >Alpha = 2/(T+1);
> >
> >TSVd= ( ( C-Ref(C,-1)) / ( H-L ) ) * V;
> >
> >// The following calculates Exponential Average for TSV
> >
> >TSV_exp = 100*(AMA(TSVd,Alpha) * T/10000000);
> >
> >TSV_ref= ( Sum((( C-Ref(C,-1)) / ( H-L ))*V, T ) ) / 1000000; //for
> >reference
> >
> >// The following is simple TSV
> >
> >TSV = MA(TSVd,T) * T/10000000;
> >
> >TSV_MA = MA(TSV_exp,TMA);
> >
> >Plot(TSV_Exp,"TSV ",9,styleLine+styleThick);
> >
> >Plot(TSV_MA,"TSV Smooth ",colorWhite,styleLine);
> >
> >Plot(TSV_ref,"TSV Raw ",12,styleArea+styleLeftAxisScale);
> >
> >
> >
> >
> >
> >
> >Send BUG REPORTS to bugs@xxxx
> >Send SUGGESTIONS to suggest@xxxx
> >-----------------------------------------
> >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
> >
> >
> >
> >



------------------------ 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/