Auto Lots Calculation EA (MT4/MT5) — Features and Parameters

** This session may be vulnerable to “store now, decrypt later” attacks. ** The server may need to be upgraded. See https://openssh.com/pq.html

TraderIsMe-Auto-Lots-Calculation-EA is a MetaTrader EA that automatically calculates lot size from the positions of horizontal lines (TP / EN / SL) you draw on the chart, then places orders with one click of the SELL / BUY button. It supports both MT4 and MT5 and works on Forex, CFDs, and crypto. Account currency is auto-detected.

This article is a reference for the EA’s features and input parameters. For heartbeat authentication, plan requirements, and API key setup, please also see the usage guide (coming soon in English).

Download

MT5 download

TraderIsMe-Auto-Lots-Calculation-EA-MT5.zip MT5

MT4 download

TraderIsMe-Auto-Lots-Calculation-EA-MT4.zip MT4

* Unzip and place the extracted .ex5 / .ex4 into MT’s data folder MQL5/Experts/ or MQL4/Experts/, then refresh the Navigator.

Overview

  • Supported platforms: MetaTrader 4 / MetaTrader 5
  • Licensing: heartbeat authentication tied to your TraderIsMe account (available on the FREE plan with periodic upgrade notifications)
  • Markets: Forex, CFDs, crypto. Account currency is auto-detected

Main Features

  • Drag the TP / Entry / SL horizontal lines to auto-calculate lot size that fits your specified loss condition
  • Choose between “Fixed Loss Amount” and “Percentage of Margin (%)” calculation modes
  • Toggle between market orders and pending orders
  • When SL exceeds 1% of margin, the label is shown in a warning color
  • Option to preserve line positions when switching timeframes
  • Two-row close button layout at the bottom of the panel — “Close All” (every symbol) and “Close” (current chart symbol only), each individually toggleable
  • Live readout on the close buttons showing total open Pips or PnL (1-second refresh). Font color flips automatically: blue when positive, red when negative
  • Pip Size resolves on Auto (FX / CFD / crypto / indices / metals / stocks classified via price-band heuristics). Manual override available (1 / 0.1 / 0.01 / 0.001 / 0.0001)
  • Auto-retry for filling modes (FOK / IOC / RETURN) on order send, absorbing broker-specific spec differences

Requirements

  • MetaTrader 5 terminal
  • A TraderIsMe account and an Account API key (issue it on the Settings page)
  • Add https://app.traderis.me to MT5’s WebRequest allowed URL list

Usage Flow

  1. Place the EA file TraderIsMe-Auto-Lots-Calculation-EA.mq5 into MT5’s MQL5/Experts/ and refresh the Navigator.
  2. Drag and drop the EA onto any symbol’s chart.
  3. On the “Common” tab, check “Allow Algo Trading.” On the “Inputs” tab, enter your Account API key in InpAccountApiKey.
  4. Three horizontal lines (blue = TP, green = EN, red = SL) are drawn on the chart automatically. Adjust them by dragging.
  5. Calculated lot size, PnL, and risk-reward are shown on the right-hand panel.
  6. Clicking the SELL / BUY button at the bottom of the panel places an order with the displayed lot size.

Input Parameters

Calculation Settings

ParameterTypeDefaultDescription
InpCalcModeenumMargin N%Lot calculation mode. Fixed Amount (lot sized to match InpLossAmount loss) or Margin N% (sized to match InpLossRate percent)
InpLossAmountdouble100Allowed loss amount in “Fixed Amount” mode (account currency)
InpLossRatedouble1.0Allowed loss percent in “Margin N%” mode. 1.0 = 1% of balance
InpOrderTypeenumPendingOrder type. Market (instant fill) or Pending (limit/stop at entry price)
InpMagicNumberlong202501Magic number to distinguish from other EAs and manual trades

Line Settings

ParameterTypeDefaultDescription
InpColorTPcolorDodgerBlueColor of the TP (take-profit) line
InpColorENcolorLimeGreenColor of the EN (entry) line
InpColorSLcolorRedColor of the SL (stop-loss) line
InpColorSLWarncolorPinkWarning label color when SL exceeds 1% of margin
InpLineWidthint2Line width (px)
InpInitBarsint50Reference point for placing TP / SL on EA startup. Uses the high / low of the most recent N candles

