Added recentBullishOB and recentBearishOB conditions that check if the order block occurred within the last 24 hours using timenow - time <= 86400000 (24 hours in milliseconds).
Modified all trade execution logic and line drawing to use these recent conditions instead of the original order block conditions.
Maintained original plotting of all order blocks (including older ones) using the unfiltered bullishOB and bearishOB variables.
This modification ensures that:
All order blocks are still visually marked on the chart
Trading levels are only calculated for recent order blocks
Trades are only executed on order blocks created within the last 24 hours
Support/resistance lines are only drawn for recent order blocks
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.