zzz
March 17, 2025, 7:54pm
1
Why the following ALF code doesn't hand these parameters over to the python script? Symbol, Exchange, SecType, Currency, LmtPrice, filePath
filePath = "D:\\adjusted_price.txt";
pythonScript = "D:\\adjust_lmt_price.py";
command = StrFormat("\"%s\" \"%s\" \"%s\" \"%s\" \"%s\" %.4f \"%s\"", pythonScript, Symbol, Exchange, SecType, Currency, LmtPrice, filePath);
ShellExecute(command, "", "", 0);
Tomasz
March 17, 2025, 9:15pm
2
You have to use executable (python.exe) in your call.
nsm51
March 18, 2025, 3:11am
3
zzz
March 23, 2025, 11:39am
4
The correct code is below. Is there a way to directly hand back the result of the python script to AFL? Without creating the adjusted_price.txt and read it by AFL.
filePath = "D:\\adjusted_price.txt";
pythonScript = "D:\\adjust_lmt_price.py";
command = StrFormat("\"%s\" \"%s\" \"%s\" \"%s\" \"%s\" %.4f \"%s\"", pythonScript, Symbol, Exchange, SecType, Currency, LmtPrice, filePath);
ShellExecute("python.exe", command, "", 0);
nsm51
March 23, 2025, 12:32pm
5
Then you better have a look at this
AmiPy plug-in: AmiBroker-Python integration
UPDATE September 02, 2024: Version 1.1.0 released!
IMPORTANT: The support for Python 3.7 and 3.8 was dropped and for numpy < 2.0, so update your Python and update your numpy!
With permission from @Tomasz I am announcing here the next version of my AmiBroker-Python integration plugin. This plugin allows you to call Python functions from AFL side. This opens out possibility to use wide selection of Python libraries such as numpy, scilearn, tensorflow a…