Yakuza AI – Buying and selling Editions – Buying and selling Methods – 15 March 2026


══════════════════════════════════════════════════════════════════════

   YAKUZA EA V3.0 — BREAKOUT EDITION

   Copyright 2026, Ahmed Ibrahim. All Rights Reserved.

══════════════════════════════════════════════════════════════════════

─────────────────

  3.  How the Technique Works

  4.  Enter Parameters Reference

      4.2  S1: Breakout

      4.3  S1: Time Filter

      4.4  Information Filter

      4.5  Lot Sizing

  5.  Lot Dimension Modes Defined

  6.  Information Filter Defined

  9.  Backtesting Notes

══════════════════════════════════════════════════════════════════════

══════════════════════════════════════════════════════════════════════

Yakuza EA V3.0 Breakout Version is a totally automated Professional Advisor

for MetaTrader 5 that trades swing-level breakouts utilizing pending

BuyStop and SellStop orders.

  – Swing excessive/low detection with configurable lookback depth

  – Pending order placement with automated expiration

  – Step-based trailing cease loss

  – Session time filter (dealer time or GMT)

  – Financial information filter utilizing the MQL5 built-in calendar

  – Computerized place closing on information occasions (non-compulsory)

  – 5 lot-sizing modes together with share danger

  – Actual-time on-chart dashboard

  – Telegram notifications for trades, each day/weekly stories,

    and safety occasions

  – Works on any image and any timeframe

══════════════════════════════════════════════════════════════════════

══════════════════════════════════════════════════════════════════════

Step 1 — Connect to a chart

  In MT5 Navigator panel (Ctrl+N), develop Professional Advisors, discover

  “Yakuza_EA_V3_Breakout”, and drag it onto your required chart.

Step 2 — Allow algo buying and selling

  Be certain the “Algo Buying and selling” button on the MT5 toolbar is enabled

  (it ought to seem inexperienced, not pink).

Step 3 — Enable net requests (for Telegram)

  If utilizing Telegram notifications, go to:

    Instruments → Choices → Professional Advisors

  Verify “Enable WebRequest for listed URL” and add:

══════════════════════════════════════════════════════════════════════

  3. HOW THE STRATEGY WORKS

══════════════════════════════════════════════════════════════════════

The EA runs on every new bar and performs the next steps:

     The EA scans the final 200 bars searching for swing highs and

     swing lows. A swing excessive is a bar whose excessive is the best

     inside S1_BarsN bars on all sides. A swing low is the

     reverse — the bottom low throughout the similar window.

  2. PENDING ORDER PLACEMENT

     If there isn’t any current purchase place or purchase pending order,

     the EA locations a BuyStop at the latest swing excessive.

     If there isn’t any current promote place or promote pending order,

     it locations a SellStop at the latest swing low.

     Every pending order will get:

       – A cease loss at S1_Slpoints distance from entry

       – A take revenue at S1_Tppoints distance from entry

       – An expiration time of S1_ExpirationBars bars from now

     Earlier than putting orders, the EA checks:

       – Time filter: Is the present hour throughout the allowed

         buying and selling session? If not, all pending orders are deleted.

       – Information filter: Is a high-impact information occasion imminent or

         in progress? If that’s the case, pending orders are deleted and

         optionally open positions are closed.

     On each tick, the EA checks all open S1 positions. As soon as

     worth has moved S1_TslTriggerPoints in revenue, the cease

     loss is trailed in steps of S1_Tslpoints behind the

     present worth. The path solely strikes within the favorable

     course — it by no means strikes backward.

     Positions are closed by both:

       – Take revenue being hit

       – Cease loss (authentic or trailed) being hit

       – Pending order expiration (if by no means triggered)

       – Information filter closing positions (if NewsCloseOnEvent=true)

══════════════════════════════════════════════════════════════════════

  4. INPUT PARAMETERS REFERENCE

══════════════════════════════════════════════════════════════════════

