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

Re: [amibroker] Re: Chaikin Money Flow question



PureBytes Links

Trading Reference Links

Hi Dave,

Sunday, October 19, 2003, 10:56:14 PM, you wrote:

DM> I'm a little confused about the periods and TEMA/MA overlays
DM> you're suggesting though. I started w  Steve Wiser's AFL from the
DM> AB library, cleaned up a  bit.

It's been a while since I set this up, and I'd forgotten myself that
I had massaged that code a little bit. Here is the code I use
directly from my charts:

Yuki

MaxGraph=14;

A=(H+L+2*C);
B=EMA((HHV(H,2)-LLV(L,2)),21);
BuyP= 
/*{BuyPower}*/
 V/EMA(V,21) * ((A>=Ref(A,-1)) +(A<Ref(A,-1)) / exp((0.375 * (A+Ref(A,-1)) /B ) *(Ref(A,-1)-A) / A));

SellP = 
/*{SellPressure}*/ 
V/EMA(V,21) * ((A<=Ref(A,-1)) + (A>Ref(A,-1)) / exp((0.375 * (A+Ref(A,-1)) / B ) * (A-Ref(A,-1)) / Ref(A,-1)));


mabp=EMA(BuyP,21);       
masp=EMA(SellP,21);        /*{smooth Selling Pressure}*/
divsor=IIf(mabp>masp,mabp,masp);         /*{BP:SP ratio}*/
divend=IIf(mabp<masp,mabp,masp);       /*{biggest=divisor}*/
var2=1-(divend/divsor);                               /*{adjust ratio to plot in}*/
var3=IIf( (masp>mabp) , -var2 , var2  )  ;       /*{range -100 to 100}*/
var4=var3*100;  
DI = var4;

Graph1=TEMA(DI,21);
Graph1Color=32;
Graph1Style=styleLine=1;

Graph2=EMA(TEMA(DI,21),30);
Graph2Color=29;
Graph2Style=styleLine=1;

Title="TEMA Demand Index(21)"+EncodeColor(colorRed)+WriteVal(Graph1)+EncodeColor(colorBlack)+"  EMA(30)"+EncodeColor(colorBlue)+WriteVal(Graph2);

//end




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