OPEN-SOURCE SCRIPT
更新済

MAO Calc. & Trend

2 759
MAO Calc. & Trend is an all-in-one trading tool designed exclusively for XAU/USD (Gold) traders. It combines a smart position size calculator, a multi-timeframe trend tracker, and an average entry price manager — all displayed in a clean, fully customizable on-chart table.
🔢 Position Calculator
Automatically calculates your recommended lot size based on your account balance, leverage, and risk percentage. Displays position value in USD and breaks down the lot size into 1/5 portions for staged entries.
📊 Multi-Timeframe Trend Analysis
Manually tag market direction across 5 key timeframes — 5M, 1H, 4H, 1D, and 1W — as Bullish, Ranging, or Bearish. Each status is color-coded (green / orange / red) for instant visual clarity.
📌 Position Averaging & Breakeven
Enter up to 5 Buy and 5 Sell positions with their prices and lot sizes. The indicator automatically calculates:

Buy & Sell average entry prices
Total lots and total position value
A combined Breakeven (BE) price with a persistent horizontal ray plotted directly on the chart
リリースノート
MAO Calculator — Multi-Instrument Break-Even & Position Sizing Tool
A professional all-in-one trading calculator that works across 22 instruments including Metals, Forex, Crypto, Commodities and Indices.
⚡ Auto-detects the instrument from your chart — switch charts and the calculator updates instantly. No manual selection needed.

What it calculates:
🟢 Position Sizing — Enter your balance, leverage and risk % and the calculator gives you the recommended lot size based on your stop loss distance. No guessing.
📐 Break-Even Price — Add up to 5 Buy entries and 5 Sell entries with their lot sizes. The calculator finds the exact price where your combined position breaks even.
💰 Live PnL — See unrealised profit and loss for your Buy side, Sell side and total position updating in real time with every candle.
📏 Chart Rays — Visual lines drawn directly on the chart showing your Buy average, Sell average and Break-Even price with labels.

Supported Instruments:
GOLD · SILVER · PLATINUM · PALLADIUM · EURUSD · GBPUSD · USDJPY · USDCHF · AUDUSD · USDCAD · NZDUSD · BTCUSD · ETHUSD · CRUDE OIL · NASDAQ 100 · S&P 500 · DOW JONES · VIX · FTSE 100 · NIKKEI 225 · DAX 40 · HANG SENG

How to use:

Add to any supported chart — instrument is detected automatically
Set your Balance, Leverage, Risk % and Stop Loss pips
Enter your open Buy and/or Sell positions with lot sizes
Read your Break-Even price, recommended lot size and live PnL from the table


Built for active traders who manage multiple entries and need precise position management at a glance.

You can also add your name or brand at the bottom like:

Developed by MAO | Free to use
リリースノート
MAO Calculator v4 — Multi-Instrument Break-Even, Position Sizing & Risk Manager
A professional all-in-one trading calculator built for active traders who manage multiple entries across different instruments. Works directly on your TradingView chart with zero setup.

⚡ Smart Auto-Detection
Switches instruments automatically when you change charts. Supports 22 instruments across Metals, Forex, Crypto, Commodities and Indices. Manual override available when needed.

📐 Position Sizing

MAX LOTS — maximum position based on your balance and leverage
RISK LOTS — safe lot size based on your risk % and stop loss distance
Stop Loss input supports both Pips/Points and Percentage % modes
Used Leverage — shows your real leverage based on actual open position, not account maximum
Traded Value $ — dollar value of your actual open lots, not theoretical maximum


📊 Position Manager

Up to 5 Buy and 5 Sell entries with lot sizes
Correct weighted average price for each side
Live unrealised PnL for Buy, Sell and Total — updates every candle
Correct Break-Even formula — shows — when perfectly hedged (equal lots both sides)
Net direction — NET LONG / NET SHORT / HEDGED with exact lot count


📏 Chart Rays

Buy average ray — shows average price, lots and live PnL
Sell average ray — shows average price, lots and live PnL
Break-Even ray — shows BE price, total lots and combined PnL
SL Ray — click directly on chart to place. Shows profit or loss in $ with correct sign based on your position direction
TP Ray — click directly on chart to place. Shows profit or loss in $ with correct sign
Ray labels automatically turn green or red depending on whether the level is in profit or loss zone


Supported Instruments:
GOLD · SILVER · PLATINUM · PALLADIUM · EURUSD · GBPUSD · USDJPY · USDCHF · AUDUSD · USDCAD · NZDUSD · BTCUSD · ETHUSD · CRUDE OIL · NASDAQ 100 · S&P 500 · DOW JONES · VIX · FTSE 100 · NIKKEI 225 · DAX 40 · HANG SENG

How to use:

Add to any supported chart — instrument detected automatically
Set Balance, Leverage, Risk % and Stop Loss
Enter your open Buy and/or Sell positions with lot sizes
Click on the chart to place your SL and TP levels
Read everything from the table and chart rays in real time


Developed by MAO | Free to use
リリースノート
DJ30 added to the manual override dropdown
DJ30 added to the detection function (maps to US30 DOW specs)
DJ30 added to all three spec switches (cSize, tSize, tVal)
Row 12 replaced — now shows Contract Size, Tick Size, Tick Value, and Pip Value instead of the chart ticker

免責事項

これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。