Calculator
Type a formula to display its value: arithmetic, a symbol's latest data or its history as a chart, a matrix, a curve, a countdown, or a loan payment.
What it answers
Calculator evaluates one formula to one value: a number, a history, a matrix or a curve. Use Calculator to display a symbol's latest data or chart its history. You can also use it to test a formula before you enter it in a Sheet, and to solve a loan payment. The function reference lists every function.
How to read it
- 1The formula field. The result updates as you type. When you start a function name, a list of matching names opens. Press Tab or Enter to insert a name.
- 2The result line shows the value. For a history, such as
iv30.series("SPY"), or a curve, it shows the number of points, such as1163 samples. A matrix is shown as a grid of rows. A formula that fails shows its error code here, such asE_NO_DATAfor a symbol with no data on the site. - 3A history or a curve is drawn as a chart below the result line. A history has one point per trading day. A single number has no chart.
- 4Three buttons set how the result is displayed and when the formula runs again. Each button's label is its current setting.
- 5Click the TVM line at the bottom to open the loan payment solver. Fill four of its five fields, leave one empty, and press Enter. The solver fills the empty field. Solve a loan payment describes each step.
Data and lag
A data function such as iv30 returns the history up to the previous
trading day's close, like every value on the site. A fit such as
ou.kappa uses the last 504 points of the history it receives, or the
count its window argument gives, including the latest. The fit adds no lag of its own. A backtest lags its inputs before the
fit. Formulas run in the browser, on data the site already serves.
Accuracy
The loan payment solver is tested against closed-form answers in the
HP-12C sign convention. The ou functions are tested against a reference
workbook and R.
Controls
- Precision cycles
auto,fixed2,fixed4andfixed6.- The choices are automatic, or two, four or six decimals.
- Precision reformats the last result without running the formula again.
- Angle switches trigonometry between
degandrad.- With
deg,plot(sin(x), x, 0, 360, 181)draws one full turn of a sine wave. - With
rad, the same numbers are radians, so the curve repeats many times. - A Sheet has no angle button and always uses degrees.
- In
plot, the second argument is the variable name, typed without quotes. - The next two arguments are the range.
- The last argument is the number of points, from 2 to 2001.
- With
- Clock switches between
liveandstep.- In
live, a formula that uses a time function,sheetorsheet.matruns once a second. The time functions includesecs,mins,hoursanddays. - In
live,timer(mins(5))counts down from the first run of the formula text. An edit to the text starts the count again. - In
step, the clock stops at a whole second and the+1sand+1mbuttons appear.timercounts down from the second the clock stopped. +1sand+1mmove the clock forward and run the formula.- The reset button shows in both modes. It starts the count again from the current clock.
- In
- Solve fills the one empty field of the loan payment solver.
| Control | What it does |
|---|---|
| precision | Precision, decimals shown |
| angle | Angle, degrees or radians |
| timemode | Clock, live or step |
| tvm-solve | Solve the one empty field |
Use it with
Use Calculator with a Sheet on the same page. sheet("Book1", "spot")
returns the value of the cell named spot in the workbook Book1.
sheet("Book1", "A1:A10") returns the values of a range. While the
Calculator formula field has focus, Sheet outlines the cells the formula
uses. In live, Calculator gets the cell values again once a second; in
step, it does not.
The guides Analyse one series and Build a mean reversion model work through longer formulas.