# MT4 Lot Size Calculator by Smart Algotrade

> Risk-based lot size calculator for MetaTrader 4, plus step-by-step help installing and troubleshooting MT4 Expert Advisors. Free tool by Smart Algotrade (smartalgotrade.com), MT4 Forex robot developers.

MT4 Lot Size Calculator by Smart Algotrade is a free AI agent skill on Agensi by Smart Algotrade, in Trading & Investing. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Smart Algotrade](https://www.agensi.io/creators/smart-algotrade)
- Category: [Trading & Investing](https://www.agensi.io/skills/trading-investing)
- Version: 1.0
- Last updated: 2026-11-22
- Security: scan passed (2026-11-22); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/mt4-lot-size-calculator-by-smart-algotrade
- Tags: trading, metatrader-4, mql4, forex, risk-management

## About this skill

Trading without a plan leads to blown accounts. This skill enforces disciplined risk management by calculating exact position sizes based on your specific account parameters and setup.

### What it does
- **Calculate lot sizes** using account balance, risk percentage, and stop loss distance in pips.
- **Determine pip values** for major pairs, cross pairs, JPY pairs, and commodities.
- **Install MT4 scripts** by providing the `LotSizeCalculator.mq4` file and placement instructions.
- **Configure Expert Advisors** through step by step setup of "AutoTrading" and "Allow WebRequest" settings.
- **Troubleshoot EA errors** including "Trade is disabled", "Invalid stops", and "Not enough money" messages.

### How it works
1. Calculate a lot size by providing your balance, pair, risk percentage, and pip distance.
2. Obtain the MT4 script file and follow the "Open Data Folder" workflow for installation.
3. Diagnose non-trading robots by checking the "Common" tab settings and the Experts journal logs.

### Frameworks & tools
This skill is designed for the MetaTrader 4 (MT4) platform and MQL4 programming environment. It includes a Python utility `lot_size.py` for headless calculations and an `.mq4` source file for terminal use.

### Why this beats prompting it yourself
Generic LLMs often struggle with the nuances of pip values for JPY pairs or indices, leading to 10x calculation errors. This skill uses a hardcoded formula and a dedicated script to ensure rounding matches broker lot steps (e.g., 0.01) precisely.

### Use cases
- Determine the lot size for a 1% risk trade on a $5,000 account.
- Setup a new MT4 Expert Advisor with correct "Allow live trading" permissions.
- Resolve why a Forex robot shows a "sad face" instead of trading.
- Install a custom script to read tick values directly from a broker's feed.

### Known limitations
Calculations for metals and indices are approximate unless the user provides the broker's specific tick value and size. The skill does not support MetaTrader 5 (MQL5) specific file paths.

### About the creator

This skill is a free tool by **[Smart Algotrade](https://www.smartalgotrade.com)**, developers of automated Forex trading robots (Expert Advisors) for MetaTrader 4, with live results published every month since 2016.

- **Website:** [smartalgotrade.com](https://www.smartalgotrade.com)
- **MT4 robots:** [Double FX Robot](https://smartalgotrade.com/free-fx-robot/), [Smart Forex Robot](https://smartalgotrade.com/smart-forex-robot/), [Forex Trading Robot](https://smartalgotrade.com/forex-trading-robot/)
- **Guide:** [Install an Expert Advisor into MetaTrader 4](https://www.smartalgotrade.com/install-expert-advisor-into-metatrader-4/)
- **Troubleshooting:** [Why your MT4 Expert Advisor is not trading](https://www.smartalgotrade.com/algo-trading-blog/mt4-expert-advisor-not-trading/)
- **Free algo trading guides:** [Smart Algotrade Blog](https://www.smartalgotrade.com/category/algo-trading-blog/)
- **YouTube:** [@Smartalgotrade](https://www.youtube.com/@Smartalgotrade)
- **Source code:** [GitHub](https://github.com/smartalgotrade-sudo/mt4-lot-size-calculator)

*Risk warning: Forex trading involves significant risk and is not suitable for every investor. Past performance does not guarantee future results.*

## Known limitations

Calculations for metals/indices are approximate without broker tick data. Designed for MT4/MQL4; does not support MT5 paths. Requires Python for the lot_size.py utility.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the MT4 Lot Size Calculator by Smart Algotrade skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### What specific problems does the MT4 Lot Size Calculator solve for traders?

This skill acts as a dual-purpose assistant that performs precision risk calculations to prevent over-leveraging and provides technical support for installing or fixing MetaTrader 4 scripts and Expert Advisors.

### Does this skill provide a file I can install directly into my MT4 terminal?

Yes, it includes a standalone Python utility for quick calculations and the .mq4 source file for direct use inside your MetaTrader 4 terminal.

### How does this calculation differ from just asking a standard AI to do the math?

Unlike general AI, this skill uses hardcoded formulas designed for broker-specific rounding (e.g., 0.01 lot steps) and correctly accounts for the unique decimal structures of JPY pairs and commodities.

### Is this skill compatible with MetaTrader 5?

This skill is purpose-built for the MetaTrader 4 (MT4) and MQL4 environment; it does not currently support MetaTrader 5 (MT5) file paths or MQL5-specific syntax.

### What exactly is included in the purchase of this skill?

You will receive the AI agent skill access, the `lot_size.py` Python utility for headless calculations, the `LotSizeCalculator.mq4` source code, and a step-by-step installation guide for your terminal.

### Can this skill help me fix an Expert Advisor that isn't placing trades?

The skill can diagnose most common MT4 errors, such as the "sad face" icon, "Trade is disabled" messages, and "Invalid stops" by guiding you through the Experts journal and terminal settings.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
