Hello,
I want to use trading signals generated by external python machine learning code.
If you have any sample code on how to use an external trading signal, please let me know.
I want to use the external signals for both back-testing and live trading.
I want to use trading signals generated by external python machine learning code.
If you have any sample code on how to use an external trading signal, please let me know.
I want to use the external signals for both back-testing and live trading.
Rename
Do you mean in a backtesting context? Or for live trading?
I've made ML API (Python) that gets model name and data. This API runs all models, and returns predict for the model and data.
In WL7, in turn, I've added some methods to make POST calls to this API and to pack data for such calls.
In WL7, in turn, I've added some methods to make POST calls to this API and to pack data for such calls.
You can simply read it back from a file and let your strategy place signals.
QUOTE:I can whip something up. What would the data records look like?
If you have any sample code on how to use an external trading signal, please let me know.... I want to use the external signals for both back-testing and live trading.
You'd need something like the following, but what would the date part represent if live trading? The signal bar time? It needs to be synchronized to something.
20211008T09:30:00 Buy AMD 100 Limit at 95.55
QUOTE:The term "file" should be interpreted loosely. This could also mean the Windows clipboard. That's typically what's used to "generically" exchange data between applications. And it might even be easier (certainly faster) to do than using a real disk file.
.. simply read [signals] back from a file and let your strategy place signals.
There are many other approaches such as sockets (what the IQFeed client uses) or application procedure calls (COM), but they are more involved. I would get the simple clipboard approach debugged first before attempting advanced OS methods.
To me, "file" means disk file. It's a hard record to look at if something unexpected happens. Reading a few hundred records from a file *once* for a strategy run probably takes about the same amount time as it takes you to release the mouse after clicking. If someone wants to do something more specialized to save a msec and not have a hard record, I won't stop you.
Is there an interface API provided by WL7 to use external trading signal ?
Do you mean in a backtesting context? Or for live trading?
QUOTE:You have all the I/O methods provided by the Microsoft .NET framework you can use. And that's just about everything: file I/O, clipboard I/O, sockets, COM/DCOM, shared memory, message passing. But these are .NET framework procedures that tie into the OS. Remember, the OS is in control when it comes to communicating between different applications, which I think is what you want to do. Right?
... an interface API provided ... to use external trading signal?
There are some external libraries say for distributed processing (ISIS comes to mind). But for a single-computer, single-processor problem, I think the .NET framework provides all you need. And that's built into Windows and the applications (like WL) that support it.
I would cite the Microsoft docs, but unless you're a .NET programmer, they are a bit overwhelming. I would checkout a good C#/.NET introductory book first for I/O methods. And it would give you a good overview of all the options I listed above.
I think doing something with file or clipboard I/O would be easiest to setup. The more advanced approaches (COM) allow more synchronization between applications, but they are somewhat more involved to setup and debug.
Here's an overly simple example of reading a string from the Clipboard. https://stackoverflow.com/questions/35867427/read-text-from-clipboard In practice, I would read it in with a StringReader datatype (instead of "string") because that will let me read and parse one line at a time into a C# object, which is convenient.
Your Response
Post
Edit Post
Login is required