Small tweaks in RSI divergence pine script code

Job ID: 40566626

Budget: ₹600 – ₹1,000 INR

I already have a working Pine Script built around RSI divergence. All the core logic for swing detection and basic pin-bar recognition is in place; I only need a few concise upgrades. The task may require maximum 20-30 minutes.

1. Always-visible swing lengths
• Display the total length of both the first swing and its retracement directly on the chart.
• No visibility toggle is required—these numbers should stay on-screen at all times.

2. Trade-specific retracement filter
• In the script’s Input section I need separate minimum and maximum retracement-ratio fields for each trade category (e.g., long vs short).
• The ratio is defined as retracement / first swing, and trades should be validated only when the user-defined bounds are respected.

3. Refined pin-bar rules
• For a bullish pin bar the open must be above 40 % of the full candle range and the close above 25 %.
• For a bearish pin bar apply the exact same percentages in the opposite direction.

Please integrate these conditions cleanly into the existing codebase (Pine Script v5), comment any new blocks, and keep all previous functionality intact. A brief note explaining where and how the changes were inserted will complete the job.
Related categories: Pine Script Trading