Quick Start
Warning: do not trade with real money until you familiarize with our solution & read our Risk Disclaimer.
Watch Quick Start Tutorial Video on YouTube
Download and install UnlaxTrader into your Windows computer. For Linux or MacOS users, you can use tools like Bootcamp, Parallels or VMWare to run Windows.
Formulate your trading strategy with AmiBroker. Let’s say your strategy is to
BUY
when the close price crosses over Moving Average (MA20), andSELL
when price crosses down MA20, and vice-versa forSHORT
andCOVER
. Let’s say you use this strategy to tradeEURUSD
on 1-minute bar with one lot, 300 pts Stop Loss and 200 pts Take Profit.Start AmiBroker, select
Charts
>Unlax
>Algos
>Edit
. Add your formula as a function, and define function invocation in theswitch
block ofRunAlgo()
. This caters for multiple strategies by calling different functions based on signal name. Your function will be used for both backtesting and live trading."Formulas/Unlax/Common.afl" #include function DemoAlgo(signalName) { = Cross(C, MA(C,20)); Buy = Cross(MA(C,20), C); Sell = Sell; Short = Buy; Cover return TradeConfig(signalName,"EURUSD",in1Minute,300,200,1); } function RunAlgo(signalName) { switch (signalName) { case "EURUSD": e = DemoAlgo(signalName); break; default: e = "Trading signal not available"; }return e; } if (BackTesting()) RunAlgo(Name());
Backtest your strategy in
Algos.afl
against historical data of a symbol (e.g. EURUSD). You may skip this step if you simply want to see how UnlaxTrader works without worrying about strategy profitability. To backtest you need to import historical data into AmiBroker, we have provided some sample data during installation.Configure your backtest via
Analysis
>New Analysis
>Settings
icon. To simulate Forex 1:100 margin account, setAccount Margin
to 1. Configure accordingly, e.gPositions
(Long and short),Periodicity
(1-minute). In Analysis window, setApply to:
(e.g. Current symbol) and date range. RunBacktest
and analyse the results using eitherReport Explorer
orView Last Report
:Configure live charting and quotes. Let’s use MT4 as example. Start MT4 Terminal, login existing or open new demo trading account (don’t use live account for testing), select
Tools
>Options
>Server
>Enable DDE Server
. UseUnlax DDE Plugin Setup
shortcut to help you configure AmiBroker DDE Data Source quickly, or alternatively do it yourself viaAmiBroker
>File
>Database settings
>Data Source
using AmiBroker’s guide.Ensure AmiBroker connects to MT4 properly by observing the plugin status at bottom right corner of AmiBroker. If not connected, right click on the plugin status to reconnect. You should see live quotes flashing continuously in the
Realtime Quote
window and live chart displaying updated bars. If not, selectAmiBroker
>Window
> enableRealtime Quote
, thenSymbol
>Real Time Quote
>Type-in symbol(s)
.In live trading, you need to ensure there is no data gaps in your live chart, as its data comes from a combination of historical data and live quotes. If there are gaps, you need to backfill the missing data by downloading and importing it into AmiBroker and merge with the live symbol. For demo purpose, we will skip this step.
Attach Unlax Signaler to the chart by selecting
AmiBroker
>Charts
>Unlax
>Signaler
> right-clickInsert Linked
. You may configure the Signaler properties by right-clicking on its pane and chooseParameters
. The default Signal Name is the chart symbol name.If Signaler shows error such as
Timeframe mismatch
orSymbol mismatch
, it means your selected chart is using a different timeframe or symbol fromTradeConfig
in your algo, please change it accordingly. Signaler is now active and will send trade signals (if any) to the signal repository when it calls your AFL function periodically. You can see last run status and signal generated on the Signaler pane.Attach UnlaxTrader EA to MT4 by selecting
MT4
>Navigator
>Expert Advisors
>Unlax
>UnlaxTrader
>Attach to a chart
. In theCommon
tab of the EA dialog, enableAllow DLL imports
andAllow live trading
(other checkboxes are optional).You may configure properties of UnlaxTrader in
Inputs
tab, or simply use the default values. For example, set the Stop Loss and Take Profit type to "dynamic" to use the respective values from your algo, while leaving Lot Size as default fixed lot of 0.1.Click OK and verify the displayed
Derived Configurations
are what you desired.Click OK. Ensure MT4
AutoTrading
toggle is enabled. Your automated trading system is now ready. A blinking Active label on your MT4 chart indicates your EA is running fine. You can see order execution messages in EA logs fromMT4
>Terminal
>Experts
tab.2020.08.02 23:59:12.803 UnlaxTrader EURUSD,M1: EURUSD, TRADE, COVER, id:15199107, lot:0.10, priceSent:1.17728, priceFilled:1.17727, slippage:-0.00001 2020.08.02 23:59:12.803 UnlaxTrader EURUSD,M1: close #15199107 sell 0.10 EURUSD at 1.17724 at price 1.17727 2020.08.02 23:57:19.817 UnlaxTrader EURUSD,M1: EURUSD, TRADE, SHORT, id:15199107, lot:0.10, priceSent:1.17724, priceFilled:1.17724, slippage:0.00000 2020.08.02 23:57:19.817 UnlaxTrader EURUSD,M1: open #15199107 sell 0.10 EURUSD at 1.17724 ok
You may wish to enable Debug Mode to view detailed messages such as why certain signals are ignored. The steps for MT5 and cTrader are similar as above. Please refer to User Guide for more help. Happy Auto Trading!