xel_arjona

Volume Pressure Composite Average with Bands by @XeL_Arjona

VOLUME PRESSURE COMPOSITE AVERAGE WITH BANDS
Ver. 1.0.beta.10.08.2015
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"
  • Adjusted Exponential Adaptation from original Volume Weighted Moving Average (VEMA) by @XeL_Arjona with help given at the @pinescript chat room with special mention to @RicardoSantos
  • Color Cloud Fill Condition algorithm by @ChrisMoody


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) My approach is to make this indicator both as a "Trend Follower" as well as a Volatility expressed in the Bands which are the weighting basis of the trend given their "Cross Signal" given by the Buy & Sell Volume Pressures algorithm. >

  • B) Please experiment with lookback periods against different timeframes. Given the nature of the Volume Mathematical Monster this kind of study is and in concordance with Price Action; at first glance I've noted that both in short as in long term periods, the indicator tends to adapt quite well to general price action conditions. BE ADVICED THIS IS EXPERIMENTAL!

  • C) ALL NEW IDEAS OR MODIFICATIONS to these indicator(s) are Welcome in favor to deploy a better and more accurate readings. I will be very glad to be notified at Twitter or TradingVew accounts at: @XeL_Arjona


Any important addition to this work MUST REMAIN PUBLIC by means of CreativeCommons CC & TradingView. --- All Authorship Rights RESERVED 2015 ---

오픈 소스 스크립트

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

면책사항

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

차트에 이 스크립트를 사용하시겠습니까?
//	* VOLUME PRESSURE -COMPOSITE- WEIGHTED MOVING AVERAGE
//    Ver. 1.0.beta.10.08.2015
//    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
//      + Adjusted Exponential Adaptation from original Volume
//          Weighted Moving Average (VEMA) by @XeL_Arjona with
//          commited help at the @pinescript chat room help
//          with special mention to @RicardoSantos
//      + Color Cloud Fill Condition algorithm by @ChrisMoody
//
//      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) My approach is to make this indicator both as a "Trend Follower"
//      as well as a Volatility expressed in the Bands which are the weighting
//      basis of the trend given their "Cross Signal" given by
//      the Buy & Sell Volume Pressures algorithm.
//           << THEIR USE MUST BE CONSIDERED AS EXPERIMENTAL !! >>
//
//      B) Please experiment with lookback periods against different
//      timeframes. Given the nature of the Volume Mathematical Monster
//      this kind of stydie is and in concordance with Price Action;
//      at first glance I've noted that both in short as in long term
//      periods, the indicator tends to adapt quite well to general
//      price action conditions.  BE ADVICED THIS IS EXPERIMENTAL!
//
//      C) ALL NEW IDEAS OR MODIFICATIONS to these indicator(s) are
//      Welcome in favor to deploy a better and more accurate readings.
//      I will be very glad to be notified at Twitter or TradingVew
//      accounts at:   @XeL_Arjona
//
//      Any important adition to this work MUST REMAIN
//      PUBLIC by means of CreativeCommons CC & TradingView.
//      2015
//		
//////////////////////////////////////////////////////////////////
study("VOLUME PRESSURE -COMPOSITE- WEIGHTED MOVING AVERAGE by @XeL_Arjona", shorttitle="VPMA_XeL", overlay=true)
p = input(title="Lookback Periods:", defval=21)
bands = input(false, title="Show Pressure Bands:")
colb = input(true, title="Color Trend on price bars:")
// MAIN GENERAL VARIABLES/FUNCTIONS
vol = iff(volume>0 ,volume, 1)
vema(array,periods,K) =>
    VolW = vol*array
    VolK = K/(periods+1)
    VMsma = sum((VolW),periods)/sum(vol,periods)
    VMema = na(VMema[1]) ? (VMsma*VolK) : ((VolW-VMema[1])*VolK)+VMema[1]
