Here are some links to consider when embedding Python scripts into a C++ application. This could be your dynamically loaded Python trading script. Old ones I know but this is what came up with Google search:
Is embedding the Python interpreter into a C program as great way for quant trading models with HFT potential?
A couple of thoughts:
This is interesting to embed the Python interpreter into a C program for run a lot of Python scripts. This is cool but do remember you still have a lot of unnecessary code from the Python interpreter. I prefer simple and stripped down code in a final EXE or BIN file if done in C++ or C. This presenter basically accesses the entry point into the Python interpreter directly which is nice. Doing it brings convenience but it is not making the final C code compact. It is also a real pain to do but also a dangerous path to go down. I would just stuck with basic algos written in basic C no different this C sytles coding found in the video at
Do check out the last coding segment the link’s video above. It sped up the basic Python script by 100+ times. That is impressive but do realize there is a lot low level (also known as whacking in the weeds) coding style with malloc, POP, etc. This is basically saying one step above Assembler or the operating system specifically Linux.This not for the faint of heart or newbie to all this. Doing it wrong will be a disaster with memory going haywire which is not fun to deal with. So take that as a warning but it is the best way to handle the fastest code possible. This is also the same path to true ultra lowest latency coding for HFT (high frequency trading).
For HFT: Just like Matlab or Coder toolbox,, embedding Octave M script code C++ is ugly, stick with R, RCpp, RInside
I tried investigating this as a hopeful extra bonus. This can be done but be aware that it is ugly as if you did it with Matlab. With the extra expense of Matlab core, the .NET or JABuilder toolboxes, it would be a real pain and expensive to do. The added costs of $6k for the Matlab Coder might not be worth it!! As GCC or G++ with R is all free! Yipeee! But too bad about Octave as it just does not have athe advancement of a community like R. It would have been nice to spend time on this but not worth it at this point.