Starting an Amibroker Batch File with Command Prompt, Python or Autoit

Just wanted to share, the basis for a lot of automation with Amibroker is to be able to start it and run a batch file. I figured out three different ways to do it:

From a command prompt, I was successful with this code (Substitute your own filenames.):

"C:\Program Files\AmiBroker\Broker.exe" /runbatch "C:\Users\elder\OneDrive\Trading\Amibroker\Batch Files\MR2" /exit

Using Python (Note that I had to put two backslashes after the second C prompt to make it work. Substitute your own file names.):

import subprocess
import os
#'C:\Program Files\AmiBroker\Broker.exe /runbatch "C:\\Users\elder\OneDrive\Amibroker\Batch Files\MR2 " /exit')

With a freeware program named Autoit (Substitute your own filenames.):

run('C:\Program Files\AmiBroker\Broker.exe /runbatch "C:\Users\elder\OneDrive\Trading\Amibroker\Batch Files\MR2 " /exit')

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.