Change rate (one update)
How the change rate gives the change of a value since the update before as a fraction, how it differs from the rate of change over N bars, and how to use it in a QTSurfer strategy.
The change rate is how much a value changed since the update before, as a fraction of that value: 0.01 is a rise of 1 %. It has no period: it always looks exactly one update back.
Try it on a series below.
The series are samples, synthetic ones and real crypto ones. They show how the indicator behaves, not what it earns. The line is computed in your browser by the engine’s own indicator class, so it is the line a strategy reads.
What it computes
change rate = (value − previous value) / |previous value| It is ready from the first update, where it gives 0, and it gives 0 whenever the previous value is 0. The absolute value below the line keeps the sign of the move when the value is negative: from −4 to −2 is 0.5, a rise.
Reading it
- It is not the rate of change of the books. That one compares with the value
Nbars ago and is a percentage. This one compares with the update before and is a fraction. - It depends on the cadence. An update is a tick or a bar, so the same market gives small values on seconds and large ones on days.
- It reads any indicator, not only the price: the change rate of an EMA is the slope of the average, relative to its level.
In a strategy
setup:
rateChange("rc", "price", false) That registers rc, the fraction. With true in place of false it is the percent change. In Java, .rateChange("rc", "price", false) on the builder.
Give it a name. Without one, rateChange("price") registers chgprice, and percentChange("price") registers pchgprice: they are two names, so both can live together. Do not call it chg either, since a ticker strategy registers that name itself.
Related
- Percent change: the same change, times 100.
- Rate of change: the change over
Nbars, in percent. - Percent volatility: the average size of these changes.
- QTScript indicators and Java indicators: every indicator a strategy can call, with its forms and the names it registers.