AmiPy plug-in - Python integration

Dear, anybody can give sample how to retrieve values from csv then plotted into amibroker? I have struggled with returned type or size unmatch, as it results in matrix. How to simple retrieve the result and plotted in line mode? Thanks


I got this kind of error, how to solve it?

As error says: the exception is IN EXTERNAL DLL. Your Python code crashes. No-body can help without seeing your Python code.

1 Like

What an amazing plugin !
I had lots of ideas to use python for,
Just finished integrating it and very happy I got the simple example working !! .

1 Like

@mmha (and to all the other users of this plugin), if you plan to develop strategies with it, I kindly suggest to note what @Kuba wrote in the first post::

It takes a great amount of time developing a program for public use so if You are using this plug-in on every-day basis please consider making a donation. The link below allows you to send small amount of money ($5/$10/$25 of your choice) to me. Thank you very much for your generous support.

Click here to donate by PayPal or direct PayPal.Me link

3 Likes

Is the link still working for you guys ? I had switched to a different laptop and plugin folder was not part of my backup unfortunately.
I'm trying to download again but no luck.

@mmha, it works as expected here (also behind a VPN, by the way).

2 Likes

Thanks @bebbe for the hint, it doesn't work directly on Saudi Arabia now, so I just used VPN and voila.

1 Like

Hello,
Thanks to Kuba and Tomasz,
Post to inform users that with recent changes to Python (free-thread) and updates to packages that now, multiprocessing/parallel, are enabled by default.

The indicaton is amibroker splash screen flashes many times and multiple "amibroker for windows" instances are created.
Amibroker and Amipy start/load correctly.
The above occurs when trying to evaluate your python function.

I'm back to using python==3.11.9 and EMD-Signal==1.6.4 to get stable operation.
This non free-thread python version and EMD-Signal setting parallel=false as default.

I'm assuming Amipy/Amibroker communication during explore/backtest using python function can only be single cpu/process.

I'd be interested to hear other's experiences and workarounds.
Many Thanks and best wishes for the festive season.

3 Likes

Historically Python had problems with the concept of "GIL" (Global Interpreter Lock) that caused troubles with multiple Python interpreter instances trying to run truly independently in parallel, making integration of multi-threaded applications with Python complicated. Whatever they changed in Python, may break existing apps, libraries, etc.

Therefore it is best to keep using Python version > 3.9 and <= 3.12

You need to check this info.

As far as Windows OS is concerned, 3.14 is current release(stable) and neither 3.13 or 3.14 have free-threading enabled by default.
It has to be enabled "explicitly" during installation.

Also, after that python3.14t.exe exists side by side with python.exe and you can configure py to use which default exe.

Check either PY_PYTHON environment variable or the [defaults]section in py.ini for proper default.

Hello NSM & Tomasz
Thank you for your responses and explanations.
Clarified my understanding.

It would seem that while AmiBroker uses threads for parallelisation and python's new Cython is capable of parallel processing, the communication/control between them is unable to keep multiple results organised.

Not saying this isn't a useful plugin as is, it's definitely significant for what is a great backtest/charting program.

Would anyone know of a possible workaround or method to code the python code to organise, align and then transfer to AmiBroker as if a single process?

Any other ideas welcome.

Thanks in advance