John Drake
New member
I'm trying to create a chart study that will be similar to the Percent change option in TOS Settings/Price. Whereas that particular chart results in the benchmark (let's say the SPY) being plotted along with the comparison issues, I'm trying to replicate the type referred to in a Stocks and Commodities magazine article from May, 2001. Rather than show the benchmark issue as tracking its percentage change throughout the period of the chart, it is plotted as zero. The comparison issues are plotted using the difference between their percentage change and that of the benchmark. It is this difference that is plotted, the comparison issues' lines moving around the benchmark's zero line. I think this is visually more informative than that provided by the TOS Percent change format.
In essence, stock ABC plots a line that is ((today's close [for each bar] minus the close of the first bar on the left end of the chart) divided by (the close of the first bar)) minus ((today's close of SPY minus the close of SPY first bar) divided by (the close of the first bar )).
So that, ABC closes at 59.25 today vs. 37.85 the first bar on the chart, a difference of 21.4. Divide 21.4 by 37.85 for a percentage gain of 56.54%. SPY closes today at 507.25, vs. 412.87 the first bar on the chart, for a difference of 94.38. Divide that by 412.87 and get a percentage change of 22.85%. The last step is to subtract the benchmark's percent change, 22.85%, from that of the comparison issue, 56.54%, to get the difference of 33.69%. It is this difference that is plotted for the comparison issue, ABC. SPY's action, because it has been subtracted from that of ABC, is plotted as a zero line.
It would be great if, as with the TOS Percent Change chart, the user could add any number of comparison issue symbols and if the benchmark issue and lookback period could be manually input.
I'm very grateful for any help provided.
In essence, stock ABC plots a line that is ((today's close [for each bar] minus the close of the first bar on the left end of the chart) divided by (the close of the first bar)) minus ((today's close of SPY minus the close of SPY first bar) divided by (the close of the first bar )).
So that, ABC closes at 59.25 today vs. 37.85 the first bar on the chart, a difference of 21.4. Divide 21.4 by 37.85 for a percentage gain of 56.54%. SPY closes today at 507.25, vs. 412.87 the first bar on the chart, for a difference of 94.38. Divide that by 412.87 and get a percentage change of 22.85%. The last step is to subtract the benchmark's percent change, 22.85%, from that of the comparison issue, 56.54%, to get the difference of 33.69%. It is this difference that is plotted for the comparison issue, ABC. SPY's action, because it has been subtracted from that of ABC, is plotted as a zero line.
It would be great if, as with the TOS Percent Change chart, the user could add any number of comparison issue symbols and if the benchmark issue and lookback period could be manually input.
I'm very grateful for any help provided.
Last edited by a moderator: