Fix Pine Script Alerts

Job ID: 40406373

Budget: ₹1,500 – ₹12,500 INR

My TradingView strategy looks solid on the chart, yet the live strategy alerts are unreliable—sometimes sending “ghost” orders that never existed in the back-test, other times skipping real ones. All of my entries and exits fire through the `strategy.*` alert method, so the mismatch throws off my automated execution.

The logic mixes indicator signals with a few custom price-level checks (dynamic support-and-resistance, not basic day’s High/Low). Whenever those custom levels are touched, the alert discrepancies are most obvious. I suspect the problem sits in one or more of these areas:

• improper `bar_index` reference or `recalculates_on_close` timing
• look-ahead or repaint behaviour in the indicator block
• mis-aligned `strategy.entry`, `strategy.exit`, and alert() conditions versus the plot shapes that visually confirm the trade

I need a Pine coder who can:

1. audit the current v6 script line-by-line, identify why the generated strategy orders diverge from the displayed orders,
2. correct the logic so every order visible on the chart is exactly what fires through the single “strategy alert”, and
3. return a clean, commented file plus a short note of changes so I can keep maintaining it.

I’ll provide the full script, sample alert messages, and a quick replay scenario that reliably shows the mismatch. A successful hand-off means I can run the script live for 24 hours with no extra or missing alerts compared with the on-chart trades.