Join our fan page
- Views:
- 86
- Rating:
- Published:
-
Need a robot or indicator based on this code? Order it on Freelance Go to Freelance
Run the script on the chart of the symbol you plan to trade, enter how much you are willing to risk - a percent of equity or a fixed amount in your account currency - and your stop-loss distance, either in points or as a concrete price level, and it returns the lot size.
The calculation uses the symbol's real contract specification: tick size and tick value for the money-per-point math, and volume min/max/step for normalization. The result is rounded DOWN to the volume step, so the actual risk never exceeds your budget; the script reports the exact risk at the normalized size. It also estimates the required margin for the planned direction via OrderCalcMargin and warns clearly when the position would exceed your free margin, when the calculated size falls below the symbol minimum (i.e. even the minimum lot risks more than your budget), or when it must be capped at the symbol maximum.
The full report is printed to the chart Comment, the Experts journal, and a one-line Alert. Works on forex pairs, metals, indices and any symbol with valid contract specifications. It calculates only - it never places orders.

Spread Monitor Panel - live spread with spike alerts
On-chart panel with the live spread of the chart symbol - current, minimum, average and maximum since attach - color-coded against your warning and danger thresholds, plus an optional alert when the spread stays at the danger level for N consecutive seconds (news and rollover spikes).
Prop Firm Risk Dashboard - daily loss and drawdown monitor
A read-only on-chart panel that tracks your account against a daily-loss limit and a max-drawdown limit, with color-coded OK / WARNING / DANGER status. Monitoring only - it does not place, modify or close any orders.
Trade Journal Exporter - closed positions to CSV
Exports your closed positions for a configurable period to a CSV file for journal analysis in Excel or Google Sheets: entry and exit time and price (volume-weighted over partial fills), volume, result in points, commission, swap, net profit and trade duration.
Market Structure SMC: Swings, BOS/CHoCH, Order Blocks, FVG, QML
SMC/ICT market-structure indicator for MT5: swing highs/lows, BOS (continuation) and CHoCH (reversal) confirmed on close, Order Blocks, Fair Value Gaps, and QML (Quasimodo) levels. Every feature is toggle-able, with adjustable swing sensitivity and colors. Works on any symbol and timeframe.