PulseHub
OPEN-SOURCE SCRIPT
Updated

TSF Risk Manager

1 211
TSF Risk Manager

═══════════════════════════════════════ ENGLISH ═══════════════════════════════════════

OVERVIEW A visual position-size and risk calculator. Mark your entry and stop-loss on the chart and it instantly computes the exact lot size for your chosen account risk, draws the full trade (entry, stop, take-profits) and shows the REAL risk in your account currency.

Important: PulseWire / Pine cannot access your broker account or place orders. This is a calculator and visual planner — you enter your account size and risk %, and it does the math. It does not execute trades.

WHAT IT DOES

Click-to-place entry and stop-loss directly on the chart.
Calculates position size (lots) for your target risk %, rounded DOWN to your broker's lot step so you never exceed the intended risk.
Shows the REAL risk of the rounded lot (in money and %), so what you see is what you actually risk — not just the target.
Warns when your account size and stop distance don't allow the target risk (i.e., when the broker's minimum lot already risks more than your %).
Draws the trade: entry, stop and three take-profit levels at configurable R multiples, with a green reward zone and a red risk zone.
Detects direction (long / short) automatically from where the stop is placed.

HOW IT WORKS

Risk amount = account balance × risk %.
Lot size = risk amount ÷ (stop distance × value-per-1.00-move-per-lot), floored to the broker's lot step.
The "Value of 1.00 move per lot" must match your instrument. For XAUUSD (gold) it is 100 (1 standard lot = 100 oz, so a 1.00 price move = $100 per lot). Adjust it for other instruments / brokers.

HOW TO USE

Add the indicator; when prompted, click your entry and then your stop-loss on the chart.
In the settings, set your account size, risk %, and the value-per-point for your instrument (100 for gold).
Read the lot size and the real risk in the panel; the trade is drawn on the chart.
To plan another trade without deleting the current one, simply add the indicator again.

USER-INTERFACE TEXT (English translation) The panel and labels are written in Spanish. English meaning:

"TSF RISK" = panel title · "COMPRA" = Buy (long) · "VENTA" = Sell (short).
"Capital" = Account balance · "Riesgo objetivo" = Target risk · "Distancia SL" = Stop distance.
"LOTAJE" = Lot size · "Riesgo real" = Actual risk · "Estado" = Status.
"⚠ Mín 0.01 = X% del capital" = Warning: the broker's minimum lot risks X% of the account.
"✔ Riesgo bajo control" = Risk under control · "marcá entrada y stop" = mark entry and stop.
"TP1 / TP2 / TP3 (R)" = take-profit levels at R multiples · "Trading Sin Fronteras" = the author's brand.

This script is open-source. Feel free to study it, learn from it and adapt it.

═══════════════════════════════════════ ESPAÑOL ═══════════════════════════════════════

Calculadora visual de gestión de riesgo y tamaño de posición. Marcás tu entrada y tu stop en el gráfico y te calcula al instante el lotaje exacto para el riesgo que elegiste, dibuja la operación completa (entrada, stop, take-profits) y te muestra el riesgo REAL en el dinero de tu cuenta.

Importante: PulseWire no accede a tu cuenta del broker ni ejecuta órdenes. Esto es una calculadora y planificador visual — vos cargás tu capital y tu % de riesgo, y hace el cálculo. No opera por vos.

QUÉ HACE

Marcás entrada y stop con un clic en el gráfico.
Calcula el lotaje para tu % de riesgo, redondeado HACIA ABAJO al mínimo de tu broker para que nunca te pases del riesgo objetivo.
Muestra el riesgo REAL del lote redondeado (en $ y en %), así lo que ves es lo que de verdad arriesgás.
Te avisa cuando tu capital y tu stop no permiten el riesgo objetivo (cuando el lote mínimo del broker ya arriesga más que tu %).
Dibuja la operación: entrada, stop y tres take-profits en múltiplos de R, con zona verde de beneficio y roja de riesgo.
Detecta la dirección (compra / venta) según dónde pongas el stop.

CÓMO USARLO Agregá el indicador y, cuando lo pida, hacé clic en tu entrada y luego en tu stop. En los ajustes cargá tu capital, tu % de riesgo y el "valor de 1.00 por lote" de tu instrumento (100 para el oro). Leé el lotaje y el riesgo real en el panel. Para planificar otra operación sin borrar la anterior, agregá el indicador de nuevo.

Script de código abierto — Trading Sin Fronteras.
Release Notes
What's new:
- Two box modes: "marked candle" (to simulate a trade on the chart) and "waiting" (to project a pending entry forward).
- Lot size now rounds down to the broker's lot step, shows real risk, and warns when the account/stop don't allow the target risk.
Release Notes
Name
Release Notes
What's new:
- Automatic instrument detection — the lot size is now calculated correctly on any asset (gold, forex, etc.) with no manual setup.
- Two box modes: "Marked candle" (to simulate a trade on the chart) and "Waiting" (to project a pending entry forward).
- Stop distance now shown in pips (forex) or points (metals).
- Panel now displays the detected instrument and its value per lot.
- Lot size rounds down to the broker's lot step, shows the real risk, and warns when the account/stop don't allow the target risk.

Novedades:
- Detección automática del instrumento — el lotaje se calcula bien en cualquier activo (oro, forex, etc.) sin configurar nada.
- Dos modos de caja: "Vela marcada" (simular una operación) y "En espera" (proyectar una entrada pendiente).
- La distancia del stop ahora se muestra en pips (forex) o puntos (metales).
- El panel muestra el instrumento detectado y su valor por lote.
- El lotaje se redondea al mínimo del broker, muestra el riesgo real y avisa si la cuenta/stop no permiten el riesgo.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by PulseWire. Read more in the Terms of Use.