ST Risk Calculator Guide

ST Risk Calculator

A free MetaTrader 4 Expert Advisor with on-chart risk calculator, ATR-based stop loss & take profit, and one-click trade execution.

Free Download MT4 EA v2.02

What Does It Do?

A draggable on-chart panel that calculates your position size, stop loss, and take profit based on ATR — then lets you execute the trade with one click.

📊

ATR-Based Levels

Stop loss and take profit are calculated from the 14-period ATR plus spread. No guesswork — everything is based on actual volatility.

💰

2% Risk Sizing

Automatically calculates the correct lot size so you never risk more than 2% of your account balance on any single trade.

One-Click Execution

Click EXECUTE BUY or EXECUTE SELL and the EA opens the trade with the calculated lot size, stop loss, and take profit — all set automatically.


Panel Overview

When you attach the EA to any chart, a dark panel appears showing real-time calculations. Here is what each field means:

Field Description
ATR(14)The 14-period Average True Range in pips. This measures the pair’s recent volatility.
SpreadCurrent broker spread in pips, included in all SL/TP calculations.
DirectionBUY or SELL — click the buttons at the top to switch.
EntryThe entry price (Ask for BUY, Bid for SELL).
Stop LossCalculated as: 0.5 × ATR + spread from entry.
Take ProfitCalculated as: 3 × ATR + spread from entry.
SL PipsStop loss distance in pips.
TP PipsTake profit distance in pips.
Lot SizePosition size calculated from your risk % and SL distance. Rounded down to your broker’s lot step.
RiskActual dollar risk and percentage after lot rounding. May be less than 2% if lot hits the 0.01 minimum.
R:R RatioReward-to-risk ratio. Default settings give approximately 1:5.7.

How to Install

Step 1 — Download the file ST_RiskCalc.mq4

Step 2 — Open MetaTrader 4 and go to File → Open Data Folder

Step 3 — Navigate to MQL4/Experts/ and paste the file there

Step 4 — Back in MT4, open the Navigator panel (Ctrl+N)

Step 5 — Right-click on Expert Advisors and click Refresh

Step 6 — Drag ST_RiskCalc onto any chart

Important: In the EA properties dialog, make sure to tick “Allow live trading” under the Common tab. Also ensure the AutoTrading button in the MT4 toolbar is enabled (green icon).

How to Use

1. Choose Direction

Click the BUY or SELL button at the top of the panel. All values update instantly and horizontal lines (Entry, SL, TP) are drawn on the chart.

2. Review the Calculation

Check the lot size, SL/TP prices, and actual risk amount. The panel updates on every tick so values always reflect the latest price.

Note: If your account balance is small and the SL is wide, the lot may floor to the broker minimum (usually 0.01). The Risk line shows the actual risk after lot rounding — which may be less than 2%.

3. Execute the Trade

When you are ready, click the EXECUTE BUY or EXECUTE SELL button. The EA will:

  1. Open the position at market price
  2. Set the stop loss and take profit automatically
  3. Show a confirmation in the status line (ticket number and fill price)
  4. Play a sound on success

4. Move the Panel

Click and drag the title bar (the dark bar at the top that says “ST Risk Calculator”) to reposition the panel anywhere on the chart.

5. Clear Lines

Click Clear Lines to remove the Entry/SL/TP horizontal lines from the chart.


Default Settings

Setting Default Description
ATR Period14Number of bars for ATR calculation
Risk Percent2.0%Percentage of account balance to risk per trade
SL ATR Multiplier0.5Stop loss = this × ATR + spread
TP ATR Multiplier3.0Take profit = this × ATR + spread
ATR TimeframeCurrent chartTimeframe for ATR calculation (can use H4 on M5 chart, etc.)
Slippage2.0 pipsMaximum allowed slippage for order execution
Magic Number20260211Unique identifier for this EA’s trades

All settings can be changed via F7 (EA Properties → Inputs tab) while the EA is running.


How the Math Works

SL & TP Formulas

Stop Loss Distance = 0.5 × ATR(14) + Spread

Take Profit Distance = 3 × ATR(14) + Spread

For a BUY: SL = Ask − SL Distance, TP = Ask + TP Distance
For a SELL: SL = Bid + SL Distance, TP = Bid − TP Distance

Lot Size Formula

Risk Amount = Account Balance × 2%

Lot Size = Risk Amount ÷ (SL in points × Tick Value)

The result is rounded down to your broker’s lot step and clamped between the minimum and maximum lot size.


Why Use ATR for Stop Loss & Take Profit?

Fixed Pips = Bad

A 20-pip stop loss might be perfect for EURUSD but suicidal for GBPJPY. Fixed pip values ignore how much the pair actually moves.

ATR = Adaptive

ATR measures real volatility. When markets are calm, your SL is tighter. When markets are wild, your SL widens to avoid noise. Same logic, every pair, every session.


Frequently Asked Questions

Why is my lot size stuck at 0.01?

Your account balance is too small relative to the SL distance. The calculated lot comes out below the broker’s minimum (0.01), so it gets floored up. The Risk line shows your actual risk after this rounding — it will be below 2%. This is not a bug, it is your broker’s minimum lot size limit.

I get “AutoTrading is disabled” when I click Execute

Click the AutoTrading button in the MT4 toolbar (top of the screen). The icon should be green, not red. Also check that “Allow live trading” is ticked in the EA properties (press F7 → Common tab).

I get “Trade context busy – try again”

Another EA on the same MT4 is currently executing a trade. MT4 only allows one trade operation at a time. Wait a moment and click Execute again.

Can I use this on multiple charts at the same time?

Yes. Each chart gets its own panel and calculations. The Magic Number input (default: 20260211) identifies this EA’s trades. If you want to track trades separately per chart, give each instance a different Magic Number in the Inputs tab.

Can I change the SL/TP multipliers?

Yes. Press F7 while the EA is on the chart, go to the Inputs tab. Change SL_ATR_Mult (default 0.5) and TP_ATR_Mult (default 3.0) to whatever you like. For example, SL_ATR_Mult = 1.0 gives a wider stop, TP_ATR_Mult = 2.0 gives a closer target.

Does this EA trade automatically?

No. This is a manual trade tool. It only opens trades when you click the Execute button. It does not scan for signals or trade on its own.

Why does the panel cover the candles?

The EA sets chart bars to draw behind panel objects so the panel text is readable. When you remove the EA from the chart, the original chart setting is restored. You can also drag the panel to a less obstructive position by clicking and dragging the title bar.

What pairs and instruments does this work on?

Any instrument available in your MT4: forex pairs, gold (XAUUSD), silver (XAGUSD), indices, etc. The ATR and lot calculations adapt automatically to any symbol’s tick value, point size, and lot specifications.


Risk Warning

Trading forex and CFDs involves substantial risk of loss. This tool helps with position sizing and trade execution but does not guarantee profits. Always trade with money you can afford to lose. Past performance is not indicative of future results. You are solely responsible for your trading decisions.