───────────────────────────────────────────────────────────────────

────────────────────────────────────────────────────────────────────

  Magic  (default: 696969)

    Distinctive magic quantity that identifies this EA’s trades. When you

    run a number of EAs on the identical account, every should have a

    completely different magic quantity.

  EA_Comment  (default: “Yakuza EA”)

    Remark string connected to each order and place opened

    by this EA. The EA appends ” S1″ to determine breakout trades.

────────────────────────────────────────────────────────────────────

────────────────────────────────────────────────────────────────────

  S1_BarsN  (default: 3)

    Variety of bars on all sides required to verify a swing

    level. A price of three means a swing excessive have to be greater than

    the three bars earlier than it and the three bars after it (7-bar window).

    Greater values produce fewer however stronger breakout ranges.

  S1_OrderDistPoints  (default: 0)

    Distance between Excessive/Low to position the pending order

  S1_ExpirationBars  (default: 50)

    Variety of bars after which an unfilled pending order is

    mechanically cancelled by the dealer. On H1 this implies

    roughly 50 hours; on M15 it means about 12.5 hours.

  S1_Tppoints  (default: 1000)

    Take revenue distance in factors from the entry worth.

    On a 5-digit dealer, 1000 factors = 100 pips for foreign exchange.

    On gold (2-digit), 1000 factors = 10.00 worth distance.

  S1_Slpoints  (default: 400)

    Cease loss distance in factors from the entry worth.

    Similar level/pip conversion as above.

  S1_Tslpoints  (default: 50)

    Trailing cease step dimension in factors. As soon as the path is

    activated, the cease loss follows worth at this distance.

  S1_TslTriggerPoints  (default: 50)

    Minimal revenue in factors earlier than the trailing cease

    prompts. The place have to be a minimum of this far in

    revenue earlier than any trailing begins.

────────────────────────────────────────────────────────────────────

────────────────────────────────────────────────────────────────────

  S1_TradingTime  (default: true)

    Allow or disable the session time filter. When enabled,

    the EA solely locations new pending orders through the allowed

    hours. Current pending orders are deleted exterior the

    allowed session. Open positions are NOT closed by this

    filter — solely pending orders are affected.

  S1_TimeSelection  (default: BROKER_TIME)

    Which clock to make use of for the time filter.

      BROKER_TIME = server time returned by TimeCurrent()

      GMT_TIME    = UTC/GMT time returned by TimeGMT()

  S1_TradingStartHour  (default: 7)

    Hour (0–23) when the buying and selling session begins.

  S1_TradingEndHour  (default: 18)

    Hour (0–23) when the buying and selling session ends.

    In a single day classes are supported: if StartHour > EndHour

    (e.g. Begin=22, Finish=6), the EA trades from 22:00 by means of

────────────────────────────────────────────────────────────────────

────────────────────────────────────────────────────────────────────

  UseNewsFilter  (default: true)

    Allow the financial calendar information filter. When a qualifying

    information occasion is throughout the buffer window, the EA blocks new

    order placement and deletes current pending orders.

  NewsMinsBefore  (default: 15)

    Minutes earlier than a information occasion to start blocking.

  NewsMinsAfter  (default: 15)

    Minutes after a information occasion to proceed blocking.

  NewsHighOnly  (default: true)

    When true, solely high-impact (pink) occasions set off the

    filter. When false, each excessive and medium-impact occasions

  NewsCloseOnEvent  (default: false)

    When true, all open positions (not simply pending orders)

    are instantly closed when a information block begins. Use with

    warning — this may force-close worthwhile trades.

  NewsCountry  (default: “US”)

    Nation code to filter occasions by. The filter checks if

    the occasion’s nation code accommodates this string. Widespread

    values: “US”, “EU”, “GB”, “JP”, “AU”, “CA”, “CH”, “NZ”.

    To match a number of nations, you would wish to run

    separate EA situations or modify the code.

───────────────────────────────────────────────────────────────────

