Bentrix Docs
HomePricingDashboard

Other timeframes and markets

request.security — a higher timeframe of the chart's market, or another market of the workbench — and the other request functions, with the look-ahead rule.

A higher timeframe

dailyClose = request.security(syminfo.tickerid, "D", close)
weeklyEma  = request.security(syminfo.tickerid, "W", ta.ema(close, 20))

request.security(symbol, timeframe, expression) computes expression on another timeframe and brings it back to the chart's bars. In Bentrix a higher timeframe is folded out of the chart's own bars — the same candles the application builds for a study's own timeframe — and merged back by the study's own rule: each chart bar sees the last higher candle that had closed. While a higher candle forms, the chart's bars inside it read the one before.

The common idiom of reading expression[1] with lookahead = barmerge.lookahead_on runs as it is meant to: the closed candle before.

01Another market

symbol may name another market of the laboratory workbench the chart is on: its bars are cut at the chart's, so a chart bar never sees the other market's future. A market the workbench does not hold, a finer timeframe than the chart's, and another market on a paper or real workbench are refused by name.

02Converting a price

currency = currency.EUR converts the requested prices into that currency at each chart bar's moment, through the laboratory's own conversion routes — the same rates the workbench's account uses. A bar with no rate reads na, never a rate of one.

03Reading the future

lookahead = barmerge.lookahead_on without the [1] idiom reads a higher candle before it closed — a value the chart's bar could not have known then. That runs only where ☰ › Settings › Assay allows it (one switch for laboratory workbenches, one for paper and real; both off), and the study is then marked on the chart: its legend says reads the future, and the bars it repainted are shaded. See look-ahead.

04Finer candles, and other requests

  • request.security_lower_tf answers an array of the expression's values on each finer candle inside the chart bar, folded from the market's minutes.
  • request.currency_rate answers a conversion rate between two currencies at the bar.
  • request.economic reads a country's economic series from the calendar of your own MetaTrader.
  • request.seed and request.quandl are refused: Bentrix has no such source.

Every one is listed, with what Bentrix does, under request.

Bentrix 0.1.382Every number, name and default on these pages is read from the application itself.What is comingWhat changed