// Close Conditions for Pressure Algorithms
cl = close
op = open
hi = high
lo = low
// Bull And Bear "Power-Balance" by Vadim Gimelfarb Algorithm's
BP =    iff(cl<op,          iff(cl[1]<op,   max(hi-cl[1], cl-lo), 
                                            max(hi-op, cl-lo)),
        iff(cl>op,          iff(cl[1]>op,   hi-lo, 
                                            max(op-cl[1], hi-lo)),
        iff(hi-cl>cl-lo,    iff(cl[1]<op,   max(hi-cl[1],cl-lo),
                                            hi-op),
        iff(hi-cl<cl-lo,    iff(cl[1]>op,   hi-lo,
                                            max(op-cl[1], hi-lo)),
        iff(cl[1]>op,       max(hi-op, cl-lo),
        iff(cl[1]<op,       max(op-cl[1], hi-lo),
        hi-lo))))))
SP =    iff(cl<op,          iff(cl[1]>op,   max(cl[1]-op, hi-lo),
                                            hi-lo),
        iff(cl>op,          iff(cl[1]>op,   max(cl[1]-lo, hi-cl),
                                            max(op-lo, hi-cl)),
        iff(hi-cl>cl-lo,    iff(cl[1]>op,   max(cl[1]-op, hi-lo),
                                            hi-lo),
        iff(hi-cl<cl-lo,    iff(cl[1]>op,   max(cl[1]-lo, hi-cl),
                                            op-lo),
        iff(cl[1]>op,       max(cl[1]-op, hi-lo),
        iff(cl[1]<op,       max(op-lo, hi-cl),
        hi-lo))))))
TP = BP+SP
// GENERAL CALCULATION VARIABLES FOR STUDIES
BPV = (BP/TP)*vol
SPV = (SP/TP)*vol
TPV = BPV+SPV
TH  = max(high, close[1])
TL  = min(low, close[1])
BPP = (TL+close)/2
SPP = (TH+close)/2
// Volume Pressures Weighted Averages
bpMavg = vema((BPV*BPP),p,3) / vema(TPV,p,3)*2
spMavg = vema((SPV*SPP),p,3) / vema(TPV,p,3)*2
VPMavg = (bpMavg+spMavg)/2
VPMAc = bpMavg > VPMavg ? green : red
// PLOT DIRECTIVES
//Cloud coloring method by @ChrisMoody
BPAbove = bpMavg >= spMavg ? 1 : na
SPBelow = bpMavg <= spMavg ? 1 : na
BPplotU = BPAbove ? bpMavg : na
SPplotU = BPAbove ? spMavg : na
BPplotD = SPBelow ? bpMavg : na
SPplotD = SPBelow ? spMavg : na
// Standard Line Coloring
CondCol = bpMavg > spMavg ? green : red
//Center Avg Line
plot(bands?na:VPMavg, color=CondCol, title='VPMA', style=line, linewidth=2)
//Cloud Lines Plot Statements - ***linebr to create rules for change in Shading
p1 = plot(bands and BPplotU ? BPplotU  : na, title = 'BP/SP', style=linebr, linewidth=1, color=CondCol)
p2 = plot(bands and SPplotU ? SPplotU  : na, title = 'SP/BP', style=linebr, linewidth=1, color=CondCol)
p3 = plot(bands and BPplotD ? BPplotD  : na, title = 'BP/SP', style=linebr, linewidth=1, color=CondCol)
p4 = plot(bands and SPplotD ? SPplotD  : na, title = 'SP/BP', style=linebr, linewidth=1, color=CondCol)
//Fills that color cloud based on Trend.
fill(p1, p2, color=green, transp=90, title='Cloud')
fill(p3, p4, color=red, transp=90, title='Cloud')
plot(bands and bpMavg ? bpMavg : na, title = 'BPavg', style=line, linewidth=1, color=green)
plot(bands and spMavg ? spMavg : na, title = 'SPavg', style=line, linewidth=1, color=red)
barcolor(colb?CondCol:na)