xel_arjona

BUY & SELL PRESSURE XeLMod V2

BUY & SELL PRESSURE Oscillator
Ver. 2.0 XelMod

WHAT'S THIS?

This is an UPDATED version of a previous script already posted.

List of changes from previous script:
  • Separated as Column Histogram just the Regressive (Rate-Of-Change) Force of the indicator which gives a faster response of the trend.
  • Default period is now set to 81, as better Oscillator swing lagging.

This is an excelent momentum indicator very similar to ADX but in a candle weighting distribution rather than ranges.

For additional reference:
Karthik Marar BUY AND SELL PRESSURE INDICATORS.

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

开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成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=81)
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
Hi  = max(H,C[1])
Lo  = min(L,C[1])
// XeL Rate Of Change MoD (Regressional)
SProc = abs((Hi-C)/Hi)
BProc = abs((C-Lo)/Lo)
SPprc = Hi-C
BPprc = C-Lo
BPs = sum(BProc,p)
SPs = sum(SProc,p)
BPa = sma(BProc,p)
BPap = sma(BPprc,p)
SPa = sma(SProc,p)
SPap = sma(SPprc,p)
BPn = (BProc/BPa)*12
SPn = (SProc/SPa)*12
BPnp = (BPprc/BPap)*12
SPnp = (SPprc/SPap)*12
Va = sma(V,55)
Vn = V/Va
BPo = linreg(BPn * Vn,9,0)
SPo = linreg(SPn * Vn,9,0)
nbf = sma(BPnp * Vn,9)
nsf = sma(SPnp * Vn,9)
regH = (BPo-SPo)
// Plot Directives
OCol = BPo > SPo ? blue : fuchsia
_1hs = BPs > SPs ? BPs : -BPs
_2hs = SPs > BPs ? SPs : -SPs
plot(so?regH:na,color=OCol,style=columns,transp=81,title="RegForce")
plot(so?na:_1hs,color=green,style=columns,transp=72,title="BProc")
plot(so?na:_2hs,color=red,style=columns,transp=72,title="SProc")
plot(so?nbf:na,color=green,style=line,transp=0,title="BPprice")
plot(so?nsf:na,color=red,style=line,transp=0,title="SPprice")