-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When loading > 30 stream lines I can't terminate matlab with ctrl+C #135
Comments
Do you have your buffers in a cell array? If so this might be the cause. The listeners you can have in a cell array but not the buffers. This causes very erratic errors. Don't ask me why. |
I see, I have a nested struct variable collecting the local buffer. I will try to take each sub-variable (i.e. circularfifobuffers) out and report back, thanks. |
I brought the buffers out of the struct variable and I confirm things massively improved, thanks. I can now hold a Q=1:2000 iterations of data collection of bid/ask spread for 54 streams with only 2 minutes of de-hanging time requires by matlab to return to be operational. Also, when command line is rendered, I can actually use it (e.g. 2+2 returns 4 immediately). So, the buffer structure was definitely a part of the problem, but there may be something additional to that, as for longer time series it seems matlab hangs for longer time. For example, for a Q=1:4000 series with 52 streams, matlab takes about 10 minutes to unhang.
thanks, |
I don't really understand what you mean by this 4000 iterations. I stream data through IB4m the whole day long and nothing hangs. And yes, you sometimes have to use pauses with the IB API to give it time to respond after a request for example. |
After setting up the streams, I want to test data collection by building a simple for loop which places the data inside a few vectors for a number of periods. What I mean is that after the loop Q=1,2,... ends, there is a variable time in which Matlab is frozen. I double-checked when the issue arises, and I can see it is actually at the stream connection stage. If I connect more than 54 streams, it takes more than 3-4 minutes to matlab to return me variables and control. All buffer sizes are set to "15" at the moment. |
Sounds funny. The main part of my program is a while-loop. This loop starts with a time-condition when the market opens and runs all day until the markets close. All the time it is streaming market data and I can break matlab (go into debug-mode) at any time - no freezing. |
So far, no positive outcome. I am really puzzled by the behaviour. The problem is clearly in the buffer/stream part of the script as it engulfs well before the data-download. Probably I'm doing something wrong there. I start with a standard:
then, I have a small loop where all currency pairs are initiated:
`
then, in my main code (corresponding to the data collection part), I run a simple Getting crazy.. |
First the obvious. The first two buffers are not used. Take them away. Without having understood (and seen) your whole code I dare to say that the problem is how you arrange the buffers. |
Hi Despair, Thanks for checking the code, I really appreciate it. I killed the two tautological processes and I am moving back into the struc. structure. I was wondering, how do you determine the pause coefficient, for your script? What coefficient do you use? I was wondering if part of my problem isn't due to a too short query interval |
With the pauses it is a little bit trial and error. In some cases you can have a little loop checking if something dropped into your buffer every half second or so. In other situations you simply have to try what fits your set up since it also depends on the speed of your computer. |
Hi Despair, |
Hello everybody,
I noticed that when I try to streamline more than about 30 lines together, matlab behaves weirdly, and I am left with no other option that terminating it abruptly.
Suppose I cross the 30 lines threshold and I run a small loop for Q from 1 to 30 (e.g., call bid/ask prices). After Q reaches 30, the command line appears again (just like when matlab is ready to take orders), but whatever order I give, is not operated. At the same time, every other element of the program is stuck. I thought this may due to an excess of buffer received in the background and bad indexing. Is that a possibility?
thanks
The text was updated successfully, but these errors were encountered: