TradingView Position/Lot Size calculator Enhancement

Job ID: 39957107

Budget: $30 – $31 USD

I have a working Position/Lot Size calculator written in Pine Script on TradingView. Right now the script assumes a fixed risk figure; I want to make that risk percentage user-configurable.

Scope
• Add a new manual-entry input field that lets the trader type the exact % of account equity they wish to risk on the trade (e.g., 0.5, 1, 2).
• Integrate this field into the existing position-size formula so the lot size updates instantly when the value changes.
• Keep all current inputs and outputs untouched—this is purely an extra “Risk %” parameter.
• The script should validate obvious edge cases (blank entry, negative numbers, unrealistically high values) and fall back to a sensible default if needed.

Tech stack
TradingView Pine Script (v4 or v5—use whichever is already in the file; the code header shows the version).

Deliverable
An updated .pine file that drops straight into my chart, plus a brief comment block explaining the new section so I can maintain it later.

If you have questions about the current formula, let me know and I’ll paste the relevant snippet.