问题
Can anyone let me know how to plot STD Dev in Pinescript using custom parameters as mentioned below
Period : 20 Multiplier : 4 Source : Close
IS this correct x = 4 * stdev(close, 20)
回答1:
Your code looks correct.
You could also make input()
variables for those variables.
It'll be more convenient to change them, rather than hard-code them.
For more information, see the answer to this question:
Calculating standard deviation of last N elements of in a pine series
It contains a custom implementation of a standard deviation calculation.
来源:https://stackoverflow.com/questions/64837476/plot-std-dev-in-pinescript-with-custom-parameters