xel_arjona

BUY & SELL PRESSURE by Regression

BUY & SELL PRESSURE by Regression Analysis at candle price/volume (Rate-Of-Change)
Ver. 3 By Ricardo M Arjona @XeL_Arjona

DISCLAIMER:

The Following indicator/code IS NOT intended to be a formal investment advice or recommendation by the author, nor should be construed as such. Users will be fully responsible by their use regarding their own trading vehicles/assets.

The embedded code and ideas within this work are FREELY AND PUBLICLY available on the Web for NON LUCRATIVE ACTIVITIES and must remain as is.


WHAT'S THIS?

This is my 3rd. revision of the original implementation for AmiBroker by Karthik Marar's of it's BUY AND SELL PRESSURE INDICATORS but this time, constructed under a complete REGRESSIVE ANALYSIS premise based in Rate Of Change (A kind of Slope but measured in % Performance).

Some minimal adaptation's (and cleaning) have been made:
  • Instead of simple Range calculation at price, Rate Of Change (Regressive) is used.
  • Oscillator of Pressure can be deactivated in favor of a simple RoC Cumulative Pressures at candle.
  • Oscillator can read Volume data from external tickers for accurate Index calculation. ( NYA can use TVOL as example.)
  • Code is small, cleaner and faster =) !

Cheers!
Any feedback will be welcome...
@XeL_Arjona

오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?
//@version=2
study("BUY & SELL PRESSURE by Regression", shorttitle="BSPbR",overlay=false,precision=2)
so = input(title="Buy&Sell Pressure Oscillator:", defval=true)
p  = input(title="Lookback Window:", defval=9)
tev = input(title="Use External Volume?:", defval=false)
evt = input(title="External Volume Ticker:", type=symbol, defval="TVOL")
// Fixed Variables
volsym = tev ? evt : tickerid
vol = nz(security(volsym,period,volume),security(volsym,period,close))
V = vol == 0 ? 1 : nz(vol,1)
C = close
H = high
L = low
// // Karthik Marar's XeL Rate Of Change MoD (Regressional)
Hi  = max(H,C[1])
Lo  = min(L,C[1])
SP  = ((Hi-C)/C)*100
BP  = ((C-Lo)/Lo)*100
BPs = sum(BP,p)
SPs = sum(SP,p)
BPa = ema(BP,p)
SPa = ema(SP,p)
BPn = (BP/BPa)*10
SPn = (SP/SPa)*10
//BSPd = BPn - SPn
Va = ema(V,p)
Vn = V/Va
BPo = linreg(BPn * Vn,9,0)//linreg(BPn*Vn,9,0)//
SPo = linreg(SPn * Vn,9,0)//linreg(SPn*Vn,9,0)//
BSPh = BPo - SPo
// Plot Directives
HCol = BPo > SPo ? green : red
_1os = SPo > BPo ? SPo : BPo
_2os = BPo > SPo ? BPo : SPo
plot(so?_1os:na,color=HCol,style=columns,transp=81,title="SP")
plot(so?_2os:na,color=HCol,style=columns,transp=81,title="BP")
plot(so?SPo:na,color=red,style=line,transp=0,title="SP",editable=false)
plot(so?BPo:na,color=green,style=line,transp=0,title="BP",editable=false)
plot(so?na:BPs,color=green,style=columns,transp=55,title="BProc")
plot(so?na:-SPs,color=red,style=columns,transp=55,title="SProc")
//plot(so?na:BPs-SPs,color=HCol,style=line,linewidth=3,transp=0,title="Forze")