────────────────────────────────────────────────────────────────────

  LotSizeMode  (default: FIXED_LOTS)

    Selects which lot calculation methodology to make use of.

    See Part 5 for an in depth clarification of every mode.

  RiskPct  (default: 3.0)

    The share worth utilized by PCT_ACCOUNT_BALANCE,

    PCT_EQUITY, and PCT_FREE_MARGIN modes.

  FixedRiskAmount  (default: 50.0)

    Greenback quantity risked per commerce when utilizing

    FIXED_RISK_PER_TRADE mode.

  FixedLotSize  (default: 0.05)

    Lot dimension utilized in FIXED_LOTS mode and as a fallback

    if any dynamic calculation fails.

  MaxLotSize  (default: 0.0)

    Laborious cap on lot dimension. Set to 0.0 to disable the cap.

    When set to a optimistic worth, no commerce will exceed

    this lot dimension whatever the calculated quantity.

────────────────────────────────────────────────────────────────────

────────────────────────────────────────────────────────────────────

  TG_Enabled  (default: true)

    Grasp swap for all Telegram notifications.

  TG_BotToken  (default: “”)

    Your Telegram bot token from @BotFather.

    Instance: “1234567890:ABCDefGhIjKlMnOpQrStUvWxYz”

  TG_ChatID  (default: “”)

    Your Telegram chat or group ID.

    Instance: “-1001234567890” for a bunch, or “123456789”

    for a non-public chat.

  TG_TradeAlerts  (default: true)

    Ship a notification when a commerce opens or closes.

  TG_DailyReport  (default: true)

    Ship a each day abstract report.

  TG_DailyReportHour  (default: 23)

    Hour (dealer time) to ship the each day report.

  TG_WeeklyReport  (default: true)

    Ship a weekly abstract report (Fridays solely).

  TG_WeeklyReportHour  (default: 22)

    Hour (dealer time, Friday) to ship the weekly report.

  TG_ProtectionAlerts  (default: true)

    Ship a notification when a safety occasion triggers,

    corresponding to a information block activating.

────────────────────────────────────────────────────────────────────

────────────────────────────────────────────────────────────────────

  VerboseLog  (default: false)

    When enabled, the EA prints detailed debug messages to

    the MT5 Specialists log tab. Helpful for troubleshooting.

    Preserve disabled in manufacturing to cut back log file dimension.

────────────────────────────────────────────────────────────────────

────────────────────────────────────────────────────────────────────

  ShowDashboard  (default: true)

    Show the on-chart info panel.

  DashBgColor  (default: C’8,5,12′)

    Background coloration of the dashboard panel.

  DashTextColor  (default: C’210,200,225′)

    Default textual content coloration for values.

  DashGreenColor  (default: C’40,200,100′)

    Coloration used for optimistic values and energetic standing.

  DashRedColor  (default: C’220,35,25′)

    Coloration used for adverse values and losses.

  DashAccentColor  (default: C’200,30,20′)

    Coloration used for labels and the panel border.

  DashFontSize  (default: 12)

    Font dimension in pixels for dashboard textual content.

    Horizontal offset from the left fringe of the chart.

    Vertical offset from the highest of the chart.

══════════════════════════════════════════════════════════════════════

  5. LOT SIZE MODES EXPLAINED

══════════════════════════════════════════════════════════════════════

All dynamic modes calculate lot dimension based mostly on the cease loss

distance of every particular person commerce. The components is:

  heaps = risk_amount / (SL_distance_in_ticks × tick_value)

