Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 3

PASTEBIN

paste
Search...

LOGIN SIGN UP
Advertisement
SHARE
TWEET
Guest User
Indicators
A GUEST
JUN 23RD, 2019
307
0
NEVER
ADD COMMENT
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
3.79 KB | None |

//@version=3
study("PRS+EMACloud+PSAR+Ichi", overlay=true)

//
// author: Kozlod
// date: 2018-04-11
// https://www.tradingview.com/u/Kozlod/
//

// Inputs
leftBars = input(4)
rightBars = input(4)

// Calculate Pivot Points


swh = pivothigh(leftBars, rightBars)
swl = pivotlow(leftBars, rightBars)

swh_cond = not na(swh)

hprice = 0.0
hprice := swh_cond ? swh : hprice[1]

swl_cond = not na(swl)

lprice = 0.0
lprice := swl_cond ? swl : lprice[1]

// Signals
long = crossover(high, hprice + syminfo.mintick)
short = crossunder(low, lprice - syminfo.mintick)

last_signal = 0

long_final = long and (nz(last_signal[1]) == 0 or nz(last_signal[1]) == -1)


short_final = short and (nz(last_signal[1]) == 0 or nz(last_signal[1]) == 1)

last_signal := long_final ? 1 : short_final ? -1 : last_signal[1]

// Plotting
plotshape(long_final, style = shape.arrowup, color = lime, location =
location.belowbar, text = "LONG")
plotshape(short_final, style = shape.arrowdown, color = red, location =
location.abovebar, text = "SHORT")

// plot(lprice, color = red)


// plot(hprice, color = green)

// Alerts
alertcondition(long_final, "Pivot Long", "Pivot Long")
alertcondition(short_final, "Pivot Short", "Pivot Short")

// Inputs
start = input(0.02)
increment = input(0.02)
maximum = input(0.2)

// Calculation Parabolic SAR


psar = sar(start, increment, maximum)

// Signals
psar_long = high[1] < psar[2] and high >= psar[1]
psar_short = low[1] > psar[2] and low <= psar[1]

// Plot PSAR
plotshape(psar, location = location.absolute, style = shape.cross, size =
size.tiny, color = low <= psar[1] and not psar_long ? lime : red)

// Plot Signals
//plotshape(psar_long, title = "PSAR Long", text = "PSAR Long", style =
shape.arrowup, location = location.belowbar, color = blue)
//plotshape(psar_short, title = "PSAR Short", text = "PSAR Short", style =
shape.arrowdown, location = location.abovebar, color = red)

// Alerts
alertcondition(psar_long, "PSAR Long", "PSAR Long")

//@version=1
//study(title="EMA Cloud", shorttitle="cloud", overlay=true)

src = close, len = input(21, minval=1, title="Short EMA")


EMA2 = input(55, minval=1, title="EMA2")
EMA3 = input(144, minval=1, title="EMA3")
src2 = close, len2 = input(233, minval=1, title="Long EMA")

emaShort = ema(src, len)


emaLong = ema(src2, len2)

spanColor = emaShort>=emaLong ? #7bf680 : #f67b7b

p1 = plot(emaShort, title="EMA Short", style=line, linewidth=2, color=lime,


transp=0)
p2 = plot(ema(close, EMA2), title="EMA2", style=line, linewidth=1, color=yellow,
transp=0)
p3 = plot(ema(close, EMA3), title="EMA3", style=line, linewidth=1, color=orange,
transp=0)
p4 = plot(emaLong, title="EMA Long", style=line, linewidth=2, color=red, transp=0)
fill(p1, p4, color=spanColor, transp=60, title="Fill")

//@version=3
//study(title="Ichimoku Cloud", shorttitle="Ichimoku", overlay=true)

conversionPeriods = input(9, minval=1, title="Conversion Line Periods"),


basePeriods = input(26, minval=1, title="Base Line Periods")
laggingSpan2Periods = input(52, minval=1, title="Lagging Span 2 Periods"),
displacement = input(26, minval=1, title="Displacement")

donchian(len) => avg(lowest(len), highest(len))

conversionLine = donchian(conversionPeriods)
baseLine = donchian(basePeriods)
leadLine1 = avg(conversionLine, baseLine)
leadLine2 = donchian(laggingSpan2Periods)

plot(conversionLine, color=#0496ff, title="Conversion Line")


plot(baseLine, color=#991515, title="Base Line")
plot(close, offset = -displacement, color=#459915, title="Lagging Span")

p1_ichi = plot(leadLine1, offset = displacement, color=green,


title="Lead 1")
p2_ichi = plot(leadLine2, offset = displacement, color=red,
title="Lead 2")
fill(p1_ichi, p2_ichi, color = leadLine1 > leadLine2 ? green : red)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement
create new paste / syntax languages / archive / faq / tools / night mode
/ api / scraping api / news / pro
privacy statement / cookies policy / terms of serviceupdated / security
disclosure / dmca / report abuse / contact

By using Pastebin.com you agree to our cookies policy to enhance your experience.
Site design & logo � 2023 Pastebin
We use cookies for various purposes including analytics. By continuing to use
Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK,
I Understand

You might also like