ChrisMoody

CM Percent Move Lower V1

CM Percent Move Lower V1

Created by ChrisMoody on 9/3/2014 by Request from vlad.adrian

**Plots the percent move based on the Close of Bar Compared to the Close of Previous Bar

**If Bar closes Up then Histogram is Green, If Bar Closes Down Histogram is Red.

**Ability to Show/Hide Background Highlights, Horizontal Lines, % Histogram, and SMA of Percent Moves

Skrypt open-source

Zgodnie z prawdziwym duchem TradingView, autor tego skryptu opublikował go jako open-source, aby traderzy mogli go zrozumieć i zweryfikować. Brawo dla autora! Możesz używać go za darmo, ale ponowne wykorzystanie tego kodu w publikacji jest regulowane przez Dobre Praktyki. Możesz go oznaczyć jako ulubione, aby użyć go na wykresie.

Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.

Chcesz użyć tego skryptu na wykresie?
//Created by ChrisMoody on 9/3/2014 by Request from vlad.adrian
//Plots the percent move based on the close of Bar based on close of Previous Bar
//If Bar closes up then histogram is Green, If Bar Closes Down Histogram is Red.
//Ability to Show/Hide Background Highlights, Horizontal Lines, and SMA of Percent Moves
study("CM_Percent_Move_Lower", overlay=false)
sbh = input(true, title="Show Background Highlights?")
sl = input(true, title="Show Horizontal Lines?")
sh = input(true, title="Show % Move Histogram?")
len = input(50, title="Look Back Period for SMA")
shsma = input(true, title="Show Simple Moving Average of % Moves?")
//Percent Calculations
diff = close-close[1]
pct = abs(diff/close)*100
pctsma = sma(pct, len)
//BackGround Color Definitions
rlpct = pct < .5
lpct = pct >= .5 and pct < 1
mpct = pct >= 1 and pct < 1.5
hpct = pct >= 1.5 and pct < 2
rhpct = pct >= 2
//BackGround Color Plots
bgcolor(sbh and rlpct ? silver : na, transp=80)
bgcolor(sbh and lpct ? gray : na, transp=50)
bgcolor(sbh and mpct ? yellow : na, transp=50)
bgcolor(sbh and hpct ? orange : na, transp=50)
bgcolor(sbh and rhpct ? fuchsia : na, transp=40)
//Color of Histogram...Positive Close = Green...Close Down = Red...
col = close < close[1] ? red : close > close[1] ? lime : yellow
//Plot Statements
plot(sh and pct ? pct : na, title="Percentage Move", style=histogram, linewidth=4, color=col)
plot(shsma and pctsma ? pctsma : na, title="SMA of % Moves", style=circles, linewidth=3, color=aqua)
plot(sl and .5 ? .5 : na, title=".5% Line", style=line, linewidth=2, color=gray)
plot(sl and 1 ? 1 : na, title=".5% Line", style=line, linewidth=2, color=yellow)
plot(sl and 1.5 ? 1.5 : na, title=".5% Line", style=line, linewidth=3, color=orange)
plot(sl and 2 ? 2 : na, title=".5% Line", style=line, linewidth=4, color=fuchsia)