-
January 18th, 2008, 10:28 AM
#5
Hi Dario,
I tried follow your instruction, but it has error : Out of memory.
Here my changed
-------
public int ComputeNextWaitTime()
{
lock (this)
{
return 5000;
}
}
public void ComputeNewValues()
{
ISecurityStructReader reader;
reader = new ReadSecurityStruct("C:\\TEMP\\BACKUP14\\SECURITY.D AT");
nStock = 0;
if (reader.Open())
{
arr = reader.Read();
nStock = arr.Count;
_stockSymbol = new string[nStock];
for (int i=0; i< nStock ;i++)
{
Struct_Security item = (Struct_Security)arr[i];
//_stockNames.Add(item.SecurityName);
_openprices[i]= item.OpenPrice;
_stockSymbol[i]= item.StockSymbol;
...
string itemName= "item" + (i + 1);
ExternalFeedProducer myProducer = new ExternalFeedProducer(itemName, m_openprices[i], m_refprices[i], m_minprices[i], m_maxprices[i], m_stockSymbol[i], m_stockNames[i], m_ceiling[i], m_floor[i], m_bid1[i], m_bid2[i], m_bid3[i], m_bid1vol[i], m_bid2vol[i], m_bid3vol[i], m_ask1[i], m_ask2[i], m_ask3[i],m_ask1vol[1], m_ask2vol[i], m_ask3vol[i], m_last[i], m_lastVal[i], m_lastVol[i], m_projectOpen[i]);
_stockGenerators[itemName]= myProducer;
myProducer.SetFeedListener(_listener);
myProducer.Start();
}
...
}
}
-----------
My step is correct?
In my case, stock data i get from outside and it is a binary file and has a structure. I read it and store it in array list.
In your code, u stored data in an "IDictionay" because you change only 01 value of item in the same time, but my data has many change in many item (in the same time).
Example :
10:00 AM I have :
stock_symbol[1] = STB , price[1] = 100, volume[1] = 99
stock_symbol[2]= ACB, price[2] = 80, volume[2] = 89
10:01 AM, I have
stock_symbol[1] = STB , price[1] = 101, volume[1] = 90
stock_symbol[2]= ACB, price[2] = 82, volume[2] = 80
How to rewrite "GetCurrentValues" and "ComputeNewValues" to store this? Can u help me?
Similar Threads
-
By hungn in forum Adapter SDKs
Replies: 8
Last Post: May 7th, 2008, 09:53 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 03:07 PM.
Bookmarks