UDAY_C_Santhakumar

UCS_S_Steve Primo - Strategy 4 - Version 2

For those who are interested with this strategy, Here is a better version.

Uday C Santhakumar
오픈 소스 스크립트

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

면책사항

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

차트에 이 스크립트를 사용하시겠습니까?
// Created by UCSgears
// Includes options to confirm with Pet-d

study(shorttitle="SP-S#4", title = "Steve Primo - Strategy #4", overlay = true, precision = 2)

basisma = sma(close,50)
petd = ema(close,15)

usepetd = input(true, title = "PET-D Confirmation Required")

trendup = usepetd == 1 ? close > basisma and close > petd : close > basisma
trenddn = usepetd == 1 ? close < basisma and close < petd : close < basisma

// PET-D

petdcolor = close > petd ? green : red
barcolor (petdcolor)

// Pullback & Bounce Criteria
lowest = lowest(low,(5))
highest = highest(high,(5))
pullback = (low == lowest) or (low[1] == lowest[1]) ? 1 : 0
bounce = (high == highest) or (high[1] == highest[1]) ? 1 : 0

// ALL PLOT
plot (lowest, color = green, linewidth = 1, title = "Lower Band")
plot (highest, color = red, linewidth = 1, title = "Upper Band")
plot (basisma, color = black, linewidth = 3, title = "Trend - Long Term")
plot (petd, color = blue, linewidth = 1, title = "Trend - Short Term")

// 25% Close 
range = high - low
rbrng = abs(open-close)
// Long Setup
longcandle = close > low+range*.75 ? 1:0
// Short Setup
shortcandle = close < low+range*.25 ? 1:0

//Setups
setuplong = trendup == 1 and pullback == 1 and longcandle == 1 ? 1:0
setupshort = trenddn == 1 and bounce == 1 and shortcandle == 1 ? 1:0

//setuplong = setuplonggeneral == 1 and setuplonggeneral[1] == 0 ? 1:0
//setupshort = setupshortgeneral == 1 and setupshortgeneral[1] == 0 ? 1:0

bcl = rbrng > (rma(tr,5)*1.1) ? blue : green
bcs = rbrng > (rma(tr,5)*1.1) ? blue : red

plotchar(setuplong, title="Long Setup Bar", char='⇑', location=location.belowbar, color=bcl, transp=0, text="Strategy #4 Long")
plotchar(setupshort, title="Short Setup Bar", char='⇓', location=location.abovebar, color=bcs, transp=0, text="Strategy #4 Short")

//Trade Trigger
tiggerlongcandle = (setuplong[1] == 1) and (high > high[1]) ? 1 : 0
tiggershortcandle = (setupshort[1] == 1) and (low < low[1]) ? 1 : 0
plotshape(tiggerlongcandle ? tiggerlongcandle : na, title="Triggered Long",style=shape.triangleup, location=location.belowbar, color=green, transp=0, offset=0)
plotshape(tiggershortcandle ? tiggershortcandle : na, title="Triggered Short",style=shape.triangledown, location=location.abovebar, color=red, transp=0, offset=0)

// Trade Target Signal

tarup = (tiggerlongcandle==1 and setuplong[1] == 1) ? high[1]+range[1] : na
plotshape(tarup, style = shape.circle, location = location.absolute, title = "Target Long", color = white)

tardn = (tiggershortcandle==1 and setupshort[1] == 1) ? low[1]-range[1] : na
plotshape(tardn, style = shape.circle, location = location.absolute, title = "Target Short", color = white)