xel_arjona

BUY & SELL VOLUME PRESSURE by @XeL_Arjona

BUY & SELL PRICE TO VOLUME PRESSURE
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.

Pine Script code MOD's and adaptations by @XeL_Arjona with special mention in regard of:
  • Buy (Bull) and Sell (Bear) "Power Balance Algorithm" by: Stocks & Commodities V. 21:10 (68-72): "Bull And Bear Balance Indicator by Vadim Gimelfarb"
  • Normalisation (Filter) from Karthik Marar's VSA work: http://karthikmarar.blogspot.mx
  • Buy to Sell Convergence / Divergence and Volume Pressure Counterforce Histogram Ideas by: @XeL_Arjona

WHAT IS THIS?
The following indicators try to acknowledge in a K-I-S-S approach to the eye (Keep-It-Simple-Stupid), the two most important aspects of nearly every trading vehicle: -- PRICE ACTION IN RELATION BY IT'S VOLUME --

  • Volume Pressure Histogram: Columns plotted in positive are considered the dominant Volume Force for the given period. All "negative" columns represents the counterforce Vol.Press against the dominant.
  • Buy to Sell Convergence / Divergence: It's a simple adaptation of the popular "Price Percentage Oscillator" or MACD but taking Buying Pressure against Selling Pressure Averages, so given a Positive oscillator reading (>0) represents Bullish dominant Trend and a Negative reading (<0) a Bearish dominant Trend. Histogram is the diff between RAW Volume Pressures Convergence/Divergence minus Normalised ones (Signal) which helps as a confirmation.
  • Volume bars are by default plotted from RAW Volume Pressure algorithms, but they can be as well filtered with Karthik Marar's approach against a "Total Volume Average" in favor to clean day to day noise like HFT .
  • ALL NEW IDEAS OR MODIFICATIONS to these indicators are Welcome in favor to deploy a better and more accurate readings. I will be very glad to be notified at Twitter: @XeL_Arjona

Any important addition to this work MUST REMAIN PUBLIC by means of CreativeCommons CC & TradingView. -- 2015
Скрипт с открытым кодом

В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения. Вы можете добавить этот скрипт в избранное и использовать его на графике.

Хотите использовать этот скрипт на графике?
//	* BUY & SELL PRESSURE VOLUME PRESSURE
//    Ver. 1.00.beta1.27.07.2015
//    By Ricardo M Arjona @XeL_Arjona
//	
//		DISCLAIMER:
//
//      The Following indicator/code IS NOT intended to be
//      a formal investment advice or recomendation 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 
//		FREELEY AND PUBLICLY available on the Web
//		for NON LUCRATIVE ACTIVITIES and must remain as is.
//
//		Pine Script code MOD's and addaptations by @XeL_Arjona 
//      with special mention in regard of:
//      + Buy (Bull) and Sell (Bear) "Power Balance Algorithm" by:
//          Stocks & Commodities V. 21:10 (68-72):
//          "Bull And Bear Balance Indicator by Vadim Gimelfarb"
//      + Normalization (Filter) from Karthik Marar's VSA work:
//          http://karthikmarar.blogspot.mx
//      + Buy to Sell Convergence / Divergence and Volume Pressure
//        Conunterforce Histogram Ideas by:   @XeL_Arjona
//
//      WHAT IS THIS?
//
//      The following indicators try to acknowledge in a K-I-S-S
//      approach to the eye (Keep-It-Simple-Stupid), the two most
//      important aspects of nearly every trading vehicle:
//           -- PRICE ACTION IN RELATION BY IT'S VOLUME --
//
//      A) Volume Pressure Histogram:
//         Columns plotted in positive are considered the dominant
//      Volume Force for the given period.  All "negative" columns
//      represents the counterforce Vol.Press against the dominant.
//
//      B) Buy to Sell Convergence / Divergence:
//         It's a simple addaptation of the popular "Price
//      Percentage Oscilator" or MACD but taking Buying Pressure
//      against Selling Pressure Averages, so given a Positive 
//      oscilator reading (>0) represents Bullish dominant Trend
//      and a Negative reading (<0) a Bearish dominant Trend.
//      Histogram is the diff between RAW Volume Pressures
//      Convergence/Divergence minus Normalized ones (Signal)
//      which helps as a confirmator.
//
//      C) Volume bars are by default plotted from RAW Volume
//      Pressure algorithms, but they can be as well filtered
//      with Karthik Marar's approach against a "Total Volume
//      Average" in favor to clean day to day noise like HFT.
//
//      D) ALL NEW IDEAS OR MODIFICATIONS to these indicators are
//      Welcome in favor to deploy a better and more accurate readings.
//      I will be very glad to be notified at Twitter: @XeL_Arjona
//
//      Any important adition to this work MUST REMAIN
//      PUBLIC by means of CreativeCommons CC & TradingView.
//      2015
//		
//////////////////////////////////////////////////////////////////
study("BUY & SELL VOLUME PRESSURE by @XeL_Arjona", shorttitle="BSP_XeL", precision=0)
signal = input(title="Base for FastMA Periods:", type=integer, defval=3)
long = input(title="Buy to Sell Conv/Div Lookback:", type=integer, defval=27)
norm = input(false, title="Normalized (Filtered) Version:")
vmacd = input(false, title="Buy to Sell Convergence/Div OSC:")
//vapi = input(false, title="Display Acc/Dist % :")
vol = iff(volume > 0, volume , 1)
// PRESSURE ALGORITHMS AND VARIABLES
TR = atr(1)
// Bull And Bear "Power-Balance" by Vadim Gimelfarb Algorithm's
BP =    iff(close<open,     iff(close[1]<open,  max(high-close[1], close-low), 
                                                    max(high-open, close-low)),
            iff(close>open,     iff(close[1]>open,  high-low, 
                                                    max(open-close[1], high-low)),
            iff(high-close>close-low, iff(close[1]<open,    max(high-close[1],close-low),
                                                            high-open),
            iff(high-close<close-low, iff(close[1]>open,    high-low,
                                                            max(open-close[1], high-low)),
            iff(close[1]>open,  max(high-open, close-low),
            iff(close[1]<open,  max(open-close[1], high-low),
        high-low))))))
