Long time users of Amibroker will know that it’s an excellent software for backtesting, scanning and many other tasks. However, automation of trading strategies is not one of it’s strengths.
Fortunately there’s a new and simple solution which I discovered in a new class called Trading And Investing Automation For Amibroker.
This solution involves linking up Amibroker with the Interactive Brokers API via a third -party software called Alera Portfolio Manager.
Configuring The Technology Stack
The course starts with some introductory material such as system requirements and the differences between full and semi-automation.
It soon gets into the meat of the course where we learn about the technology stack required for trade automation.
In a nutshell, the technology stack involves four components; Amibroker, Norgate Data Updater, IB Gateway and Alera Portfolio Manager.
Norgate Data is used to update Amibroker with the latest EOD quotes.
Amibroker is used to export buy and sell signals and Alera Portfolio Manager provides the link between Amibroker and the Interactive Brokers Gateway API.
This solution allows complete order execution, portfolio management and automation for end of day trading.
The whole process is set to run on autopilot with the help of batch processes within Amibroker and automatic updates (instigated by Alera).
Updates can be set to various times depending on your timezone and trading requirements.
The only manual intervention needed is a restart once a week which is necessary for the IB Gateway. This is normally done every Monday morning before the open.
Total Cost Of Automation
A total automation setup is not free but can be setup at reasonable cost.
Once you have taken the course and understand your requirements there are different pricing levels available depending on the number of strategies you want to automate and how much data you need.
IB Gateway is a free, lightweight API that is downloaded from the Interactive Brokers website.
Norgate Data is available as a free trial with a minimum subscription price of $22.50 per month for their Silver package. Other data sources can also be used depending on suitability.
Alera Portfolio Manager is provided free for the first three months before switching to CAD$12.99 for paper trading and CAD$49.99 for Silver.
You may also want to spend another $20 – $60 per month for cloud services if you are wanting to host on a virtual server.
All together I estimate that a total solution for automated trading can be set up for just $60 – $80 a month.
This doesn’t include Amibroker which is a $279 license for the standard edition but overall this is a very reasonable expense.
Alera Portfolio Manager
Alera Portfolio Manager (APM) is really the glue that brings this automation solution together and I’m not aware of any similar product on the market.
It’s a lightweight piece of software that picks up and processes buy/sell orders from Amibroker but can also take signals from other sources such as website stock screeners (eg. Finviz) and website signal providers.
The ability to take signals from online sources such as web screeners is another potential opportunity for traders looking to invest in automation.
APM also provides detailed trade logging (that can be sent via email) and provides an easy to use interface for adjusting various trade criteria:
No Interference Issues
APM manages the connection between the broker at all times while allowing portfolio management of positions.
This means APM manages positions on a per-strategy basis and does not allow duplicate signals or additional strategies to interfere with the correct order of trades or position sizing:
The plugin also provides the scheduling and automation of data updates meaning there is very little human input needed.
All told, APM reduces the toll on your computer’s resources to a bare minimum and it doesn’t suffer from the synchronisation issues that plague so many other automation platforms.
As well as providing a solution for trade automation, this course also provides a number of example scripts so you can easily get started.
These scripts include:
- AFL code for generating and exporting signals from Amibroker
- AFL code for an RSI-2 trading strategy (automation ready)
- AFL code for a MACD trading strategy (automation ready)
- Batch automation files
These scripts just need to be modified for your own strategy rules and trading requirements and you will be good to go.
You can also run the example scripts as they are and see how they get on in a paper trading account.
As you would expect it’s important to vigilantly test all your strategies with the IB paper trading account first before committing to real money.
It’s also important to treat automation with caution and remember that automation doesn’t necessarily mean a totally hands-off approach.
It’s best to watch alerts, trade logs and keep an eye on proceedings so that you can easily fix any issues as soon as they occur.
This course does an excellent job of explaining a process for trade automation with Amibroker.
Everything is covered step by step and the additional AFL scripts mean it is easy to get started automating strategies straight away.
The cost of total automation is also low when compared to other providers and can be first evaluated on a free trial basis.
I’ve really enjoyed this course and I’ve started putting some scripts together which I hope to automate on a cloud server with AWS. It will be great to get some systems running and then report back on their results.
Automation in Amibroker can be a complex process so it’s good to finally have a straightforward solution.
If you’re interested, take the course using the link below. (I talked with the instructor and you can use the coupon code ‘jbmarwood’ at checkout to get $50 off):
Learn Trading And Investing Automation For Amibroker
I look forward to hearing about your success with trading automation in Amibroker!
Merely curious: What would you say is the advantage of choosing Amibroker automation vs the ready-made integration of Tradestation with IB?
I’ve never spent much time with Tradestation. I heard it was not as flexible or powerful as AB but maybe it is. Thanks.
Hi Villa Toca,
I haven’t used TradeStation (and MultiCharts) in a few years and perhaps the technology has changed, but from my experience TS, MC’s and most other programs of this nature allow you to write an automation script that can be applied to one chart at a time. You can then turn on the automation feature and “hope” that the strategy stays in sync with the market. So the process is “stateful”. Years ago I attempted to run an automated strategy to trade the YM (mini dow) futures contract using TradeStation on a remote server in the “cloud” (they didn’t call it that back then). It would loose connection with TradeStation brokerage and re-connect, little internet re-connection ‘blips’. This caused my system to go from bidding on one contract in the /YM contract to several. One time I noticed it kept disconnecting and reconnecting and was bidding on over 30 contracts! You can guess what happened… I turned it off pretty fast.
With the process outlined in the course, the process is stateless. Alera Portfolio Manager does not need to maintain a connection to the signal platform (in this case AmiBroker), in order to work. It also does not allow mistakes due to duplicate orders being sent to the market, it can figure out when multiples of the same orders have been sent and shut down those types of errors.
Additionally, Alera Portfolio Manager works well with AmiBroker (a true portfolio-level backtesting engine) and together they are able to collect and process signals for true portfolio-level trading automation. This is basically non-existent in the market currently, at least at reasonable prices for retail traders. As far as I understand, retail trading platforms like TS do not do portfolio-level backtesting nor trading (and if they do, not well).
Taking it one step further, Alera Portfolio Manager is able to run multiple strategies that are portfolio-level strategies all within the same brokerage account. So if you can image you could have 10 tabs set up within the APM software, each tab running one strategy of 20 portfolio positions with 10% of the account capital each, using only 1 brokerage account. It can also run multiple instances to connect to multiple brokerage accounts too, but generally, most people probably want to contain things within one brokerage account.
Hope this helps.
Full disclosure – I’m the course creator 🙂
Thanks for elaborating – that was useful!
Hi Joe, thanks for maintaining a great, informative website!! I’ve read both your posts on automated trades via Excel API and this one (Alera)
1) As your post on Excel API was a bit older, do you now have a preference between the two? (I take about 10 trades a day or less, so either way is fine, I don’t really need a fully-automated system. )
2) Alera sounds like a great solution but the website doesn’t provide much information on its company or “About Us”, which is a little strange. Just wondering if you know the creator or if it is a fairly new company? What has your experience been trading with them and has it been a reliable provider?
Thanks again and would love to hear your thoughts on the above!
Hi Michelle. I am not currently using either solution. I have experimented with both but I really prefer to trade systems manually during this climate. My preference would be using Alera as it hooks up well with Amibroker and my data provider. Excel and IB meanwhile are limited to 100 tickers and not as compatible with Amibroker.
You didn’t reference AB’s own automated trading interface in this article (http://amibroker.com/at/).
Do you have any experience with it?
Not really, I find it too confusing.
You can also buy an automated trading interface at:
This one is built using C# and the source code is available for those so inclined. 🙂