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

  1. 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.

  2. Formulate your trading strategy with AmiBroker. Let’s say your strategy is to BUY when the close price crosses over Moving Average (MA20), and SELL when price crosses down MA20, and vice-versa for SHORT and COVER. Let’s say you use this strategy to trade EURUSD 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 the switch block of RunAlgo(). This caters for multiple strategies by calling different functions based on signal name. Your function will be used for both backtesting and live trading.

    #include "Formulas/Unlax/"
    function DemoAlgo(signalName) {
      Buy   = Cross(C, MA(C,20));
      Sell  = Cross(MA(C,20), C);
      Short = Sell;
      Cover = Buy;
      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());
  3. Backtest your strategy in 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, set Account Margin to 1. Configure accordingly, e.g Positions (Long and short), Periodicity (1-minute). In Analysis window, set Apply to: (e.g. Current symbol) and date range. Run Backtest and analyse the results using either Report Explorer or View Last Report:

    View Last Report

  4. 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. Use Unlax DDE Plugin Setup shortcut to help you configure AmiBroker DDE Data Source quickly, or alternatively do it yourself via AmiBroker > 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, select AmiBroker > Window > enable Realtime Quote, then Symbol > Real Time Quote > Type-in symbol(s).

    Real-time Quotes

    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.

  5. Attach Unlax Signaler to the chart by selecting AmiBroker > Charts > Unlax > Signaler > right-click Insert Linked. You may configure the Signaler properties by right-clicking on its pane and choose Parameters. The default Signal Name is the chart symbol name.

    Unlax Signaler Screenshot

    If Signaler shows error such as Timeframe mismatch or Symbol mismatch, it means your selected chart is using a different timeframe or symbol from TradeConfig 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.

  6. Attach UnlaxTrader EA to MT4 by selecting MT4 > Navigator > Expert Advisors > Unlax > UnlaxTrader > Attach to a chart. In the Common tab of the EA dialog, enable Allow DLL imports and Allow live trading (other checkboxes are optional).

    EA Dialog - Common

    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.

    EA Dialog - Inputs

    Click OK and verify the displayed Derived Configurations are what you desired.

    UnlaxTrader Screenshot

    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 from MT4 > 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!