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

[amibroker] Re: Chaikin Money Flow question



PureBytes Links

Trading Reference Links

Don't mind at all. I dug out following from my some of my old code. 
Haven't tested it in a while, but I _think_ its the right definition 
as described in the page. Feel free to fix it and post corrections if 
not -

function jAccDist(pds) {
  // This is based on Twiggs Money Flow
  // http://www.incrediblecharts.com/technical/twiggs_money_flow.htm
  trh = Max(Ref(C, -1), H);
  trl = Min(Ref(C, -1), L);
  trdiff = trh - trl;
  wv = V + (Ref(V, -1) * 0);
  cv = (((C - trl) - (trh - C)) / IIf(trdiff == 0, 999999999, 
trdiff)) * wv;
  cvsum = Sum(cv, pds);
  cvsum = (Ref(cvsum, -1) * (pds-1) / pds) + cv;
  vsum = Sum(wv, pds);
  vsum = (Ref(vsum, -1) * (pds-1) / pds) + wv;
  adval = cvsum / vsum;

  return( adval );
}

Jitu

--- In amibroker@xxxxxxxxxxxxxxx, "Dave Merrill" <dmerrill@xxxx> 
wrote:
> hi Jitu, looks interesting. have you built it in AFL? would you mind
> sharing? I saw the metastock version on the incrediblecharts page, 
but I'm
> not an MS guy, and one line in particular makes no sense to me:
> 
>     WV:=V+(Ref(V,-1)*0);
> 
> anything times zero is zero. huh?
> 
> anyway, if you have it coded, I'd be interested, and others may be 
too.
> 
> dave
> 
>   I myself am not a fan of CMF, but if at all I were to use it, I'd 
use
>   a modified version of it called Twiggs Money Flow (it made more 
sense
>   to me). Read more about it here -
> 
>   http://www.incrediblecharts.com/technical/twiggs_money_flow.htm
> 
>   Jitu


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

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