Skip to content

Instantly share code, notes, and snippets.

@leonlee
Created March 25, 2021 12:43
Show Gist options
  • Save leonlee/ca4976404fc62858a9a127a4250e9c99 to your computer and use it in GitHub Desktop.
Save leonlee/ca4976404fc62858a9a127a4250e9c99 to your computer and use it in GitHub Desktop.
乖离率
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © MotorMe
//@version=4
//@version=4
study("Price divergence")
cs=(close-ema(close,20))/ema(close,20)*100
sm=(ema(close,20)-ema(close,60))/ema(close,60)*100
ml=(ema(close,60)-ema(close,120))/ema(close,120)*100
plot(cs,"cs",color.red)
plot(sm,"sm",color.green)
plot(ml,"ml",color.silver,linewidth=3,style=plot.style_histogram)
plot(0,"0",color.black)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment