Percent change
How the percent change gives the change of a value since the update before in percent, what its typical size is, and how to use it in a QTSurfer strategy.
The percent change is how much a value changed since the update before, in percent: 1 is a rise of 1 %. It is the change rate times 100, with no period.
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
percent change = 100 × (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.
Reading it
- Its size belongs to the cadence. On the real series of the chart the typical change, the median of its size, is 1.15 % a bar on BTC/USDT days, 0.17 % on BTC/USDT hours and 0.15 % on ETH/USDT quarters of an hour. A threshold set for one says nothing on another.
- It reacts to one update only, so it is the noisiest measure of a move. To act on it, smooth it or compare it with its usual size.
- It is not the percent change of the ticker. The one an exchange puts in its ticker covers its own window, often 24 hours, and a ticker strategy has it as
chg. This one covers one update.
In a strategy
setup:
percentChange("pc", "price") That registers pc. In Java, .percentChange("pc", "price") on the builder.
Give it a name. Without one, percentChange("price") registers pchgprice, and rateChange("price") registers chgprice: they are two names, so both can live together. Avoid chg, which a ticker strategy already registers.
Related
- Change rate: the same change, as a fraction.
- 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.