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

免责声明

这些信息和出版物并不意味着也不构成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")