https://www.tradingview.com/script/ZhHf4DFD-SQN-ChrisD-Fallible/
Wondering if
@samer800 or another could convert the following to thinkscript. Tradingview link above
//@version=4
// This source code is subject to the terms of the Mozilla Public License 2.0 at
https://mozilla.org/MPL/2.0/
// © ChrisD_Macro
https://www.pollinatetrading.com
// FX variation done by John D
study(title="SQN-ChrisD-Fallible", shorttitle="SQN-ChrisD-Fallible", overlay = false)
Period = input(100, title="Period")
close_difference = close/close[1]-1
Stdev = stdev(close_difference,Period)
_sma = sma(close_difference,Period)
SQN = ((_sma*sqrt(Period))/Stdev)
c = (SQN<-1.7)?#800000:
(SQN>=-1.7 and SQN<-0.6)?#FF0000:
(SQN>=-0.6 and SQN<=0.6)?#FFD700:
(SQN>0.6 and SQN<=1.7)?#008000:
(SQN>1.7)?#0000FF: color.gray
plot(SQN, title="SQN", color=c, transp=10, histbase=0, style=plot.style_area, linewidth=4)
//Bull volatile blue
//Bull Quiet Green
//Neutral yellow
//Bear Quiet red
//Bear volatile crimson