Appearance

Personalize your experience

Mode
Accent Color
Direction
All Docs/QuaScript//
QuaScript logo

QuaScript Documentation

Language guide, engine API, 601 builtins and the preset library · v3.0.0-phase1

Fundamentals and flows

FII / DII Flows

analysis · presets/analysis/financial/fii_dii_flows.qs

Institutional cash-market flows. Needs the host fundamentals columns fiinet / diinet; without them the values are na and the engine reports WHOSTDATA once.

QuaScriptengine result
Loading the engine result…
quatick-charts · QuaScript engine on synthetic 1-minute bars · drag to pan · scroll to zoom · Run executes the script on the engine (⌘/Ctrl+Enter while editing)
fii_dii_flows.qs
analysis "FII / DII Flows" {
    overlay = false
}
// Institutional cash-market flows. Needs the host fundamentals columns fii_net / dii_net;
// without them the values are na and the engine reports W_HOST_DATA once.
smooth = param.int(5, title = "Smoothing", min = 1, max = 50)
fii = ta.ema(financial.fii_net, smooth)
dii = ta.ema(financial.dii_net, smooth)

render.histogram(fii, "FII net", color = fii >= 0 ? color.emerald.500 : color.rose.500)
render.line(dii, "DII net", color = color.blue.500, width = 2)
render.level(0, "Zero", color = color.slate.500)
render.mark(fii > 0 and dii > 0 and not (fii[1] > 0 and dii[1] > 0), shape = shape.arrow_up, at = anchor.below_bar, color = color.emerald.500, text = "Both buy")
render.mark(fii < 0 and dii < 0 and not (fii[1] < 0 and dii[1] < 0), shape = shape.arrow_down, at = anchor.above_bar, color = color.rose.500, text = "Both sell")
alert.rule(ta.cross_up(fii, 0), "FII net buyer", "FII flow turned positive")
alert.rule(ta.cross_down(fii, 0), "FII net seller", "FII flow turned negative")

P/E Valuation

analysis · presets/analysis/financial/pe_ratio.qs

Price / earnings from a user-entered EPS, with the historical median and an overvalued threshold.

QuaScriptengine result
Loading the engine result…
quatick-charts · QuaScript engine on synthetic 1-minute bars · drag to pan · scroll to zoom · Run executes the script on the engine (⌘/Ctrl+Enter while editing)
pe_ratio.qs
analysis "P/E Valuation" {
    overlay = false
}
// Price / earnings from a user-entered EPS, with the historical median and an overvalued threshold.
eps        = param.float(18.5, title = "Annual EPS", min = 0.01, max = 1000)
median     = param.float(22, title = "Median P/E", min = 1, max = 200)
overvalued = param.float(32, title = "Overvalued P/E", min = 5, max = 300)

pe = close / eps
p_pe  = render.line(pe, "P/E", color = color.blue.500, width = 2)
render.line(ta.sma(pe, 20), "P/E average", color = color.sky.300, width = 1)
p_med = render.level(median, "Median", color = color.slate.500)
render.level(overvalued, "Overvalued", color = color.rose.500)
render.band(p_pe, p_med, color = color.blue.500, opacity = 0.10, title = "Premium")
render.mark(ta.cross_up(pe, overvalued), shape = shape.diamond, at = anchor.above_bar, color = color.rose.500, text = "Rich")
render.mark(ta.cross_down(pe, median * 0.75), shape = shape.diamond, at = anchor.below_bar, color = color.emerald.500, text = "Value")
alert.rule(ta.cross_up(pe, overvalued), "Valuation warning", "P/E crossed above the overvalued threshold")
alert.rule(ta.cross_down(pe, median * 0.75), "Value zone", "P/E fell below 75% of the median")

© 2026 Quatick Technologies. All rights reserved.