I have built a VB.Net form to maintain current prices for a group of stocks. The way that I am doing it is; I am looping through an array of ticker symbols, changing the RequestSymbol, awaiting the onquotechanged event to supply a current price and then writing that value to a MS Access table that supports a Dataset which populates a Datagrid on the form. The process seems to work fine but eventually generates a Crash to the eSignal. Any Ideas?
Announcement
Collapse
No announcement yet.
API Crashing
Collapse
X
-
Hi! The code is fairly standard. I am just trying to provide Psuedo Real-Time quotes on 1 form for a number of stocks. Since the API can't pull in more than 1 symbol quote, I am forced to loop through an array. Each loop will:
ReleaseSymbol
RequestSymbol
and then wait for the OnQuoteChanged event to supply the LastPrice
What I am really trying to do is start the loop from a commandbutton_click and then perpetuate the loop by calling a function from the OnQuoteChanged event, but it keeps crashing the API.
I can't help but believe there must be an easier way to accomplish what I am trying to do; is There?
If not, may I ask what is the real scope of use that the developers of the API imagined?
Thanks
Comment
-
Why are you continually requesting and releasing? Do you need to get data on more symbols than your are permissioned for or is there another reason?
Does your app crash if you don't do the release calls inside the OnQuoteChanged event (it sounds like that is what you are doing)? There might be some destructor stuff getting called behind the scenes when you call release that might make the return from the OnQuoteChanged handler unstable. Just a possibility.
Cheers... George
Comment
-
The reference docs can be found in the ActiveX Development file sharing area.
If you need to continually monitor the quotes of a group of stocks, you can just RequestSymbol once for each one at the start of your app and it will continue to stream quotes (if you ask it to). You only need to release the symbols when you are done, not inbetween each call to RequestSymbol (unless you are trying to watch more symbols than you are allowed at one time based on your account settings).
Cheers... George
Comment
-
Not sure I understand specifically what info you are looking for. For interval, it is just a string the same as the one you would put into the main eSignal client app. "1", "10", "D", etc.
lhandle = esignal.RequestHistory("MSFT", "1", IESignal.barType.btBARS, 30, 0, 0)
Isn't most of that in the developer reference doc on the file sharing site? There are a few new functions in the 7.6 release that haven't made their way into that doc yet, but are listed in the Appendix A doc.
Cheers... George
Comment
-
Thanks again. The only examples I can find for VB are single quote retrieval and historical. Here is what I am trying to do and maybe you can help me.
1. Stream real time quotes for up to 80 stocks at a time. I will need to change the stocks throughout the day.
2. Gather 2 year historical daily values for 1630 stocks. This will be done weekly so that I can keep a database current with the daily data.
3. Stream 1 minute bars for up to 80 stock at a time. I will need to change the stocks throughout the day.
I realize that you have an indepth knowledge of the enumerations, but I don't know if I can pass an array of symbols to stream more than one stock and what interval values should I be using if I want the end of data for various stocks. The sample project is confusing for me as to how to adapt the functions to accomplish my programming goals.
I appreciate your assistance.
Comment
Comment