TradeZoro
Notifications

Cookbook

Previous day high and low

Lines from yesterday's range.

//@zscript 1
indicator("Prior day", overlay=true)
pdh = request.security(syminfo.tickerid, "D", high[1])
pdl = request.security(syminfo.tickerid, "D", low[1])
plot(pdh, "Prior high", color=color.green, style=plot.style_stepline)
plot(pdl, "Prior low", color=color.red, style=plot.style_stepline)

How it works

request.security asks for a value from another timeframe. [1] on the daily series means "the last finished day", which keeps it free of look-ahead.

Education only. Not financial advice. Examples are teaching samples, not trading results.

Zscript is coming soon

The manual opens when Zscript launches.

Back to home