SeaSide420

Indicator420 strategy

strategy for Indicator420
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?
//@version=2 
//                                                Indicator420 by SeaSide420
strategy("Indicator420 strategy", overlay=true)
q=input(title="HullMA",type=integer,defval=420)
z=input(title="HullMA cross",type=integer,defval=3)
a=input(title="VWMA",type=integer,defval=14)
rvwma=vwma(close,round(a))
rvwma2=vwma(close,round(a*2))
rvwma3=vwma(close,round(a*3))
n2ma=2*wma(close,round(z/2))
nma=wma(close,z)
diff=n2ma-nma
sqn=round(sqrt(z))
n2ma1=2*wma(close[1],round(z/2))
nma1=wma(close[1],z)
diff1=n2ma1-nma1
sqn1=round(sqrt(z))
n2ma2=2*wma(close[2],round(q/2))
nma2=wma(close[2],q)
diff2=n2ma2-nma2
sqn2=round(sqrt(q))
n1=wma(diff,sqn)
n2=wma(diff1,sqn)
n3=wma(diff2,sqn)
b=n1>n2?red:lime
c=n1>n2?green:red
d=n3>rvwma3?red:green
e=rvwma2>rvwma3?green:red
f=n1>n2?red:green
//plot(rvwma3, color=e, linewidth=1)
plot(cross(rvwma, rvwma2) ? rvwma : na, style = line,color=e, linewidth = 1)
plot(cross(n1, n2) ? n1 : na, style = line,color=b, linewidth = 3)
plot(cross(n1, n2) ? n1 : na, style = circles,color=c, linewidth = 4)
closelong = n1<n2
if (closelong)
    strategy.close("Long")
closeshort = n1>n2
if (closeshort)
    strategy.close("Short") 
longCondition = n1>n2 and strategy.opentrades<1 and n1<rvwma3
if (longCondition)
    strategy.entry("Long",strategy.long)
shortCondition = n1<n2 and strategy.opentrades<1 and n1>rvwma3
if (shortCondition)
    strategy.entry("Short",strategy.short)