OPEN-SOURCE SCRIPT

measure last swing [keypoems]

MEASURE LAST SWING [KEYPOEMS]
Version: v0.0.7

An indicator for measuring market swings and calculating position sizing based on pivot points and risk parameters. Helps traders visualize price swings and automatically compute position sizes based on their desired risk amount.

FEATURES:
• Identifies and tracks last pivot point in price action
• Displays visual measurements of price swing
• Calculates position sizes based on risk parameters
• Supports major futures contracts with automatic multiplier detection

HOW IT WORKS:
The indicator detects pivot highs and lows using your specified pivot strength, then draws measurement lines and calculates position sizes based on your risk parameters. It automatically cleans up old drawings when new pivot points are identified.

INPUT PARAMETERS:

General Settings:
• Risk Amount - Amount you want to risk per trade
• Pivot Strength - Bars required on either side to confirm a pivot
• Offset - Number of bars to offset the vertical line

Visual Settings:
• Horizontal and Vertical Lines - Customizable colors, widths (1-4), and styles
• Labels - Adjustable text color and size

CONTRACT MULTIPLIERS:
Automatically detects and applies the correct multiplier:
• ES (E-mini S&P 500): 50.0
• MES (Micro E-mini S&P 500): 5.0
• NQ (E-mini Nasdaq): 20.0
• MNQ (Micro E-mini Nasdaq): 2.0
• YM (E-mini Dow): 5.0
• MYM (Micro E-mini Dow): 0.5
• Other symbols: 1.0 (default)

DISPLAY ELEMENTS:
1. Horizontal line showing the level of the last pivot point
2. Vertical line measuring the distance to current price
3. Distance label showing point distance
4. Risk/Position label showing risk amount and calculated position size

POSITION SIZING:
Position Size = Floor(Risk Amount / (Distance in Points × Contract Multiplier))

IDEAL FOR:
• Measuring price swings for technical analysis
• Position sizing based on risk management rules
• Identifying potential entry and exit points
• Visual analysis of market structure
• Risk management automation
Pivot points and levelsriskmangement

開源腳本

在真正的TradingView精神中,這個腳本的作者以開源的方式發佈,這樣交易員可以理解和驗證它。請向作者致敬!您可以免費使用它,但在出版物中再次使用這段程式碼將受到網站規則的約束。 您可以收藏它以在圖表上使用。

想在圖表上使用此腳本?


更多:

免責聲明