The GCM HASTRO indicator draws the RSI as Heikin Ashi candles and colours them from a separate fund flow engine. On one chart it reads quickly. On forty it does not, and the thing you are looking for is not a line crossing a level.
That is the case for screening it rather than clicking through a watchlist. A crossover screener asks one question. This one asks six at once and returns only the instruments where all six answer yes on the same bar.
A raw signal can start in one of two ways.
The candle flips. The HARSI body turns from bearish to bullish. Momentum changed sign on the oscillator’s own scale, which is not the same thing as price changing direction.
A ribbon boundary breaks. The HARSI close crosses up through 15 or through 75, the lower edges of the oversold and overbought ribbons. Set enableBreakouts to 0 if you want candle flips only.
Then the raw signal has to survive a stack of filters, each of which is a veto:
minWaveSize, 3.0 by default). Discards flips produced by a body so small the candle is barely a candle.filterFundFlow, on by default). The flow state machine has to be in one of its bullish states on the same bar: accumulation entry, weak rebound, or increasing.The fund flow filter is the one that gives the screener its character, and it is worth being explicit about why. The candle body measures what momentum did on this bar. The flow state measures what a much slower construction underneath is doing. On plenty of bars the two disagree, and those bars are interesting to look at on a chart but are exactly what you do not want cluttering a shortlist. Requiring both turns a candle-flip alarm into a confluence scan. Turn it off and the list gets long fast.
One caveat repeated from the indicator, because it matters just as much here: there is no order flow data behind the fund flow engine. It is a stochastic construction with a suggestive name, and it should be read as one.
Six columns come back with each hit.
lookback.Sorting by Wave descending puts the most decisive flips on top. Sorting by HARSI ascending puts the ones that fired lowest in the panel first, which is where the reversal setups live.
The two columns that earn their place beyond the obvious are HAST and Flow. A hit with Flow at 1 and HAST at 1 is momentum, accumulation and regime all pointing the same way. A hit with Flow at 2 and HAST at 0 is a weak rebound with no regime behind it. Both are legitimate returns of the same condition, and you would treat them very differently.
lenHARSI (10) and smoothLen (5) – the RSI length the candles are built from, and how much of the previous open survives into the new one. These two set the character of everything downstream. Keep them matched to whatever you run on the chart, or the list and the chart will not agree.
hastWickRatio (0.25) – the wick-to-body threshold that flips the trend regime. It only affects the HAST column here, never the condition.
enableBreakouts (1) – include ribbon breaks as signal starters, not just candle flips.
minWaveSize (3.0) – the noise floor. Raising it is the cheapest way to shorten a list that comes back too long.
filterFundFlow (1) – the strict filter described above. This is the main on/off switch for how selective the whole scan is.
filterRvol, filterAtr, filterZero, filterBuffer (all 0) – volume above its 20 period average, bar range above a fraction of the ATR, HARSI above the 50 line, and the buffer zone. Available, off by default.
lookback (0) – the signal window. At 0 you get only instruments whose signal fired on the last closed bar. Raise it to N and a signal counts if it fired within the last N bars, with Bars ago telling you when. Keep it small: the loop walks those N bars on every bar of every instrument in the universe, so this is the setting that drives the cost of the scan.
A reasonable first instinct when building a screener from an indicator is to keep the signal condition and throw the rest away. Here that produces a list that quietly disagrees with the chart, and it is worth understanding why before you trim anything.
Two pieces of the engine carry state from one bar to the next.
The HARSI open is a recursion. Each new open is five parts of the previous open and one part of the previous close. It has no closed form: the only way to arrive at today’s value is to walk every bar to get there.
The trend regime is a latch. It holds its last value until a candle closes with a wick on one side only, and then it flips. It does not average out or decay back to anything.
So the fund flow state machine, the full filter stack and the regime machine are all in the code below, unchanged from what the indicator runs. What has been removed is only the drawing: the colours, the plotted trend line, the status panel, the candles themselves. The divergence engine is also absent, on purpose, because it drives no signal in the indicator. It is an annotation layer measured on a separate RSI, and carrying it here would add two loops and a dozen persistent variables for a column that filters nothing.
ProScreener works on a fixed window: 1024 bars on Premium, 255 on Complete. Both state-carrying pieces above interact with that window, and they behave very differently.
The HARSI open converges, and quickly. Because each bar keeps five sixths of the previous value, any difference in where the recursion was seeded shrinks by that factor every bar. After 40 bars, 0.07% of it is left; after 100 there is nothing measurable. On either plan the HARSI values in the list will match the chart.
The trend regime does not converge. It is a latch, so on a freshly loaded window it can carry a stale regime until the first candle that closes with a wick on one side only. How many bars that takes depends entirely on the instrument.
The reassuring part is that this affects the HAST column and nothing else. The signal condition never reads the trend regime, so a stale HAST does not put anything on the list that should not be there, nor keep anything off it. Treat that one column as informational, and if it looks wrong, the chart is the one to trust.
As with any scan, the honest way to use this is as a shortlist generator rather than a verdict: run it, then open the handful of names it returns and look at them.
//---------------------------------------------------------------
//PRC_GCM HASTRO Screener
//version = 0
//24.08.26
//Iván González @ www.prorealcode.com
//Author: uniGram
//Sharing ProRealTime knowledge
//--------------------------------------------------------------------//
// Filters instruments where the buy signal of the PRC_GCM-HASTRO indicator
// (Heikin Ashi candles built on the RSI, by Unigram) has fired.
//
// The engine below is copied VERBATIM from the indicator: HARSI candles, Banker
// Fund Flow state machine, the full confluence filter stack and the wick-driven
// trend regime. Only the drawing is gone. Trimming the engine to "just the buy
// condition" would desynchronise the two: hrOpen is a recursion and hastTrend is
// a persistent state, so both need every bar of history to land on the same value
// as the chart.
//
// The divergence engine is NOT included: it drives no signal in the indicator.
// No DEFPARAM (not allowed in screeners).
//
// Output columns:
// HARSI the HARSI close, 0-100
// Flow fund flow state: 1 ENTRY, 2 W.REB, 3 EXIT, 4 DECR, 5 INCR, 0 NEUT
// HAST trend regime: 1 bullish, -1 bearish, 0 no read (wicks both sides)
// Wave size of the HARSI body that produced the signal
// Type 1 = HARSI candle flip, 2 = ribbon breakout
// Bars ago how many bars back the signal fired (0 = last bar)
//=== INPUTS: HARSI ===
lenHARSI = 10
smoothLen = 5
//=== INPUTS: HA Super Trend regime ===
hastWickRatio = 0.25
//=== INPUTS: confluence and breakout filters ===
// Same defaults as the indicator. filterFundFlow is the strict one.
enableBreakouts = 1
filterBuffer = 0
minWaveSize = 3.0
filterRvol = 0
filterAtr = 0
atrMult = 0.5
filterZero = 0
filterFundFlow = 1
//=== INPUTS: SCREENER ===
// 0 = only instruments whose signal fired on the very last bar.
// N = signal fired within the last N bars (sigAge column tells you when).
// Keep it small: the loop runs on every bar of every instrument in the universe.
lookback = 0
//=== Fixed ribbon levels ===
obLower = 75
midLine = 50
osUpper = 25
osLower = 15
//-------------------------------------------------------------//
//--- HARSI: Heikin Ashi candles built on the RSI ---
//-------------------------------------------------------------//
closeRSI = rsi[lenHARSI](close)
if barindex = 0 then
openRSI = closeRSI
else
openRSI = closeRSI[1]
endif
hiRaw = rsi[lenHARSI](high)
loRaw = rsi[lenHARSI](low)
highRSI = max(hiRaw, loRaw)
lowRSI = min(hiRaw, loRaw)
closeVal = (openRSI + highRSI + lowRSI + closeRSI) / 4
// Seed the open through the whole RSI warm-up: a single undefined
// value inside the recursion would poison it for the entire history
warmHARSI = lenHARSI + smoothLen + 1
if barindex <= warmHARSI then
hrOpen = (openRSI + closeRSI) / 2
else
hrOpen = ((hrOpen[1] * smoothLen) + closeVal[1]) / (smoothLen + 1)
endif
hrClose = closeVal
hrHigh = max(highRSI, max(hrOpen, hrClose))
hrLow = min(lowRSI, min(hrOpen, hrClose))
if hrClose >= hrOpen then
isHaUp = 1
else
isHaUp = 0
endif
//-------------------------------------------------------------//
//--- Banker Fund Flow ---
//-------------------------------------------------------------//
tpFF = (2 * close + high + low + open) / 5
ll34 = lowest[34](low)
hh34 = highest[34](high)
ll27 = lowest[27](low)
hh27 = highest[27](high)
rng27 = hh27 - ll27
if rng27 > 0 then
stoch27 = (close - ll27) / rng27 * 100
else
stoch27 = 50
endif
// the original's "weighted simple average" with weight = 1 is a Wilder average
wsa1 = average[5,3](stoch27)
wsa2 = average[3,3](wsa1)
fft = (3 * wsa1 - 2 * wsa2 - 50) * 1.032 + 50
rng34 = hh34 - ll34
if rng34 > 0 then
bblSrc = (tpFF - ll34) / rng34 * 100
else
bblSrc = 50
endif
bbl = average[13,1](bblSrc)
if fft crosses over bbl and bbl < 25 then
bes = 1
else
bes = 0
endif
// the original's findRecentValue(fft*0.95, 1) always returns the previous bar
fftRef = fft[1] * 0.95
// 1 ENTRY / 2 W.REB / 3 EXIT / 4 DECR / 5 INCR / 0 NEUT
if bes = 1 then
ffState = 1
elsif fft < bbl and fft > fftRef then
ffState = 2
elsif fft < bbl then
ffState = 3
elsif fft < fftRef then
ffState = 4
elsif fft > bbl then
ffState = 5
else
ffState = 0
endif
if ffState = 1 or ffState = 2 or ffState = 5 then
isFFBull = 1
else
isFFBull = 0
endif
//-------------------------------------------------------------//
//--- Confluence filters ---
//-------------------------------------------------------------//
waveSize = abs(hrClose - hrOpen)
if waveSize >= minWaveSize then
waveOk = 1
else
waveOk = 0
endif
// kept literal from the original: the OR collapses this to hrClose < midLine
if filterBuffer = 0 or hrClose <= osUpper or hrClose < midLine then
buyZoneOk = 1
else
buyZoneOk = 0
endif
volSma = average[20](volume)
if filterRvol = 0 or volume > volSma then
volOk = 1
else
volOk = 0
endif
atrVal = averagetruerange[14](close)
barSpan = high - low
if filterAtr = 0 or barSpan >= atrVal * atrMult then
atrOk = 1
else
atrOk = 0
endif
if filterZero = 0 or hrClose > midLine then
zeroBuyOk = 1
else
zeroBuyOk = 0
endif
if filterFundFlow = 0 or isFFBull = 1 then
ffBuyOk = 1
else
ffBuyOk = 0
endif
//-------------------------------------------------------------//
//--- Signals ---
//-------------------------------------------------------------//
if isHaUp[1] = 0 and isHaUp = 1 then
baseBuy = 1
else
baseBuy = 0
endif
if hrClose crosses over osLower or hrClose crosses over obLower then
bullBrk = 1
else
bullBrk = 0
endif
if baseBuy = 1 or (enableBreakouts = 1 and bullBrk = 1) then
rawBuy = 1
else
rawBuy = 0
endif
// the barindex guard keeps signals off the HARSI warm-up
if barindex > warmHARSI + 1 and rawBuy = 1 and waveOk = 1 and buyZoneOk = 1 and volOk = 1 and atrOk = 1 and zeroBuyOk = 1 and ffBuyOk = 1 then
buySignal = 1
else
buySignal = 0
endif
//-------------------------------------------------------------//
//--- HA Super Trend: the regime switches on wick geometry ---
//-------------------------------------------------------------//
haBody = abs(hrClose - hrOpen)
haLowWick = min(hrOpen, hrClose) - hrLow
haUpWick = hrHigh - max(hrOpen, hrClose)
if hrClose >= hrOpen and (haLowWick <= haBody * hastWickRatio or haBody = 0) then
bullNoWick = 1
else
bullNoWick = 0
endif
if hrClose < hrOpen and (haUpWick <= haBody * hastWickRatio or haBody = 0) then
bearNoWick = 1
else
bearNoWick = 0
endif
once hastTrend = 1
if bullNoWick = 1 then
hastTrend = 1
elsif bearNoWick = 1 then
hastTrend = -1
endif
//-------------------------------------------------------------//
//--- HA Super Trend: three-way read for the output column ---
//--- 1 bullish / -1 bearish / 0 indefinite (wicks both sides,
//--- which is where the indicator greys the line out)
//-------------------------------------------------------------//
if bullNoWick = 0 and bearNoWick = 0 then
hastRead = 0
else
hastRead = hastTrend
endif
//-------------------------------------------------------------//
//--- Most recent buy signal inside the lookback window ---
//-------------------------------------------------------------//
sigFound = 0
sigAge = 0
sigKind = 0
for kk = 0 to lookback do
if sigFound = 0 and buySignal[kk] = 1 then
sigFound = 1
sigAge = kk
// 1 = HARSI candle flip, 2 = ribbon breakout
if baseBuy[kk] = 1 then
sigKind = 1
else
sigKind = 2
endif
endif
next
hrShow = round(hrClose * 10) / 10
waveShow = round(waveSize * 10) / 10
SCREENER[sigFound = 1](hrShow AS "HARSI", ffState AS "Flow", hastRead AS "HAST", waveShow AS "Wave", sigKind AS "Type", sigAge AS "Bars ago")
The signal this screener returns is a confluence, not a crossover, and that is the whole reason to run it across a universe instead of reading charts one at a time. The default settings are deliberately strict, with the fund flow filter doing most of that work. If the list comes back empty on a quiet day, that is the filter behaving as intended rather than a fault. If it comes back too long, raise minWaveSize before you touch anything else.
Run it, sort by Wave or by HARSI, and open the top few on a chart with the indicator applied. The triangle should be sitting on the bar the Bars ago column points at.