The 5 obtainable modes:

    Each commerce makes use of precisely the FixedLotSize worth.

    Easy and predictable, however doesn’t adapt to account

    progress or various cease loss distances.

    Danger quantity = Account Steadiness × RiskPct / 100

    Finest for: Regular compounding based mostly on realized features.

    Danger quantity = Account Fairness × RiskPct / 100

    Fairness contains unrealized floating P&L. Lot sizes

    enhance when you have got profitable open trades and reduce

    when you have got dropping ones.

    Danger quantity = Free Margin × RiskPct / 100

    Free margin is fairness minus margin utilized by open positions.

    That is essentially the most conservative dynamic mode as a result of lot

    sizes shrink as you open extra positions.

    Danger quantity = FixedRiskAmount (in account forex)

    Dangers precisely the desired greenback quantity per commerce

    no matter account dimension.

Security options constructed into all modes:

  – Lot dimension is clamped to the image’s minimal and most

  – Lot dimension is rounded right down to the closest legitimate step

  – MaxLotSize cap is enforced if set

  – A margin verify ensures the account can afford the commerce;

    if not, lot dimension is lowered till it matches

══════════════════════════════════════════════════════════════════════

  6. NEWS FILTER EXPLAINED

══════════════════════════════════════════════════════════════════════

The information filter makes use of the MQL5 built-in financial calendar

(CalendarValueHistory) to detect upcoming occasions. It does NOT

require any exterior information, downloads, or indicator dependencies.

  1. On each tick, the EA queries the calendar for occasions

     throughout the time window:

       from: now − NewsMinsAfter

       to:   now + NewsMinsBefore + 60 minutes

  2. It filters occasions by:

     – Nation code matching NewsCountry

     – Significance stage (excessive solely, or excessive + medium)

  3. If the present time falls throughout the blocking window

     of any matching occasion (NewsMinsBefore earlier than by means of

     NewsMinsAfter after the occasion time):

       – All pending S1 orders are instantly deleted

       – If NewsCloseOnEvent is true, all open positions

         are additionally closed

       – No new orders are positioned till the block clears

       – A Telegram alert is shipped (if TG_ProtectionAlerts)

  4. The dashboard reveals the information filter standing in actual time:

       “Clear”     — no close by occasions

       “Subsequent: NFP in 45m” — upcoming occasion with countdown

       “BLOCKED: NFP” — presently in a blocking window

  The MQL5 calendar requires an energetic web connection

  and solely works with a reside or demo account. It does NOT

  operate within the Technique Tester (backtesting). Throughout

  backtests the information filter is successfully disabled.

══════════════════════════════════════════════════════════════════════

══════════════════════════════════════════════════════════════════════

  Open Telegram, seek for @BotFather, and ship /newbot.

  Comply with the prompts. You’ll obtain a bot token like:

    1234567890:ABCDefGhIjKlMnOpQrStUvWxYz

