Login Page - Create Account

Support Board


Date/Time: Tue, 04 Mar 2025 07:22:25 +0000



Z-Score difference

View Count: 1160

[2021-11-18 14:04:14]
User718690 - Posts: 18
Greetings,

I need some help with Z-score. I was using TradingView and Thinkorswim's and I tried to use the same settings in the Z-score in Sierra Chart platform, but they both look very differently. Im uploading two screenshot to compare .

Both charts are 15mins ES future contract for December 2021.

Can you assist, so I can see it the same way as the one in TradingView ?
imageZ.score.png / V - Attached On 2021-11-18 14:00:41 UTC - Size: 78.68 KB - 351 views
Attachment Deleted.
imageZ.score1.png / V - Attached On 2021-11-18 14:03:16 UTC - Size: 56.31 KB - 271 views
[2021-11-18 14:25:33]
Sawtooth - Posts: 4179
One is using the Open, one is using the Close.
[2021-11-19 13:45:31]
User718690 - Posts: 18
Im sorry, but this is not the problem.
Any changes I make cannot smooth the Z-score like the one in trading view.
Look at the dips the one in Sierra is making - they are DRAMATIC !
Date Time Of Last Edit: 2021-11-19 13:51:26
[2021-11-19 16:03:47]
John - SC Support - Posts: 38341
We show how we calculate all of our studies, and there are spreadsheets showing manual calculations against the system's calculations to show that they are correct. So if you want to check our math, you are welcome to do so. You will find the information for the Z-Score here:
Z-Score

But, the point is that we stand behind our calculations. Therefore, you need to consider where the difference in the data is coming from - their calculation or ours?
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2021-11-21 06:41:25]
SC Support Tom - Posts: 450
Can you post the documentation of the z-score studies from the other platforms?
[2021-11-22 13:29:40]
User718690 - Posts: 18
I guess the difference is coming from the formula/calculation you have.
See, yours is the only Z-score thats different. Thinkorswim's and tradingview's are looking the same - smoothed, not dramatized like the one in Sierra chart.

These are the studies from Thinkorswim:
declare lower;

input price = close;
input length = 20;
input ZavgLength = 20;

#Initialize values
def oneSD = stdev(price,length);
def avgClose = simpleMovingAvg(price,length);
def ofoneSD = oneSD*price[1];
def Zscorevalue = ((price-avgClose)/oneSD);
def avgZv = average(Zscorevalue,20);

#Compute and plot Z-Score
plot Zscore = ((price-avgClose)/oneSD);
Zscore.setPaintingStrategy(paintingStrategy.HISTOGRAM);
Zscore.setLineWeight(2);
Zscore.assignValueColor(if Zscore > 0 then color.green else color.red);

plot avgZscore = average(Zscorevalue,ZavgLength);
avgZscore.setPaintingStrategy(paintingStrategy.LINE);



And these are from TradingView:

//@version=3
study("Z Score")
Length = input(20)
StdDevs = input(2.0)
src = input(close)

basis = sma(src,Length)

zscore = (src-basis)/stdev(src, Length)


plot(zscore, color=#55FF55)

hline(StdDevs, color=white, linestyle=dotted)
hline(-1*StdDevs, color=white, linestyle=dotted)
[2021-11-22 21:56:51]
SC Support Tom - Posts: 450
We use the same formula as both Thinkorswim and Tradingview, and that formula is correct. Did you look at the actual numbers that the study is producing on each platform, or are you just eyeballing the graphs? You really need to do the former, as identical graphs can look very different depending on the horizontal and vertical scales used. If you were to put the study values from each platform into a spreadsheet, I would be surprised if you saw a difference.

All three z-scores are computed identically: (Price - SMA(Price,Length))/STDEV(Price,Length).
Date Time Of Last Edit: 2021-11-23 00:08:44
[2021-11-23 13:34:17]
User718690 - Posts: 18
The one in tradingview and thinkorswim is going only to SD2-3-4.

What are the numbers that Z-score in Sierra represent : -80,-60,-40,-20 to 20 40 60 80 ?! I have never heard of SD6,8 ?!

Only the range of the scale is a problem. The dramatic peaks and bottoms that Sierra's zscore I want to change to a range between SD-3 and SD3 for example.
[2021-11-23 13:43:09]
User718690 - Posts: 18
https://i.ibb.co/RymHCLQ/Capture.png
Sierra Chart

https://i.ibb.co/9HkpR9W/image.png
Thinkorswim

https://i.ibb.co/WGpj3mB/Capture1.png
TradingView

These are all screenshots of the same period of time with the same length (10),the same SD2 and the same source Last/close (2) . All Im saying is that your Z-score has a strange scale and range and I want to exclude these dramatic bottoms and tops you see at the screenshot
Date Time Of Last Edit: 2021-11-23 13:44:23
[2021-11-23 14:31:40]
Sawtooth - Posts: 4179
Sierra's Z-Score matches TOS's if the settings are Last, 10, 10
imageZ-Score.PNG / V - Attached On 2021-11-23 14:31:15 UTC - Size: 27.29 KB - 197 views
[2021-12-01 14:26:50]
User718690 - Posts: 18
Thanks man, you were the only one who understood what I meant. GAME CHANGER !

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account