Panel Settings

ParameterTypeDefaultDescription
InpGripColorcolorSlateGrayColor of the grip bar at the top of the panel
InpInitPipsint30Initial SL / TP offset on EA startup (pips)
InpOTypeFontSizeint8Font size for the order-type label in the panel
InpOTypeFontColorcolorWhiteFont color for the order-type label in the panel

Label Placement

ParameterTypeDefaultDescription
InpLabelAnchorenumRightAnchor for price labels (TP/EN/SL price). Right or Left
InpLabelOffsetint150Horizontal offset from the anchor (px)
InpShowPipsbooltrueWhether to show distance from entry (pips / points) on TP / SL labels

Timeframe Change Behavior

ParameterTypeDefaultDescription
InpKeepLinesOnTFbooltrueWhether to preserve line positions when switching timeframes. false resets to initial positions on change

Close Button Settings

The bottom of the panel can show two close buttons: Close All (closes every open position across all symbols) and Close (closes only positions for the current chart symbol). Each button can be independently shown or hidden to avoid accidental clicks. Each button can also display the total open Pips or PnL of its target positions in real time, with the font color switching automatically between positive and negative.

ParameterTypeDefaultDescription
InpShowCloseAllbooltrueShow the Close All button (closes every open position across all symbols)
InpShowCloseSymbolboolfalseShow the Close button (closes only positions for the current chart symbol)
InpCloseBtnHeightint25Close button height (px). Panel height auto-adjusts to the number of visible buttons
InpCloseBtnFontSizeintMT5:8 / MT4:9Close button font size. Font is Meiryo Bold (supports Japanese glyphs)
InpCloseBtnDisplayenumPipsButton readout mode. Pips (total open pips) / Money (PnL in account currency) / Off (no number). Updated every second
InpCloseBtnPipSizeenumAutoPip-size resolution. Auto recommended (FX = 0.01 for JPY pairs / 0.0001 for others; non-FX classified by price band). Manual override: 1 / 0.1 / 0.01 / 0.001 / 0.0001
InpCloseBtnColorPluscolorDodgerBlueFont color when the total is positive (open profit)
InpCloseBtnColorMinuscolorTomatoFont color when the total is negative (open loss)

Subscription

ParameterTypeDefaultDescription
InpAccountApiKeystring“” (empty)TraderIsMe Account API key. Paste the UUID issued on the Settings page. Used for heartbeat authentication

Notes

  • Heartbeat authentication: the EA performs its first authentication 60 seconds after startup, then checks plan status with the TraderIsMe server every 60 seconds. On the FREE plan, a notification message appears every 15 minutes, but the EA’s functionality is not restricted.
  • Available plans: usable on every plan (FREE / BASIC / PRO). On the FREE plan, periodic notifications appear in MetaTrader. Upgrading to BASIC or PRO stops the notifications (see How to use free EAs).
  • WebRequest URL allowance: unless https://app.traderis.me is allowed in MT5’s “Tools → Options → Expert Advisors,” the heartbeat will fail and lock immediately.
  • Supported symbols: Forex, CFDs, and crypto. Symbol specs (Tick Value / Contract Size) are auto-fetched, but broker-specific symbol definitions may cause lot sizes to differ from expectations. Verify with a small trade first.
  • When SL exceeds 1% of margin: a warning label is shown in the color specified by InpColorSLWarn (pink by default). Calculation still runs, but double-check before ordering since the risk is high.
  • Magic number: when running alongside other EAs or manual trades, change InpMagicNumber to a non-conflicting value.

Download

MT5 download

TraderIsMe-Auto-Lots-Calculation-EA-MT5.zip MT5

MT4 download

TraderIsMe-Auto-Lots-Calculation-EA-MT4.zip MT4

* Unzip and place the extracted .ex5 / .ex4 into MT’s data folder MQL5/Experts/ or MQL4/Experts/, then refresh the Navigator.