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

Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?
//@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")