OPEN-SOURCE SCRIPT
Sweep & Reject Pin Bars

Marks candles that push beyond the previous bar's extreme, then close back at the opposite end of their own range — a sweep followed by immediate rejection within a single bar.
A bullish signal requires the low to break below the previous low, a lower wick at least twice the body, and a close at or near the high. The bearish signal is the mirror image.
Three inputs let you adapt it to any instrument. Close tolerance sets how far the close may sit from the extreme, expressed in ticks — set it to 0 for an exact match, or raise it on instruments where a perfect close is rare. Max body/wick ratio controls how dominant the wick must be; lower values are stricter. Min body size filters out doji, whose near-zero body would otherwise satisfy the ratio test.
Note that tick-based inputs scale differently across instruments: 20 ticks is 2 pips on a 5-digit FX pair but a very different distance on indices or metals. Adjust after switching markets.
The script marks bar patterns only. It does not account for context, trend, or level confluence, and it is not a trading system on its own.
A bullish signal requires the low to break below the previous low, a lower wick at least twice the body, and a close at or near the high. The bearish signal is the mirror image.
Three inputs let you adapt it to any instrument. Close tolerance sets how far the close may sit from the extreme, expressed in ticks — set it to 0 for an exact match, or raise it on instruments where a perfect close is rare. Max body/wick ratio controls how dominant the wick must be; lower values are stricter. Min body size filters out doji, whose near-zero body would otherwise satisfy the ratio test.
Note that tick-based inputs scale differently across instruments: 20 ticks is 2 pips on a 5-digit FX pair but a very different distance on indices or metals. Adjust after switching markets.
The script marks bar patterns only. It does not account for context, trend, or level confluence, and it is not a trading system on its own.
สคริปต์แบบโอเพนซอร์ส
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์แบบโอเพนซอร์ส
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน