Bentrix Docs
HomePricingDashboard

Putting a forecast to work

An alert when the price crosses a forecast, a strategy rule that reads one, an Assay indicator that takes one as input, and ensembles of your models.

01An alert

An alert's condition can read a model's forecast: its close, high or low at a step, or a band's edge — the price crosses the forecast's lower band at step 1. The alert reads the forecast that had arrived at each moment, never a later one.

02A strategy

A strategy's rule can read a forecast as an operand: forecast:<model>.close for step 1, forecast:<model>.close_3 for step 3, and high, low, band_lo, band_hi. At the last closed candle the rule reads the newest forecast that had arrived by that candle's close — so a backtest reads exactly what a live run would have read.

  • In the laboratory, Read a forecast at its anchor — Laboratory makes a run read earlier forecasts at their anchor, marked as reading ahead.
  • On paper, the newest close is always read by arrival, whatever the setting.
  • A model of your folder runs inside the strategy's loop. If the rule reads forecast:<label> and a model in your models folder declares that label (and none is already running on the workbench), the strategy runs it at each close of the model's interval — the window cut at that close — and its forecast is put before the rule reads. This happens at either pace: at the replay's, as you watch, and at machine speed, where a backtest over years runs the model at every close as it goes. The model's forecast arrives at the close plus the time the model took, so a slow model is read at the next close, as it would be live — and at the same anchor the two paces put the same forecast.
  • On a real account, a strategy that reads a forecast is refused while Read a forecast at its anchor — paper and real workbenches is on: a real account reads forecasts by arrival, and the laboratory is where reading at anchor belongs.

03An indicator

In Assay, request.forecast(model, step, field) gives a forecast's field as a series — step from 1, field one of close, open, high, low, lo, hi (the first band's edges): at bar i the newest forecast that had arrived by that bar's close. Under At its anchor the history is read at anchor and the newest bar by arrival.

04An ensemble

Declare an ensemble of several models on one market (forecast_ensemble_define): its closes are the members' mean, median, or a weighted mean with one weight a member; its bands by a named rule — quantiles_averaged (each level's edges averaged; the band claims no coverage of its own), members_pooled (the mixture of the members' samples, quantiles or band edges), or none. It is put whenever a member's newest forecast arrives and every member stands at one anchor — so its arrival is the latest of its members'.

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