Support Board
Date/Time: Tue, 04 Mar 2025 14:47:37 +0000
[Programming Help] - (ML Model->Sierra integration)C++ Python Tensorflow Keras Pytorch Sklearn XGBoost
View Count: 1858
[2021-12-05 00:37:09] |
Bet_More_Tim - Posts: 21 |
Hello. I am currently trying to solve the "final step" (if you will) in making a pipeline for developing machine learning models and injecting them into SierraChart for analysis, backtesting and deployment. I am using python for model dev btw. It's my understanding that there are two possible methods to go about this. 1 - is to utilize the DTC protocol, which I assume would have the ability to extract live data from sierra, run it through a python model, and either plot results from python outside of sierra, or somehow send a message back to sierra and then I guess access those messages using a acsil .cpp script(in the event that its a chartable output)? (and where actual trade commands can be sent directly, without acsil study file)? 2 - would be in the event a model can be saved as a tensorflow model, .h5 file or .pb or whatever, and some how using tensorflow c++ libraries load the saved model into a .cpp file, and "just align inputs and outputs" for the model, and this be happening in a custom study .cpp file. Which I don't understand why it wouldn't be possible, given that we're only talking forward propagation, which is just 'some' linear algebra (obvi can be a lot too lol) and calculating a result. Now I can totally conceive the concept that "hey, inside acsil you're limited to data structures or memory or this or that" .... and I also totally get the whole "be careful calculating shit outside of using acsil provided data structures because you're risking mishandling memory in c++"... now I'm not sure if that warning is kinda toward the scrappy coder who can hack enough stuff together to at least make some custom studies in sierra... or if that's a severe warning, even to a more experienced developer (im kinda between the two?). So then this brings up another thing I would like to inquire/learn about. Browsing the forums here I came across an older post where someone was talking about their advanced usage of visual studio, and they mentioned how all of their custom studies are actually their own separate .cpp class files, which handles all the calculations and stuff, and "takes full advantage of c++" outside of sierra. There was specific conversation about creating windows GUI objects and such, but in an example .cpp file the user posted, they show what I believe to have been one of their study class files, and within different methods/functions included all the references that one would make in a basic acsil .cpp script, as well as all the other classes and methods needed for their study. And Its my understanding that they write this file, and then in the actual acsil .cpp that sierra uses, it #includes that class file, and basically thats all that's even in their acsil script, and it will have the functionality needed. So I guess the question with that last bit there is... does anything I've mentioned sound close to reality at all, and if so, what should I "learn" (for lack of a better word) so that I can be creating my own custom studies in this manner rather than having them all in an acsil .cpp file. I understand programming and such, but there's a lot I haven't learned probably due to my entry into the field being data analysis based, so if I'm actually asking stupid questions, feel free to berate me because I deserve it lol, but just at the same time please point me toward what I should spend my time learning. One big thing I wonder about, with method 2 above, whether its injecting a tensorflow model, or just creating a custom study like mentioned and not fully within an acsil file, is what kind of other file that class file is going to be. Does it become a .dll that gets used elsewhere.... or is it like, similar to a .h file where another .cpp file can import it during compiling, or does it somehow become its own executable that would get launched in the background when a custom sierra study calls on it. I would really like to assume that somehow it's possible to load a saved tensorflow model into a .cpp file, make all the proper acsil references that will be needed, setting the inputs and outputs, and just compile that into a custom study .dll, to the extent that it can be loaded to the right kind of chart, and "the necessary math gets computed", and you can just see the results charted (or executed in the event of trade automation) If you've read this far, thanks for bearing with me in my sloppy manner of inquiry. I understand solutions are most likely to be quite involved, I just want to make sure I spend my time as efficiently as possible learning methods of doing things that will actually work reliably and consistently. Thanks! |
[2021-12-10 09:28:52] |
User268846 - Posts: 17 |
Hi Bet_More_Tim, lots of text and your question is not really clear to me but I can tell you that we are running tensorflow and xgboost models in production together with Sierra Chart. We are using tcp sockets to communicate between our models running in Python and SC Study dll. hope that helps |
[2021-12-10 09:31:33] |
User268846 - Posts: 17 |
you can also link cppflow to your SC Study dll if you only use tensorflow models
|
To post a message in this thread, you need to log in with your Sierra Chart account: