Amibroker API Integration
Contents
Amibroker Developer Ecosystem
You may remember, we earlier discussed that Amibroker has an open ecosystem for developers. The Amibrokoker development kit is available for free in the downloads section. The ADK is a great tool to build Amibroker plugins in Dot Net or Java.
You can build three types of plugins in Amibroker:
Data Plugins
AFL Plugins
And Optimizer Plugins
Data plugins are used to connect with external data sources. You can code a data plugin to fetch data from any api.
AFL plugins can be used to build additional functionality in AFL. For example, AFL does not have functions for co-integration tests or option pricing. You can code such functions in dot net languages and tie it up with AFL engine.
Optimizer plugins are used for including any custom optimization algorithms.
AFL Scripting Integration
You can also use VB Script and Java Script directly in Amibroker. The EnableScript function is used to enable the scripting host.
The AFL scripting host is an interface between AFL language and scripting technologies
Even though these scripts can be used inside AFL, they are seldom required. AFL itself is sufficiently powerful to carry out most of the tasks.
AFL also supports COM technology. The COM dlls can written in any language of your choice- dot net. Java, python etc. You can do calculation in language of your choice and run them at full compiled code speed.
The Amibroker help files have plenty of sample code to help you get started in further development. Even if you are get stuck somewhere, the technical support of Amibroker is very good. They usually answer your emails within 4 hours.
There are already plugins available for R, Python and TWS API. So Amibroker is not just any other retail software. How much you can do in Amibroker simply depends upon the time you spend in learning Amibroker.
Paper Trading AFL
Have a look at this- this is the paper trading setup we will provide you soon. You can turn Amibroker into complete trading platform to send Limit or Market Orders.
Amibroker will maintain order log of orders that have been sent, cancelled or filled. Amibroker will also record all completed trades in separate excel file for further analysis. Therefore, Amibroker itself will be a complete system to test algo trading without using any other software.
In case of Limit Orders, you can chose between many options for execution. For example, consider signal generated by a mean reverting strategy. By sending a limit order at the price of candle’s low, you can wait for a better price to get filled.
Even If you are using a trend following strategy, you can push a buy limit order at the best bid, rather than sending a market order. You also have the option of choosing bid versus ltp for limit order price. The ltp has a better chance of getting filled. If you want to be more aggressive, you can send order at ask price, rather than the ltp price.
If you are using a momentum strategy, you can trigger market order instead of a limit order.
You can test out all combinations of execution which suits your strategy best. The best part is, you do not need to play around with real money to know your profitability.
We will soon also add Stop-loss entry orders in this paper trading system. It helps you to wait until market confirms the signal. For example, when you get a buy signal, you can wait until the high of previous candle is breached. In this scenario, you can place a stop buy order at the high of the previous candle.
Amibroker API Integration
Coming lastly to the API integration part, again you have multiple options for Amibroker.
APIBridge allows you to trade via Amibroker for all type of strategies. You can trade from charts, you can even trade from Automatic Analysis windows.
APIBridge connects to 14 brokers which across all asset classes – Indian or International. You do not have to worry about integrating all brokers separately. APIBridge is one-box solution for trading through multiple brokers and multiple markets.