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

RE: [amibroker] Help - Using specific stock values in code for further calculations????



PureBytes Links

Trading Reference Links




<SPAN 
class=378100205-24032003>Mroman,
This 
is a perfect use for addtocomposite. There is a tutorial in the help section 
which will be time well spent but basically you create a composite ticker of the 
closing price of each of the components by scanning a watchlist of those 
component stocks. You would then use the foreign function to grab the DJI 
data.......
<SPAN 
class=378100205-24032003> 
scan 
your watchlist with this....
<FONT 
face=Arial>
AddToComposite(<FONT 
color=#000000>C,<FONT 
color=#ff00ff>"~mynewcomposite",<FONT 
color=#ff00ff>"C")
then use 
foreign to grab the data by exploring...<FONT 
color=#282828><FONT 
size=2>
x=Foreign("!DJI",C<FONT 
color=#282828>);<FONT 
face=Arial>
y=Foreign("~mynewcomposite","C"<FONT 
color=#282828><FONT color=#0000ff face=Arial 
size=2>);
 
AddColumn(y/x,"My 
divisor");
 
In this example I 
treated both the composite and the index as foreign but if you explore the 
current ticker as one or the other than only one needs to be 
foreign()

 
 Jayson 
<FONT face=Tahoma 
size=2>-----Original Message-----From: mroman59 
[mailto:mroman59@xxxxxxxxx]Sent: Sunday, March 23, 2003 10:52 
PMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] Help - 
Using specific stock values in code for further 
calculations????Hello,Trying to use specific 
daily data for a given stock or index in AB database to make calculations 
within my exploration, but it does not appear that AB is capable of this, at 
least not by reviewing any of the help files that I have reviewed. For 
example, if I wanted to write code which could sum the current price of each 
stock in th DJI and then divide by the current DJI value, I should be able 
to determine the daily divior. Therefore, I would need to write code 
that makes AB return the price of each stock individually and then sum 
these closing prices. In addition, I would need AB to return the current 
value of the DJI index. I would not need to display these individual prices 
in an exploration, only to varify that the values using are correct 
data.  Once the divisor is calculated I would then use it in further 
calculations to determing market value. In short, how does one create a 
variable that gives the value of each stock to sum?I hope this is 
clear. If not please notify and I will try again.Thank you, Your help is 
much appreciated.Send 
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 
Your use of Yahoo! Groups is subject to the <A 
href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor


  ADVERTISEMENT









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