OPEN-SOURCE SCRIPT

Close Earnings Warning by topefu

316
Close Earnings Warning

Displays a prominent warning label on the chart when the next earnings date is within your customizable threshold (default: 21 days).


Overview
This overlay indicator uses TradingView's built-in earnings.future_time to calculate days until the upcoming earnings release. A red label with "⚠ close earnings!" appears to the right of the last bar if the event is approaching, helping traders avoid positions near volatile announcements. Efficiently updates only on the last bar for performance.


Features

Adjustable days threshold (1-90 days) via input.

Automatic calculation using milliseconds timestamps.

Persistent, non-repainting label at high price level with white text on red background.

Handles cases with no upcoming earnings (no label shown)

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน