Alera Forum

Full Version: Automating your Self-Contained System
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Automating your Self-Contained System
This guide explains the steps to completely automate data download, signal creation, and signal processing.

The following guides may be helpful: Requirements:
  • You have software that can create signals (and download the necessary data) at your disposal
  • Enough computer/programming skills to tell your software how to format the signals and where to place them on your computer
Setting up your Program(s)
Make sure you can run any necessary signal generating and data downloading programs as command line executables (that will terminate).
It is not necessary that your software is a command line exe, but it makes it easier to work with in general.
The next thing you want to do is make sure your software can write signals (or a screener) to a file in the format specified in the guides.
The directory that your strategy will read signal files from is located on the bottom right of your screen. Go ahead and modify your software so that it will write files to that directory.

Note that APM can run other programs with command line arguments, meaning that you can take in the file directory as an argument rather than hard-coding it.

Setting up your APM Strategy
We will be using the External Program section of the strategy settings to run your programs. First enable Use External Program.

The File and Arguments fields are used to specify the program you would like to run.
To schedule your program, put a cron string in the Run External Program field (refer to the cron guide).

If there is more than one program you need to run (i.e. one program to download data and one to generate the signals), then you have two options:
  1. Create a 'dummy' strategy that does nothing except run your second program on a schedule.
  2. Create a batch file that will run all your programs. This is the more advanced option, so beware of problems such as not waiting for other processes to finish.
For reference, a simple batch file may look like:

"C:/Users/DownloadData.exe"
"C:/Users/GenerateSignals.exe"

Note that if DownloadData.exe is not a command line executable, then the system may not wait for DownloadData.exe to finish before generating signals.
In that case, you will want to try something like:

powershell -Command "Start-Process 'C:/Users/DownloadData.exe' -Wait;Start-Process 'C:/Users/GenerateSignals.exe';"

It is highly recommended that you test that your external program work as expected by manually running them (press the button beside Run External Program) and checking that your signals were generated in the correct folder.
Once you have set up your external program to run, you can set up the other fields in the strategy settings as usual (make sure to use Local File or File Screener as your signal provider).
Then you should check that the signals are correctly processed by pressing Order Preview.
Hi, can you post a brief explanation or tutorial for configuring and sending strategies to ALERA from Amibroker?
Thx!
(11-19-2019, 06:52 PM)robx Wrote: [ -> ]Hi, can you post a brief explanation or tutorial for configuring and sending strategies to ALERA from Amibroker?
Thx!

I've already spoken to Rob over email, but for those interested in integrating Amibroker, I highly suggest visiting https://www.amibroker-courses.com/courses/ for Amibroker related courses. Specifically, this course talks about using APM with Amibroker.

If you are determined to figure it out on your own, you can reference the Amibroker documentation and forums for assistance in creating an executable and writing code to generate formatted signals. I am personally not well-versed in Amibroker, so I would be unable to create a guide, nor do I think I could do anywhere near as good of a job as the Amibroker courses I've linked.