0

I am a little bit confused on how stdev() function in TradingView's script language works.

I am trying to write a C# code that converts the following code block but I am getting different results:

typical=hlc3
f = log( typical ) - log( typical[1] )
g = stdev(f, 30 )

Basically, what I am doing in C# is to create a list of decimal values and then i do a Stdev on the list but I am unable to get the same result.

Ali
  • 846
  • 1
  • 13
  • 28

1 Answers1

1

I believe pine stdev() calcuates population stdev. If you're C# code is calculating sample stdev that might account for the difference (N instead of N - 1)

rumpypumpydumpy
  • 3,435
  • 2
  • 5
  • 10