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

نص برمجي مفتوح المصدر

قام مؤلف هذا النص البرمجي بنشره وجعله مفتوح المصدر، بحيث يمكن للمتداولين فهمه والتحقق منه، وهو الأمر الذي يدخل ضمن قيم TradingView. تحياتنا للمؤلف! يمكنك استخدامه مجانًا، ولكن إعادة استخدام هذا الكود في منشور تحكمه قواعد الموقع. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني.

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.

هل تريد استخدام هذا النص البرمجي على الرسم البياني؟
//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)

التحليلات ذات الصلة