Hi Gents,
Happy Weekend.
Quick question regarding the best way, via OLE to get a specific "STOCK" object. For example. Let's say I want to retrieve the Stock object for ticker AAPL what is the fastest way to get it. I could…
1.) Loop over all stock objects in the current database like so…
var stockCount = stocks.Count;
For ( int i = 0; I < stockCount; i++)
{
Var stock = stocks.item(i);
If ( stock.Ticker == "AAPL" )
{
// Then I have it….do something with it.
}
}
2.) Or is I use…
stock.Add("AAPL");
// Then if already exists in the database (Stocks) , .Ass() will return that instance of APPL's stock object. Problem is if it doesn't exist it will make one I believe.
So it would seem the fastest way to get APPL's stock object is to use the stock.Add() method, but I don't want to Add it to the database if it doesn't exist !!
What should I do? Is there an override so that it won't get added if it doesn't exist.
Posted by: "Sean ONeill" <ONeillSeanP@verizon.net>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (8) |
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
EmoticonEmoticon