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

[amibroker] Return between arrowheads, FastTrack



PureBytes Links

Trading Reference Links

Having trouble getting the annualized return to equal what FT is 
putting out. My math sucks as bad as my programming skills. Any help 
appreciated.


/* Points or percent between pointers, when using left pointer only 
gives results to end of chart
Sloppy programming, some experimenting going on B is beginning E is 
ending V for value */

BV = BeginValue(C);
EV = EndValue(C);
BP = EndValue(C) - BeginValue(C);
//Percent between the poles
BPP = 100*(EndValue(C) - BeginValue(C)) / BeginValue(C);

//Basic information about pointer position
"B. Date" + WriteVal( BeginValue( DateTime() ), formatDateTime );
"E. Date" + WriteVal( EndValue( DateTime() ), formatDateTime );
"B. Pointer:" + WriteVal(BV);
"E. Pointer:" + WriteVal(EV);
"Points BP:" + WriteVal(BP);
"Return BP:" + WriteVal(BPP, format=1.2)+"%";


//Below calculates the Annual Percentage between the poles
Period = EndValue( BarIndex() ) - BeginValue( BarIndex() );
n = ((1/(Period/252))-1);
Annpct = 10*(EndValue(C)/BeginValue(C))^n;
"Ann:" + WriteVal(Annpct)+"%";
"Bars/Days:" + WriteVal(Period);

//FTWay
nb = ((252/Period)-1);
FTway = ((100*((EndValue(C) - BeginValue(C)) / BeginValue(C)))+1)^nb;
"FTway:" + WriteVal(FTway);//"Selected date" + Date();


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