Hi there,
I have been working on pulling a few different data sources into my Execute logic, and am very grateful for the excellent example for using APIs such as:
https://www.wealth-lab.com/Forum/Posts/Web-Scraping-Free-Cash-Flow-from-Marketwatch-com-38723My challenge is that I have data that is coming via a socket and I would like to read all the new data from that has come in since the last bar, and use it to make trade decisions for the coming bar. This is a realtime example, so not needed for historical just live streaming strategy.
Basically my first test objective is to have it just PrintDebug out in real-time each line it gets from the socket connection, regardless of whether it is at the beginning, middle, or end of a bar.
My example code is pretty barebones, and may not even be the right approach at all. Any help would be much appreciated.
CODE:
Please log in to see this code.
I am running into a couple of challenges:
1) I'd like it to open the socket just once (I imagine some global variable as in the above FCF example would help, but I can't quite figure it out)
2) It does not seem to PrintDebug until I manually close the socket server application, then it prints out everything it has been gathering.
Once I have these figured out, I will start working on actually using the content of the stream to Buy/Sell at bar+1.
Thanks!
ps. I can make changes to the socket server side code as well if that helps.