Last active
August 18, 2018 23:44
-
-
Save paul1522/76afb2a3249bc812d72953e9c640b9cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//@version=3 | |
// ©️ 2018 Randy Pratt | |
study("BarTzar", overlay=true) | |
//supDayThresh = input(40, minval=0, maxval=100, title="Threshold for support") | |
volAvg = input(50,minval=1,title="Number of bars", type=integer) | |
volAvgX = input(1.4, title="Breakout Volume Threshold %") | |
upBar = close > open | |
downBar = open > close | |
higherVolume = volume > 2*volume[1] | |
sellingWick = (high-close > close-low) | |
buyingWick = (high-close <= close-low) | |
avgVolMult = volAvg * volAvg | |
avgVolume = sma(volume,avgVolMult) | |
highVolume = volume > (avgVolume*2) | |
insideBar = high < high[1] and low > low[1] | |
//plotshape(close, title="1", locationlocation.belowbar) | |
//plotshape(supportDay, title="Support Day", color=green, style=shape.arrowup, location=location.belowbar, text="SupportDay") | |
//plotshape(upBar, title="Up", color=green, style=shape.arrowup, location=location.belowbar, text="Up") | |
bullishEngulfingData=(high > high[1] and low < low[1] and upBar and higherVolume) | |
plotshape(bullishEngulfingData, title="Bullish Engulfing", color=green, style=shape.arrowup, location=location.belowbar, text="BULL") | |
bearishEngulfingData=(high > high[1] and low < low[1] and downBar and higherVolume) | |
plotshape(bearishEngulfingData, title="Bearish Engulfing", color=fuchsia, style=shape.arrowdown, location=location.abovebar, text="BEAR") | |
//******************************Buying and Selling Pressure*************************** | |
selling=((volume > avgVolume) and sellingWick and volume > volume[1] and volume > volume[2] and not insideBar) | |
plotshape(selling, title="Selling Bar", color=red, style=shape.arrowdown, location=location.abovebar, text="Selling") | |
buying=((volume > avgVolume) and buyingWick) | |
plotshape(buying, title="Buying Bar", color=green, style=shape.arrowup, location=location.belowbar, text="Buying") | |
//define what close the low is, then see if volume is a factor while testing | |
//reversal=(high > high[1] and close ) | |
//plotshape(buying, title="Reversal bar", color=red, style=shape.square, location=location.abovebar, text="Reversal") | |
//******************************Topping Candles ************************************* | |
//topping=(high > high [1] and upBar and highVolume) | |
//plotshape(topping, title="Topping Signal", color=red, style=shape.triangledown, location=location.abovebar, text="Topping") | |
//Potential Areas to move | |
lowVolume = (volume < (avgVolume/2) and volume[1] < volume [2] and volume < volume[1] and (volume < (avgVolume/4))) | |
plotshape(lowVolume, title="Low Volume Alert", color=yellow, style=shape.circle, location=location.abovebar, text="Low Volume") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Moved to https://gist.github.com/illcrx/bbd2aef4485f20bf5c323c2f5da37433