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

RE: [amibroker] Getting extra data into AB (was Dividend/Earnings Yields)



PureBytes Links

Trading Reference Links




<FONT face=Arial color=#0000ff 
size=2>Russell,
<FONT face=Arial color=#0000ff 
size=2>another approach is to use the built-in getextradata function though it 
requires a pay data source...
 
Regards, 
Jayson 
 


  
  
    
      <FONT  
      color=#ffffff>GETEXTRADATA- get extra data from external 
      data source
    
      Miscellaneous functions(AFL 1.9)

  
  
    SYNTAX 
    <FONT  
      color=#ffffff>GetExtraData( 
  
    RETURNS
    NUMBER or ARRAY or STRING 
  
    FUNCTION 
    Retrieves data-source specific data. Currently only 
      Quotes Plus and TC2000 plug-isn support this function.The list of 
      fields available via QP2 plug-in: 
      
        "AnnDividend" 
        "Shares" 
        "SharesFloat" 
        "IssueType" (string) 
        "SharesOut" 
        "SharesShort" 
        "TTMsales" 
        "Beta" 
        "TTMEps" 
        "HiPERange" 
        "LoPERange" 
        "PEG" 
        "InstHolds" 
        "LTDebtToEq" 
        "CashFlowPerShare" 
        "ROE" 
        "TTMSales" 
        "Yr1EPSGrowth" 
        "Yr5EPSGrowth" 
        "Yr1ProjEPSGrowth" 
        "Yr2ProjEPSGrowth" 
        "Yr3to5ProjEPSGrowth" 
        "BookValuePerShare" 
        "Briefing" (string) 
        "QRS" (array) 
        "HasOptions" The list of fields available via TC2000 
      plug-in:
      
        "BOP" - balance of power indicator 
        "MoneyStream" - money stream indicator 
  
    EXAMPLE
    <FONT  
      color=#ffffff>GetExtraData("briefing"); /* gives briefing text 
      (STRING) */ graph0 = <FONT  
      color=#ffffff>GetExtraData("QRS"); /*gives Quotes Plus relative 
      strength (ARRAY) */ 
  
    SEE ALSO
    
<A href="" 
target=_blank>See updated/extended version on-line.
<FONT face=Tahoma 
size=2>-----Original Message-----From: b 
[mailto:b519b@xxxxxxxxx]Sent: Friday, January 09, 2004 11:13 
AMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] 
Getting extra data into AB (was Dividend/Earnings 
Yields)Russel,There are two ways to get the 
data into AB. Both will require you to write anexternal program in Basic, C, 
or Delphi to pre-process the data before importinginto AB.  The 
first mehtod is that of putting the new data into the OI field. To put 1 
dataitem into the OI field, you would multiply that item by whatever is 
needed to getride of the decimals (since the OI field only stores integer 
values). So if the EYwas 5.98% it could be stored in OI as 598 and then in 
your AFL code you could accessthe EY value in AB with this code: oiEY = 
OI/100; But since you want both EY and DY, you would need to "pack" the 
two items into theone OI slot by shifting one of the values by 1000 during 
the packing process andreversing the shift when using it in AB. Also packing 
requires that ceiling valuesbe put on the items to be packed so they do not 
overlap each other when packed. Inpractice that means one could pack two 3 
digit items in the OI (or a 2 digit and a 4digit item). For 
example:Packing code (in AFL for understanding, but will need to be 
translated into Basic orC or Delphi to create the external pre-processing 
program that will do the packing.)DY = ...whatever....EY = 
...whatever...shiftedDY = DY*100; shiftedDY = iif(shiftedDY > 
999,999,shiftedDY);shiftedEY = EY*100; shiftedEY = iif(shiftedEY > 
999,999,shiftedEY);packedOI = DY*1000 + EY*1;If you do not want to 
limit the DY and EY to a 9.99% ceiling, you can not use the OIpacking 
approach.The alternative is to use create a "secondary" ticker for every 
ticker currently inyour database and put the DY and EY values into these 
"secondary" tickers. Thisavoids the problems with packing and unpacking and 
artifical ceilings on values.You will settle need to write an external 
program to place the values in a datafilethat will get imported into AB to 
create the secondary ticker. It could do somethinglike this. Again I will 
use AFL code to get the idea across, but it will need to betranslated into 
Basic or C or Delphi.Open = EY;High = DY;Low = something else 
you might want to use in testingClose = something else you might want to use 
in testingVolume = something else you might want to use in testingOI = 
something else you might want to use in testingIf the EY and DY data is 
for IBM, then give the new ticker the name "IBM_2". Afterimporting this 
secondary ticker into AB, you can get its values by just using thefollowing 
call:EY = Foreign( Name() + "_2", "Open");DY = Foreign( Name() + 
"_2", "High");The secondary ticker approach is simplier to set up and 
use and it has more capacity(up to 6 data items without packing), but there 
is a small, but noticable speedpenalty since AB has to line up the dates of 
the secondary ticker with the primaryone before returning the Foreign values 
for each date. b--- russel762003 <RWebber@xxxxxxxxx> 
wrote:> Hi,> > Does anyone know whether it is possible to 
import dividend yields and > earnings yields into Amibroker? And whether 
these values can then be > used in AFL?> > Thanks,> 
> Russel> > > > 
__________________________________Do you Yahoo!?Yahoo! 
Hotjobs: Enter the "Signing Bonus" Sweepstakes<A 
href="">http://hotjobs.sweepstakes.yahoo.com/signingbonusSend 
BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
suggest@xxxxxxxxxxxxx-----------------------------------------Post 
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
group FAQ at: <A 
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 


Yahoo! Groups Links
  To visit your group on the web, go to:<A 
  href="">http://groups.yahoo.com/group/amibroker/  

  To unsubscribe from this group, send an email to:<A 
  href="">amibroker-unsubscribe@xxxxxxxxxxxxxxx  

  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 



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 the Yahoo! Terms of Service.