Often referred to as spread charts or ratio charts this is often used to measure the strength and performance of a script vis-a-vis a benchmark index. In this study, the comparison is plotted from a fixed reference session. On the current bar, the percentage change of the current ratio to the reference ratio is displayed as a label down icon, rounded to nearest integer. There are options to plot either a candle plot or line plot. The reference date can also be changed from the input dialog.
In the example above, 13-Feb-2020 is chosen as the reference date. Ratios are plotted from this reference date onwards. At the latest bar, the "60%" displays the percentage difference between ratio on 13-Feb-2020 and current date, 09-Sep-2020. This means RELIANCE performed 60% better than the benchmark NIFTY50 since 13-Feb-2020.
- Added an input option to hide label
- Fixed a small typo
- Fixed Moving Average plot
- Added an option for zero percentage line. This will help visualise the actual change in percentage.
- Now %change is correct up to 2 places of decimal
- Added separte option for "0%" label input control
- Removed option to display "0%" label
- Added label to display no valid trading session date in input
- Made default option to true, to display the zero line
- Moved the %change label to right, so that it is clearly observed
- No trading session found error now label down
- A temporary change on short title. :)
- A little more change in title :)
- Shortened the short title :)
- Made "Line" as default plot option
- Option to plot historical CRS, beyond reference date
The main highlight of this release is the ability to plot historical CRS beyond the reference date selected. This will help in doing a historical analysis of the scrip against the benchmark without the need to set the reference date. This is an advanced feature and therefore turned off by default.
- Fixed default colour of historical CRS to fuchsia instead of white. Will help those not using the dark theme.
- Added %change in Price to the label, along with %CRS change from reference
- Default line width of CRS plot is 2
- Minor cosmetic changes
- Added "Performance Trend" plot. Read below for details.
- Changed the short title of the indicator
- Changed the name of Zero line to Reference line
The Performance Trend Plot: This option plots the difference (in %) in the CRS (symbol/benchmark) ratio from the reference date on a day-to-day basis till the current session. The plot is made as a histogram with color coding that shall be explained in the document later on. It also displays additional information.
The Absolute Zero line is the absolute zero of the %change in CRS from the reference date. Therefore any bar (Green or Red) above the zero line indicates that the symbol closed with a higher change in CRS from the reference date CRS on that date. Similarly, any bars being plotted below the reference line indicate that the CRS change was negative on that date with respect to reference date.
For the mathematically inclined, the formulae are:
CRS on a particular day = symbol close / benchmark close
%CRS Change = (CRS today - CRS reference day) / CRS reference day * 100
So if CRS today > CRS reference day ===> Plot above zero line
And if CRS today < CRS reference day ===> Plot below zero line
Note that when in the “Performance Trend” mode, the indicator removes the “Reference Line” that is plotted in the Line and Candle plots. Instead the absolute zero line is taken as a reference in this mode.
There could be 4 colors for the bar, irrespective of whether they are above or below zero line.
- The color is a shade of green (dark and bright) when the close of the symbol is greater than or equal to the close of the symbol the previous day.
- The color is a shade of red (dark and bright) when the close of the symbol is less than the close of the symbol the previous day.
- A bright color (red or green) is applied when the trend of the performance (%CRS change) is going upwards. I.e. Current day %CRS change > Previous day %CRS change
- A dark color (red or green) is applied when the trend of the performance (%CRS change) is going downwards. I.e Current day %CRS change < Previous day %CRS change
By default, the label in blue is displayed. This label displays (Delta CRS) the %CRS change as of today with respect to the reference date in % terms. Delta Price is the %Price change as of today with respect to the reference date in % terms.
Additional information is displayed when the mouse is hovered above the blue label. They are described as below:
- CRS: Current CRS value
- Eq Price: The Equilibrium Price as of today
- Delta Eq Price: The difference in Eq Price and Current Price in % terms.
- Fixed a bug around Delta Eq Price computation
- Fixed Delta Eq. Price (again) :)
- Changed default reference data for RS 3-July-2020
- Support for the newly introduced Time Input in Trading View (TV)
- CRS Trend Indication based on Rate of Change (inbuilt roc method of TV)
- Support on all time frames, limited to maximum loadable bars by TV for a resolution
Instead of those dreary text boxes we now have an actual datetime input. The timezone is automatically adjusted to the selected exchange timezone. No changes are required unless, you know what you are doing.
The indicator now calculates internally the CRS trend. This is done by calculating the RateOfChange (roc) method of TV. The length for lookback of roc is user input, 13 by default. The output is displayed as "Up" or "Down" on the label description. "Up" indicates that the trend of the CRS since the roc lookback is "positive". "Down" indicates that the trend of the CRS since roc lookback is "negative".
Time Frame Support
The indicator now adjusts to all timeframes, Daily, Weekly, Monthly, Hourly, Minutes. Seconds is not tested. In case the exact reference date is not matched (for example ARS reference date is 3rd July and a Weekly timeframe is selected) then the next candle after the input reference date is selected as reference. The "adjusted" reference date is indicated in the label text. In case of lower timeframes, if the last available bar is before the input ARS reference date, then a warning is displayed as a valid percentage deviation cannot be calculated. In this case only the CRS trend and the plot is displayed. To mitigate this, either shift to a higher timeframe that can include the reference date or set the reference to a closer date.
- Added label color
- Changed the trend indication calculation
- Coloured bubbles on CRS Line (aka RS Line)
- Soothing colours for label and text on it
Orange: New high of CRS Line
Green: CRS Line crosses over the CRS mean line from below. CRS mean length is defined at "Moving Average Length" input
Maroon: CRS Line crosses below the CRS mean line from above.
Blue: Consistently rising CRS values for look-back period. Defined from input, max 500 bars only.
Also applied some smoothing to the colour of the labels and the label text for visual peace.
- Fixed colour combination of label text
- Small typos in input box
- Changed ARS default date to reflect new ARS date from today
- Removed an experimental feature leak
- Overhauled the input dialog, using the latest formatting options introduced in pinescript
- Possible to select custom colors for the label box and text color
- Separated MA X'over bubbles from RS high and RS rising bubbles
- Some strange and unexplained problem with historical CRS plot.
- Fixed the overlapping label box, especially irritating during smaller time frames.