Study ›

[Course] [Build an EA 2] Setup: MT5, demo account, MetaEditor

大EADesk MasterStaff2026. 10. 31. 09:21Views 111Up 0Comments 0

You need just two programs to build an EA: MT5 (the trading platform) and MetaEditor (the code editor that comes with MT5). Both are free.

1. Install MT5

  • Download MT5 from your broker's website. Without a broker, the official MetaQuotes MT5 still lets you open a demo account.
  • Launch it and a few charts appear.

2. Open a demo account

  • Choose File → Open an Account → demo and follow the steps to get an account with virtual money.
  • Pick an amount close to what you'd really use (e.g. $10,000). Too big and you won't get a real feel.

3. Open MetaEditor

  • In MT5: Tools → MetaQuotes Language Editor (shortcut F4)
  • If you see an Experts folder in the Navigator on the left, you're set. Our EA will be saved there.

4. Create a new EA file

  1. In MetaEditor: File → New (Ctrl+N)
  2. Choose Expert Advisor (template) → Next
  3. Name it `MyFirstEA` → Next → Next → Finish
  4. An empty skeleton opens. You'll see three blocks: `OnInit`, `OnDeinit`, `OnTick`.

5. The skeleton (this is all you need)

int OnInit()      // runs once when the EA is attached (setup)
void OnDeinit()   // runs once when it's removed (cleanup)
void OnTick()     // runs every time the price moves (decide and trade here)

Almost all of a bot's logic goes inside OnTick.

6. Compile = turn human code into machine code

  • Write code and press F7; the result appears in the Errors tab below.
  • `0 errors` means success. You can ignore warnings for now.
  • If there are errors, fix the first one first. Fixing one often clears the rest.

7. Attach it to a chart

  1. Back in MT5, drag Navigator → Expert Advisors → MyFirstEA onto a chart
  2. In the window, tick Common → Allow Algo Trading → OK
  3. Make sure the Algo Trading button at the top is green
  4. A blue cap icon at the chart's top right means the EA is running
It's an empty EA for now, so it does nothing. Next we'll decide the rules for what it should do.

Comments 0

List
Vantage 앱 광고Ad