Step 2 — Get your chat ID

  Possibility A (personal chat): Seek for @userinfobot on

  Telegram and ship it any message. It replies together with your ID.

  Possibility B (group chat): Add your bot to the group, ship a

  message, then go to in your browser:

  Search for the “chat”:{“id”: worth within the JSON response.

Step 3 — Enable the URL in MT5

  Go to Instruments → Choices → Professional Advisors, verify

  “Enable WebRequest for listed URL” and add:

Step 4 — Enter your credentials

  Set TG_BotToken and TG_ChatID within the EA inputs.

  Startup message — despatched when the EA initializes, confirms

  it’s working and reveals the image and stability.

  Commerce opened — despatched when a pending order fills, exhibiting

  entry worth, SL, TP, lot dimension, and course.

  Commerce closed — despatched when a place exits (SL, TP, or

  pressured shut), exhibiting P&L, open/shut costs, and much.

  Safety alert — despatched when the information filter blocks

  buying and selling, exhibiting the occasion identify and time.

  Day by day report — despatched as soon as per day at TG_DailyReportHour,

  exhibiting stability and day P&L.

  Weekly report — despatched on Fridays at TG_WeeklyReportHour,

  exhibiting the present stability.

══════════════════════════════════════════════════════════════════════

══════════════════════════════════════════════════════════════════════

The on-chart dashboard shows the next info,

  ───   ──────────────────────────────────────────────────

   1    Title: YAKUZA AI V3.0 · BREAKOUT

   3    Buying and selling image

   4    Fairness P&L (present fairness minus stability)

   5    Day P&L (fairness minus start-of-day stability)

   6    Technique standing (S1 Breakout ON)

   7    Information filter standing (Clear / Subsequent occasion / BLOCKED)

   8    Open positions (Purchase rely, Promote rely)

   9    Pending orders (BuyStop rely, SellStop rely)

  10    Operating time in days since EA was connected

The dashboard is mechanically eliminated when the EA is

faraway from the chart or when the chart is closed.

To reposition the dashboard, modify DashX and DashY. To

conceal it totally, set ShowDashboard to false.

══════════════════════════════════════════════════════════════════════

══════════════════════════════════════════════════════════════════════

  PROBLEM: EA is on the chart however not buying and selling.

    – Is “Algo Buying and selling” enabled (inexperienced button on toolbar)?

    – Is the EA throughout the allowed buying and selling hours?

    – Is the information filter presently blocking?

    – Verify the Specialists tab (Ctrl+E) for error messages.

    – Allow VerboseLog=true for detailed output.

  PROBLEM: “Commerce request failed” errors within the log.

    – Is the market open for this image?

    – Does the account have enough free margin?

    – Are SL/TP distances respecting the dealer’s minimal

      stops stage? The EA checks this mechanically, however

      some brokers have very vast minimums.

  PROBLEM: Telegram messages aren’t being acquired.

      URLs in Instruments → Choices → Professional Advisors?

    – Is TG_BotToken and TG_ChatID appropriate?

    – Has the bot been added to the group (if utilizing a bunch)?

    – Verify the Specialists tab for WebRequest errors.

  PROBLEM: Pending orders are being deleted repeatedly.

    – The time filter deletes pending orders exterior the

      allowed session. Verify S1_TradingStartHour and

      S1_TradingEndHour.

    – The information filter deletes pending orders when a block

      prompts. Verify the dashboard Information row.

    – A really quick S1_ExpirationBars worth causes orders

      to run out shortly. Enhance it.

  PROBLEM: Dashboard just isn’t seen.

    – Is ShowDashboard set to true?

    – The dashboard could also be offscreen. Reset DashX=12 and

    – Zoom out or scroll the chart — the dashboard is

      anchored to the top-left nook.

  PROBLEM: Lot dimension is at all times the minimal.

    – If utilizing a dynamic mode, the cease loss distance

      could also be very giant relative to the danger quantity,

      leading to a tiny calculated lot dimension.

    – Verify that RiskPct or FixedRiskAmount is ready to

      an affordable worth.

    – Verify the Specialists log with VerboseLog=true.

══════════════════════════════════════════════════════════════════════

══════════════════════════════════════════════════════════════════════

  V3.0 — Breakout Version (2026)

    – Information filter utilizing MQL5 built-in calendar

    – Optionally available place closing on information occasions

    – Telegram notifications by way of POST/JSON (dependable

      supply of particular characters and emoji)

    – On-chart dashboard with real-time updates

    – 5 lot-sizing modes with margin security verify

    – Session time filter with in a single day assist

    – Step trailing cease loss

══════════════════════════════════════════════════════════════════════

══════════════════════════════════════════════════════════════════════

Buying and selling overseas alternate, commodities, and different monetary

devices carries a excessive stage of danger and will not be

appropriate for all buyers. Previous efficiency just isn’t indicative

of future outcomes. Try to be conscious of all of the dangers

related to buying and selling and search recommendation from an unbiased

monetary advisor if in case you have any doubts. The creator just isn’t

liable for any losses incurred by means of the usage of this

══════════════════════════════════════════════════════════════════════

  Copyright 2026, Ahmed Ibrahim. All Rights Reserved.

══════════════════════════════════════════════════════════════════════



Supply hyperlink

Leave a Comment

Discover more from Education for All

Subscribe now to keep reading and get access to the full archive.

Continue reading