UDAY_C_Santhakumar

UCS Larry Conner's RSI 2 Strategy

187
This is an indicator, Designed to give Buy and Short alert per Larry Conners RSi 2 Strategy.

Chris Moody has done a better job with this Strategy - There are lot more insights, % Winning, Amount of Money this generated in average. Follow the Link -

Uday C Santhakumar
สคริปต์โอเพนซอร์ซ

ด้วยจิตวิญญาณของ TradingView อย่างแท้จริง ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้ผู้ค้าสามารถเข้าใจและตรวจสอบได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ได้ฟรี แต่การใช้รหัสนี้ซ้ำในสิ่งพิมพ์อยู่ภายใต้กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?
// Created by UCSgears based on Larry Conner's RSI 2 Strategy on 8/31/2014

study(title="UCS_Larry Conner's RSI 2 Strategy", shorttitle="UCS_LC_RSI-2")
// inputs
source = close
rsilength = input(2, minval=1, title="RSI Length")
os = input (10, minval = 1, title = "oversold")
ob = input (90, minval = 1, title = "overbought")
malength1 = input(50, minval=1, title="SMA1 Length")
malength2 = input(200, minval=1, title="SMA2 Length")
HVlength = input(100, minval=1, title="HV Length")
ADXlength = input(10, minval=1, title="ADX Length")
lensig = input(14, title="ADX Smoothing", minval=1, maxval=50)
vmalength = input(21, minval=1, title="Volume SMA Length")
//Calculation
//RSI_2 
up = rma(max(change(source), 0), rsilength)
down = rma(-min(change(source), 0), rsilength)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
plot(rsi, color=purple)
band1 = hline(ob)
band0 = hline(os)
fill(band1, band0, color=purple, transp=90)
//Moving Average
SMA200 = sma(source, malength2)
SMA50 = sma(source, malength1)
//Historical Volatility
annual = 365
per = isintraday or isdaily and interval == 1 ? 1 : 7
hv = 100 * stdev(log(close / close[1]), HVlength) * sqrt(annual / per)
//Volume Condition
VSMA21 = sma(volume, vmalength)
//ADX
adxup = change(high)
adxdown = -change(low)
trur = rma(tr, ADXlength)
plus = fixnan(100 * rma(adxup > adxdown and adxup > 0 ? adxup : 0, ADXlength) / trur)
minus = fixnan(100 * rma(adxdown > adxup and adxdown > 0 ? adxdown : 0, ADXlength) / trur)
sum = plus + minus 
adx = 100 * rma(abs(plus - minus) / (sum == 0 ? 1 : sum), lensig)

//Definition
//Stock Qualification
sq = (adx > 30 and hv > 30 and VSMA21 > 250000) ? 1 : 0
//Buy Qualification
buy = (SMA50 > SMA200 and rsi < os) ? 1 : 0
//Sell Qualification
sell = (SMA50 < SMA200 and rsi > ob) ? 1 : 0
//Plot
plotchar(sell, title="i", char='S', location=location.top, color=red, transp=0, offset=0)
plotchar(buy, title="i", char='B', location=location.bottom, color=green, transp=0, offset=0)
//Added in BackGround High-lighting
noTrade = buy == 0 and sell == 0
bgcolor(noTrade ? white : na, transp=50)
bgcolor(sell ? red : na, transp=60)
bgcolor(buy ? green : na, transp=60)