I have a problem working with OnBarsReceived event in the desktopSampleVB code provided here http://share.esignal.com/groupconten...r=&groupid=185
I am trying to process multiple history requests in this code and having problems with OnBarsReceived event. It seems that it does not fire sometimes after I send a history request.
Here is one of the tests I did.
I added a line
requestHistoryHandle = esignal.RequestHistory("AMGN", "5", btDAYS, 1, -1, -1)
after the line
requestHistoryHandle = esignal.RequestHistory(sym, "5", btDAYS, 1, -1, -1)
in getSym procedure (so I have two history requests in getSym procedure now)
while in ProcessHistory sub I added the line
SaveFile (sBar) {to save just the last bar}
after
esignal.ReleaseHistory (historyHandle)
SaveFile is a simple file writing procedure I wrote (in the same project) which I verified to work.
The idea was that once I start the form and click on "HistoryServer" it would save two files, one for the symbol provided in the textBox and another for AMGN (which is hard coded). What I found was that it saved only one file, for AMGN, and OnBarsReceived event did not fire the first time for the symbol from the txtBox, regardless of what that symbol was. I confirmed that the event did not fire by placing a breakpoint within OnBarsReceived Sub, execution was stopped at the breakpoint only after the second history request.
Also, sometimes a symbol just goes "bad" when I debug the frmMain (I start it, enter symbol in txtBox, click on "HistoryServer" and then get stopped at a breakpoint somewhere in the code) and step through the Subs and then exit at an arbitrary point. From then on, no history data can be obtained for that symbol, even though I can get data for other symbols. The only way to "fix" it is to restart eSignal and restart VB project, and sometimes even this does not help and I have to restart my computer.
What to do it about it (besides restarting thing, which is a non-solution)?
Any help is greatly appreciated!
I am trying to process multiple history requests in this code and having problems with OnBarsReceived event. It seems that it does not fire sometimes after I send a history request.
Here is one of the tests I did.
I added a line
requestHistoryHandle = esignal.RequestHistory("AMGN", "5", btDAYS, 1, -1, -1)
after the line
requestHistoryHandle = esignal.RequestHistory(sym, "5", btDAYS, 1, -1, -1)
in getSym procedure (so I have two history requests in getSym procedure now)
while in ProcessHistory sub I added the line
SaveFile (sBar) {to save just the last bar}
after
esignal.ReleaseHistory (historyHandle)
SaveFile is a simple file writing procedure I wrote (in the same project) which I verified to work.
The idea was that once I start the form and click on "HistoryServer" it would save two files, one for the symbol provided in the textBox and another for AMGN (which is hard coded). What I found was that it saved only one file, for AMGN, and OnBarsReceived event did not fire the first time for the symbol from the txtBox, regardless of what that symbol was. I confirmed that the event did not fire by placing a breakpoint within OnBarsReceived Sub, execution was stopped at the breakpoint only after the second history request.
Also, sometimes a symbol just goes "bad" when I debug the frmMain (I start it, enter symbol in txtBox, click on "HistoryServer" and then get stopped at a breakpoint somewhere in the code) and step through the Subs and then exit at an arbitrary point. From then on, no history data can be obtained for that symbol, even though I can get data for other symbols. The only way to "fix" it is to restart eSignal and restart VB project, and sometimes even this does not help and I have to restart my computer.
What to do it about it (besides restarting thing, which is a non-solution)?
Any help is greatly appreciated!
Comment