UDAY_C_Santhakumar

UCS_Momentum Oscillator - Version 2

This is Version - 2 of the Momentum Oscillator, Like i said on the prior version, This version has an Indicator for Trends.

Marks only Overbought and Oversold Based on the TREND.

The Trend dots are calculated exactly like the Slingshot system trend.


Uday C Santhakumar
開源腳本

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想在圖表上使用此腳本?
// Created by UCSgears 
// Version 2

study(title="UCS_Momentum Oscillator", shorttitle="UCS_Osc")

// Stochastic Based Relative Oversold and Overbought

//Input
// Short Stochastic Input
length1 = input(8, minval=1, title = "Short %K")
sma1 = input(3, minval=1, title="Smooth %K1")

// Base Stochastic Input
length3 = input(100, minval=1, title = "Base %K")
sma3 = input(10, minval=1, title="Smooth %K3")

// Stochastic Code

k1 = (sma(stoch(close, high, low, length1), sma1)-50)
k3 = (sma(stoch(close, high, low, length3), sma3)-50)

//Histogram 1 Calc and Plot

hist1 = (k1-k3)
plot_color1 = hist1 > hist1[1] and hist1 > 0 ? green : hist1 < hist1[1] and hist1 > 0 ? blue : hist1 < hist1[1] and hist1 <= 0 ? red : hist1 > hist1[1] and hist1 <= 0 ? orange : white
plot(hist1, color=plot_color1, style=histogram, linewidth=4, title="Diff")

//Horizontal Lines

h1=hline(80, "Extreme Up", red, solid, 3)
h2=hline(-80, "Extreme Down", green, solid, 3)
h3=hline(55, "OverBought", red, dashed, 1)
h4=hline(-55, "OverSold", green, dashed, 1)
fill(h2,h4, green, 80, "OverSold Zone")
fill(h1,h3, red, 80, "OverBought Zone")

//Code for Trend Based Zero Line
ma1 = ema(close, 13)
ma2 = ema(close, 21)
ma3 = ema(close, 34)

ma = ema(close, 89)
range =  tr 
rangema = ema(range, 89)
upper = ma + rangema * 0.5
lower = ma - rangema * 0.5
tr_up = ma1 > upper and ma2 > upper and ma3 > upper
tr_down = ma1 < lower and ma2 < lower and ma3 < lower
scolor = tr_up ? green : tr_down ? red : blue
plot(0, color=scolor, style=circles, linewidth=3)