OPEN-SOURCE SCRIPT
Sniper Entry 2.1

📌 Overview
This script is designed to calculate precise entry levels for long and short trades based on a combination of percentage offsets from the open price and ATR-based volatility filters. It dynamically adjusts stop-loss width and snaps levels to logical increments, then plots them on the chart with labels and dotted lines.
⚙️ Key Components
Inputs
Offset % from Open: Defines how far above/below the open price to set levels.
Label Offset: Controls how many bars forward labels/lines are drawn.
ATR Multiplier & ATR Length: Used to calculate volatility-adjusted stop-loss width.
Base Calculations
Computes upper and lower bounds around the open price using both percentage offset and ATR.
Chooses the larger of the two (percent vs ATR) to ensure realistic stop-loss sizing.
Builds symmetric levels around the open.
Dynamic Step Size
Adjusts snapping increments based on the raw stop-loss width.
Example: Small ranges snap to 0.01 or 0.05, larger ranges snap to 1, 5, 10, etc.
This prevents clutter and ensures levels align with meaningful price ticks.
Snapped Levels
longEntry: Rounded up to the nearest step above the open.
shortEntry: Rounded down to the nearest step below the open.
finalSL: The effective stop-loss width between these two levels.
Chart Drawing
Deletes old labels/lines to keep the chart clean.
Plots dotted horizontal lines for long and short entries.
Labels them with price values (green for long, red for short).
🎯 Purpose
This script helps traders quickly identify balanced entry levels that adapt to volatility. By combining percentage offsets with ATR, it avoids overly tight or unrealistic stops. The snapping logic ensures levels are practical for execution.
This script is designed to calculate precise entry levels for long and short trades based on a combination of percentage offsets from the open price and ATR-based volatility filters. It dynamically adjusts stop-loss width and snaps levels to logical increments, then plots them on the chart with labels and dotted lines.
⚙️ Key Components
Inputs
Offset % from Open: Defines how far above/below the open price to set levels.
Label Offset: Controls how many bars forward labels/lines are drawn.
ATR Multiplier & ATR Length: Used to calculate volatility-adjusted stop-loss width.
Base Calculations
Computes upper and lower bounds around the open price using both percentage offset and ATR.
Chooses the larger of the two (percent vs ATR) to ensure realistic stop-loss sizing.
Builds symmetric levels around the open.
Dynamic Step Size
Adjusts snapping increments based on the raw stop-loss width.
Example: Small ranges snap to 0.01 or 0.05, larger ranges snap to 1, 5, 10, etc.
This prevents clutter and ensures levels align with meaningful price ticks.
Snapped Levels
longEntry: Rounded up to the nearest step above the open.
shortEntry: Rounded down to the nearest step below the open.
finalSL: The effective stop-loss width between these two levels.
Chart Drawing
Deletes old labels/lines to keep the chart clean.
Plots dotted horizontal lines for long and short entries.
Labels them with price values (green for long, red for short).
🎯 Purpose
This script helps traders quickly identify balanced entry levels that adapt to volatility. By combining percentage offsets with ATR, it avoids overly tight or unrealistic stops. The snapping logic ensures levels are practical for execution.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.