OPEN-SOURCE SCRIPT
Larry Williams Bonus Track Pattern

This strategy trades the day immediately following an Inside Day, under specific directional and timing conditions. It is designed for daily-based setups but executed on intraday charts to ensure orders are placed exactly at the open of the following day, rather than at the daily bar close.
Entry Conditions
On the following day (t):
Exit Rules
Notes
The script must be applied on an intraday timeframe (e.g., 15-minute or 1-hour) so that the strategy can:
Entry Conditions
- Only trades on Monday, Thursday, or Friday.
- The previous day must be an Inside Day (its high is lower than the prior high and its low is higher than the prior low).
- The bar before the Inside Day must be bullish (close > open).
On the following day (t):
- The daily open must be below both the Inside Day’s high and the highest high of the two days before that.
- A buy stop is placed at the highest high of the three previous days (Inside Day and the two days before it).
- If the new day’s open is already above that level (gap up), the strategy enters long immediately at the open.
Exit Rules
- Stop Loss: Fixed, defined in points or percentage (user input).
- FPO (First Profitable Open): the position is closed at the first daily open after the entry day where the open price is above the average entry price (the first profitable open).
Notes
The script must be applied on an intraday timeframe (e.g., 15-minute or 1-hour) so that the strategy can:
- Detect the Inside Day pattern using daily data (request.security).
- Execute orders in real time at the next day’s open.
- Running it directly on the daily timeframe will delay executions by one bar due to Pine Script’s evaluation model.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.