Edgoro
MetaTrader 5 · MQL5

MT5 EA generator: turn your trading rules into an MQL5 Expert Advisor

Describe your strategy the way you'd explain it to another trader: the market, the entry, the stop, the risk per trade, the hours you trade. Edgoro writes a complete MQL5 Expert Advisor for MetaTrader 5 with the risk controls built in as inputs. The code is then compiled in MetaEditor, and any errors go back to the AI for up to two automatic fixes.

You get a .mq5 file that you install and run in your own MetaTrader 5, on a demo account first. Edgoro never connects to your broker.

  • Complete MQL5 Expert Advisors
  • Compile check in MetaEditor
  • Bots option: +$25 at checkout

How it works

  1. Describe your rules

    Entry and exit conditions, stop and target (in points or as an ATR multiple), risk per trade, sessions, maximum trades per day. Where you leave a gap, Edgoro picks a sensible default and says so.

  2. Get the complete .mq5 file

    One full Expert Advisor in a single code block, then how it works (entry, exit, risk, filters) and the steps to install it in MetaTrader 5.

  3. Compile check in MetaEditor

    The code is compiled in MetaEditor. A clean build shows 0 errors and the warning count; errors go back to the AI with the compiler's messages, up to two automatic fixes per conversation.

  4. Test, then refine

    Run it in the Strategy Tester, then on a demo account. Ask for changes in plain English, such as a trailing stop or a spread filter; each answer is a new version in your library.

Example: position sizing from risk

Position sizing is where hand-written EAs most often go wrong, so it's a good example of the code style. Every EA Edgoro writes sizes positions from your risk percentage and the stop distance, within the broker's volume limits. The excerpt is the sizing function from our guide to MQL5 lot size from risk percent, which compiles in MetaEditor. Generated EAs work from the symbol's tick value and tick size by default; ask for this function if you prefer the terminal's own currency conversion.

RequestMT5 EA for EURUSD H1: buy when the 20 EMA crosses above the 50 EMA, stop at 2 × ATR(14), target 2R, risk 1% of equity per trade, trade 07:00–17:00 server time, max 2 trades a day.

MQL5 excerpt
// Volume that loses riskPercent of equity if price goes from entry to sl. Returns 0 when the trade can't respect it.
double LotsForRisk(const string symbol, const ENUM_ORDER_TYPE type, const double entry, const double sl, const double riskPercent)
  {
   if(riskPercent <= 0.0 || entry <= 0.0 || sl <= 0.0 || entry == sl)
      return 0.0;

   double riskMoney = AccountInfoDouble(ACCOUNT_EQUITY) * riskPercent / 100.0;

   // Profit of 1 lot from entry to stop, in account currency: negative when the stop is on the correct side.
   double pnlOneLot = 0.0;
   if(!OrderCalcProfit(type, symbol, 1.0, entry, sl, pnlOneLot) || pnlOneLot >= 0.0)
      return 0.0;
   double lossOneLot = -pnlOneLot + InpCommissionPerLot;

   double step   = SymbolInfoDouble(symbol, SYMBOL_VOLUME_STEP);
   double minLot = SymbolInfoDouble(symbol, SYMBOL_VOLUME_MIN);
   double maxLot = SymbolInfoDouble(symbol, SYMBOL_VOLUME_MAX);
   if(step <= 0.0)
      return 0.0;

   // Round DOWN to the volume step; the epsilon stops 0.3 / 0.1 = 2.9999... from losing a whole step.
   double lots = MathFloor(riskMoney / lossOneLot / step + 1e-9) * step;
   lots = NormalizeDouble(lots, VolumeDigits(step));

   if(lots < minLot)
      return 0.0;                        // even the minimum volume would risk too much: skip the trade
   lots = MathMin(lots, maxLot);

   // Enough free margin for this volume?
   double margin = 0.0;
   if(!OrderCalcMargin(type, symbol, lots, entry, margin) || margin > AccountInfoDouble(ACCOUNT_MARGIN_FREE))
      return 0.0;
   return lots;
  }
Excerpt: one function of a longer file. An example of the code, not a performance claim.

The complete EA around it declares the inputs, creates its indicator handles in OnInit and releases them in OnDeinit, and acts once per new bar. For trailing logic, see MQL5 trailing stop code.

What every Expert Advisor includes

The bot builder works from a fixed checklist so the code compiles and stays safe to test:

  • #include <Trade/Trade.mqh> and the CTrade class for orders, with a Print of the return code when an order fails.
  • Inputs for lot mode (fixed or % risk), risk per trade, stop-loss and take-profit in points or ATR multiples, magic number, maximum spread, trading hours, maximum trades per day and maximum daily loss.
  • Indicator handles (iMA, iRSI, iATR…) created once in OnInit, checked against INVALID_HANDLE and released in OnDeinit.
  • Prices normalised to the symbol's digits, volumes within the broker's minimum, maximum and step, stops beyond the broker's stop level.
  • Only positions carrying the EA's own magic number are managed.

