thinkorswim Stock Hacker
Why thinkorswim Hourly Scan Results Differ From the Chart
A scan and a chart can both say one hour while working from different sets of trades. Compare the bar boundaries and whether the condition uses the forming bar or the previous bar before changing the filter.
Quick Answer
Compare one stock and one Stock Hacker Study filter first. Match the filter’s aggregation and EXT setting to the chart, then check the start and end of the candle each view evaluates. A chart anchored to 9:30 a.m. can have a different most recent completed candle than a chart aligned to whole hours.
Match the Study filter’s aggregation and EXT settings
In Scan → Stock Hacker, use a small watchlist and confirm the symbol is in Scan in and outside any exclusion list. Test one Study filter first. Open that filter’s editor and verify its aggregation period. For an intraday filter, record whether EXT is checked. Check the same choices separately if the scan has multiple Study filters.
In Charts, open the exact stock symbol and match the intraday aggregation and extended-hours visibility. On an equity chart with extended hours hidden, check Start aggregations at market open. Schwab’s Stock Hacker documentation describes a separate limitation on that setting when extended hours are off in a Study filter. Compare against a chart aligned to whole hours and record the included bars before deciding which chart matches.
Test one completed hourly candle instead of a forming one
For a simple test during the middle of a regular session, choose Add filter → Study → Custom and enter the condition below in thinkScript Editor. Set the filter’s aggregation to one hour. The offset [1] reads one bar back. During the next populated hourly bar it lets you check the preceding completed bar. Use a threshold meaningful for your symbol. The 101.00 level belongs to the fictional example.
At 10:35 a.m. ET in the example, the clock-aligned series last closed at 10:00, and the market-open-aligned series last closed at 10:30. The same threshold gives two different results. Compare your live scan with the corresponding previous candle and record when you ran it. The table shows the chart arithmetic for the example.
plot scan = close[1] > 101.00;
Two completed candles at 10:35 a.m. ET| Chart alignment | Completed at | Close | Above 101? |
|---|
| Whole hour | 10:00 | 100.75 | No |
|---|
| Market open | 10:30 | 101.50 | Yes |
|---|
Why Stock Hacker can still show an earlier crossing
A crossing above 101.00 occurs when the current price is above 101.00 and the prior bar closed at or below it. A condition such as close > 101.00 stays true while price is above the level. In the example below, price is above 101.00 at 10:05 and 10:10, but it crosses only on the 10:05 bar.
To compare the lookbacks, set a Custom Study filter to five minutes. Paste the definition and pick one plot line. The other plot lines are commented out. To switch tests, move the comment marker so that exactly one plot is active.
def crossUp = close > 101.00 and close[1] <= 101.00;
plot scan = crossUp[1];
# plot scan = crossUp within 3 bars;
# plot scan = crossUp[1] within 3 bars;
Fictional five-minute bars and expected filter matches| Bar (ET) | Price | Prior bar | Latest 3 | Closed 3 |
|---|
| 10:00 | 100.00 | No | No | No |
|---|
| 10:05 | 101.25 | No | Yes | No |
|---|
| 10:10 | 101.50 | Yes | Yes | Yes |
|---|
| 10:15 | 100.75 | No | Yes | Yes |
|---|
| 10:20 | 100.50 | No | No | Yes |
|---|
| 10:25 | 100.25 | No | No | No |
|---|
Times label the start of each bar. Each row uses the displayed price as the current sample and assumes it also becomes that bar’s final close. No crossing occurred in the three bars before 10:00.
crossUp[1] checks the prior completed bar. It matches on the 10:10 bar only.crossUp within 3 bars includes the current bar. It matches from 10:05 through 10:15, then drops the crossing at 10:20. A forming bar can cross back below the level before it closes.crossUp[1] within 3 bars checks the last three completed bars. It first matches at 10:10 and drops the crossing at 10:25.
Check the filter when the candles agree
Rerun the scan and record the time. Confirm that a plain above-threshold condition and a crossing condition express the event you intend to find. A threshold can remain true for many bars. Look at any within clause or bar offset in the original filter, because it can refer to earlier candles.
Check the data requirements of the filter before testing a long lookback. Schwab publishes limits by aggregation for Stock Hacker study data. For custom filters, its documentation requires one plot and prohibits secondary aggregation inside a script. Add your remaining original filters back one at a time after the simple comparison agrees.
Sources
Official References
Platform details on this page were checked against these official resources.
Related Guides
Keep Building the Rule System
FAQ
Common Questions
Does a Stock Hacker Study filter inherit the chart’s timeframe?
Choose the aggregation and intraday EXT setting on the Study filter itself. Check those settings separately from the chart before comparing a result.
What does close[1] mean in a thinkorswim scan?
It reads the prior bar’s close on the filter’s selected aggregation. When a new bar is forming, it refers to the preceding completed bar.
Does thinkScript within 3 bars include the current bar?
Yes. It checks the current bar and the previous two. Apply a one-bar offset to the condition before within to check the previous three completed bars.
Risk Disclosure
Futures trading contains substantial risk and is not suitable for every investor. TradeReign is a trading-discipline and rule-enforcement application. It does not provide trading advice, trade signals, investment recommendations, or performance guarantees.
TradeReign is not a broker-dealer, futures commission merchant, or investment advisor.
Futures trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Only risk capital - money that can be lost without jeopardizing financial security or lifestyle - should be used for trading. Past performance is not necessarily indicative of future results.