OPEN-SOURCE SCRIPT
Cập nhật Pip Crosshairs

This is a simple tool designed to help you visualize your stop loss and take profit levels before entering a trade. The tool plots two lines on the chart - a green dotted line for take profit and a red dotted line for stop loss (similar to the price line) - with a simulated default spread of one pip factored in. The indicator has the option to toggle between long and short positions.
Please note that the spread used in the tool is not based on your actual spread and should be adjusted accordingly. As, to the best of my knowledge Pine Script does not have the ability to automatically include spread in an indicator, so you will need to input your spread manually. (if you can please let me know cause that would be a game changer).
Overall, should help save you a bit of time by not having to manually measure stop loss and take profit levels for each trade.
Happy hunting :)
Please note that the spread used in the tool is not based on your actual spread and should be adjusted accordingly. As, to the best of my knowledge Pine Script does not have the ability to automatically include spread in an indicator, so you will need to input your spread manually. (if you can please let me know cause that would be a game changer).
Overall, should help save you a bit of time by not having to manually measure stop loss and take profit levels for each trade.
Happy hunting :)
Phát hành các Ghi chú
corrected short position scripting to correctly include spread :) Phát hành các Ghi chú
for some reason didnt update. short spread calculation fixed now :) Phát hành các Ghi chú
A precision trading tool that displays dynamic Take Profit and Stop Loss levels on your chart. Lines automatically stop drawing when price touches them (break-on-touch), giving you a clean visual of untested levels. Perfect for scalping and day trading with customizable pip or percentage-based targets.What's New (vs Original v4 Script):
Pine Script version: v4 → v6
TP/SL calculation: Pips only → Pips or Percentage toggle
Lines on scale: Always on → Toggle on/off (default off)
Line length: Infinite with offset hack → Customizable bars back/forward
Break-on-touch: Added - Lines stop at price contact
Extend lines option: Added - Toggle for infinite lines
Line thickness: Fixed → Adjustable 1-4
Line style: Fixed → Solid/Dashed/Dotted per line
Entry line: Added - Optional with own styling
Timeframe filter: Added - Show only on specific TF
Labels: Basic → Customizable (name/price/distance toggles)
Risk/Reward table: Added - Optional info panel
Alerts: Added - TP/SL hit alerts
Color transparency: Hardcoded → Full control
Key Features:
Break-on-touch technology — lines only draw from where price last touched them
Dual mode — switch between pips and percentage for any instrument
Timeframe visibility — show indicator only on specific timeframes
Clean chart option — keep prices off the scale by default
Fully customizable labels — show exactly what you need
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.