SP =    iff(close<open,     iff(close[1]>open,  max(close[1]-open, high-low),
                                                    high-low),
            iff(close>open,     iff(close[1]>open,  max(close[1]-low, high-close),
                                                    max(open-low, high-close)),
            iff(high-close>close-low,   iff(close[1]>open,  max(close[1]-open, high-low),
                                                            high-low),
            iff(high-close<close-low,   iff(close[1]>open,  max(close[1]-low, high-close),
                                                            open-low),
            iff(close[1]>open,  max(close[1]-open, high-low),
            iff(close[1]<open,  max(open-low, high-close),
        high-low))))))
TP = BP+SP
// RAW Pressure Volume Calculations
BPV = (BP/TP)*vol
SPV = (SP/TP)*vol
TPV = BPV+SPV
BPVavg = ema(ema(BPV,signal),signal)
SPVavg = ema(ema(SPV,signal),signal)
TPVavg = ema(wma(TPV,signal),signal)
// Karthik Marar's Pressure Volume Normalized Version (XeL-MOD.)
VN = vol/ema(vol,long)
BPN = ((BP/ema(BP,long))*VN)*100
SPN = ((SP/ema(SP,long))*VN)*100
TPN = BPN+SPN
nbf = ema(wma(BPN,signal),signal)
nsf = ema(wma(SPN,signal),signal)
tpf = ema(wma(TPN,signal),signal)
ndif = nbf-nsf
// Conditional Selectors for RAW/Norm
BPc1 = BPV>SPV ? BPV : -abs(BPV)
BPc2 = BPN>SPN ? BPN : -abs(BPN)
SPc1 = SPV>BPV ? SPV : -abs(SPV)
SPc2 = SPN>BPN ? SPN : -abs(SPN)
BPcon = norm ? BPc2 : BPc1
SPcon = norm ? SPc2 : SPc1
BPAcon = norm ? nbf : BPVavg
SPAcon = norm ? nsf : SPVavg
TPAcon = norm ? tpf : TPVavg
// Volume Pressure Convergence Divergence by XeL_Arjona
vpo1 = (( sum(BPVavg,long)-sum(SPVavg,long))/sum(TPVavg,long))*100
vpo2 = (( sum(nbf,long)-sum(nsf,long))/sum(tpf,long))*100 //ema(wma(vmcdt,signal),signal)
vph = nz((vpo1 - vpo2),0)
// Plot Indicator
histC = vph > vph[1] ? blue:#BA00AA
Vpo1C = vpo1 > 0 ? green:red
Vpo2C = vpo2 > 0 ? green:red
plot(vmacd ? na:SPcon, color=red, title="SELLING", style=columns, linewidth=3, transp=80)
plot(vmacd ? na:BPcon, color=green, title="BUYING", style=columns, linewidth=3, transp=80)
plot(vmacd ? na:SPAcon, color=red, title="SPAvg", style=line, linewidth=2) //ema(BearPower*SPV,signal)
plot(vmacd ? na:BPAcon, color=green, title="BPAvg", style=line, linewidth=2) //ema(BullPower*BPV,signal)
plot(vmacd ? vpo1:na, color=Vpo1C,title="VPO1", style=line, linewidth=3)
plot(vmacd ? vpo2:na, color=Vpo2C,title="VPO2", style=line, linewidth=1)
plot(vmacd ? vph:na, color=histC, title="VPH", style=columns, linewidth=3, transp=80)

Комментарии

Is it possible to make Alerts in to this Study ? Would have been a great tool with alerts.
Nice Study..:-)
+7 Ответить
Thanks for this, is it possible to adapt to include multiple exchanges - im a complete pine novice, with no real experience in pine other than cut paste. Any help appreciated. cheers, Lee

src1 = security("KRAKEN:XRPUSD", period, src0), src2 = security("BITSTAMP:XRPUSD", period, src0)
src3 = security("BITFINEX:XRPUSD", period, src0), src4 = security("BITTREX:XRPUSD", period, src0)
+5 Ответить
Flixer xrpxrp
@xrpxrp, Did it work now?
+2 Ответить
Brilliant. This has become one of my all-time favorite indicators. As someone who subscribes to the K.I.S.S. philosophy... It's the simplest tools that you find yourself using the most. Like a good knife.
Ответить
Love this, really do. i have a question as to how it is derived as it works on $spx which doesn't include volume data usually? Thanks in advance Xel!
Ответить
xel_arjona Milesb85
@Milesb85, Thanks for the kind words, glad you like some of my indies. As for the non zero volumes, you use a little recursion/procedure to normalize values to 1 with: normilizedVolume = nz( volume 0, 1 ), This way, all algorithms that use sum of volumes to factorize or weight with it tend to make a sum of the form 1/N that equals a convolution to the form of the 'Simple Algebraic Average'. Cheers.
Ответить
Good job!
What would you suggest the settings would be for a longer timeframe?
Ответить
Its amazing indicator im using and its showing a great result but you need to adjust the details as per currencies
is it possible also to have the MQ4 file as i want to install it on MT4 as im now only used on trading view
Ответить