It also avoids C++ habits that break MQL5 builds, such as new on primitive types, std::, auto or try/catch. When MetaEditor still finds an error, the compiler's message drives the fix.

From a TradingView script to MT5

Already have a Pine Script strategy? Paste it into the bot builder and ask for the MetaTrader 5 version. Some behaviour changes between the platforms, such as when orders fill and how positions are tracked, so test both. How to convert Pine Script to MQL5 explains what to check.

What's included, and what isn't

Included

  • Complete MQL5 Expert Advisors for MetaTrader 5
  • Compile check in MetaEditor, with up to 2 automatic fixes
  • Risk inputs: % risk sizing, ATR stops, spread, hours, daily limits
  • Install steps and a reminder to use the Strategy Tester first
  • Refinements in plain English, each saved as a version
  • Copy and .mq5 download from your library
  • Python crypto bots, in the same option

Limits, plainly

  • Trading bots are an option on top of a plan, not part of the base plans.
  • MetaTrader 5 only: Edgoro doesn't write MQL4 for MetaTrader 4.
  • A clean compile proves the code builds, not that the strategy is sound. Test it in the Strategy Tester and on demo.
  • If the compile service is briefly unavailable, you still get the code, without the check result.
  • The EA runs in your MetaTrader 5, on your computer or a VPS. Edgoro never connects to your broker or places trades.

Who it's for

Discretionary traders automating a setup

You trade the same rules every day. An EA takes the entries you'd take, in the hours you choose, with the stop attached.

MQL5 developers saving time

Get the scaffolding (inputs, handles, sizing, logging) written and compile-checked, then spend your time on the logic.

Prop-firm traders

With the Prop Firm Pack, daily-loss, drawdown and trade-count guards are written into every EA, with a safety buffer.

Compared with doing it yourself or a generic AI chatbot

EdgoroDoing it yourselfA generic AI chatbot
First working versionOne request, then a compile checkHours to days in MetaEditorQuick, but you compile it yourself
Compile errorsSent back to the AI automatically, up to 2 fixesRead the compiler log and fixCopy the errors back by hand
Risk controls% risk sizing, daily loss, max trades, spread filterAs many as you writeOnly what you ask for
MQL5, not C++Rules avoid constructs MQL5 rejectsDepends on your MQL5 experienceCan mix in C++ syntax MQL5 rejects
VersionsEvery version saved, .mq5 downloadYour own filesScroll back through the chat

Pricing

Trading bots for MT5 and crypto are one option on top of a plan: +$25 when you tick it as you choose your plan, or $49 once later from Settings. The plans are Pro Monthly at $29 a month or Lifetime at $49 once, so Lifetime with the bots option comes to $74, paid once. Options work while your plan is active, and the bots option bought with your first plan is covered by the same 7-day money-back guarantee.

Compare the plans

Frequently asked questions

Is the generated EA compiled?

Yes. Each EA goes through a compile check in MetaEditor, MetaTrader 5's own compiler. A clean build shows 0 errors and the number of warnings. If there are errors, the compiler's messages go back to the AI automatically, up to two fixes per conversation, and you can ask for another fix in one click.

Does Edgoro connect to my broker or trade for me?

No. You install the .mq5 file in your own MetaTrader 5 and attach it to a chart. Edgoro never sees your broker login, never holds funds and never places orders.

Can it write MQL4 for MetaTrader 4?

No. The bot builder writes MQL5 for MetaTrader 5 only.

How do I run an EA around the clock?

Keep MetaTrader 5 running with Algo Trading enabled, on your computer or a small VPS. The EA runs there, not on Edgoro's servers.

Will the EA pass a prop firm challenge?

No code can promise that. With the Prop Firm Pack, your challenge's daily loss, drawdown and trade limits are built in as guards with a safety buffer, but you still need to check your firm's current rules and test on demo.

Do I need the trading bots option?

Yes. MT5 Expert Advisors and Python crypto bots are one option: +$25 when you choose your plan, or $49 later. Indicators and chart analysis are in every plan.

Build your first Expert Advisor

Answer a few questions about how you trade, choose a plan with the bots option, and describe your strategy.

Instant access after checkout. 7-day money-back guarantee on your first purchase.

Trading involves substantial risk of loss and is not suitable for every investor. Edgoro is a software tool, not a broker or financial adviser: nothing it produces is investment advice, and past or backtested performance does not guarantee future results.