Hawkeye Volume Indicator for ThinkorSwim

BenTen

BenTen

Administrative
Staff
VIP
A volume indicator developed by Nigel Hawks to show bullish, bearish, and neutral sentiment. There aren't many documentations about it, but I found a YouTube video and a post from Hawkeye Traders that might be useful.
  • Green volume bars = bullish
  • Red volume bars = bearish
  • Gray volume bars = neutral
Credit also goes to LazyBear from TradingView.



thinkScript Code

Code:
# HawkEye Volume Indicator
# Assembled by BenTen at useThinkScript.com
# Converted from https://www.tradingview.com/script/gci6llVF-Indicator-HawkEye-Volume-Indicator/

declare lower;

input length = 200;
input divisor = 3.6;
def range = high - low;
def rangeAvg = simpleMovingAvg(range, length);
def volumeA = simpleMovingAvg(volume, length);

def high1 = high[1];
def low1 = low[1];
def mid1 = hl2[1];

def u1 = mid1 + (high1 - low1) / divisor;
def d1 = mid1 - (high1 - low1) / divisor;

def r_enabled1 = (range > rangeAvg) and(close<d1) and volume > volumeA;
def r_enabled2 = close < mid1;
def r_enabled = r_enabled1 or r_enabled2;

def g_enabled1 = close > mid1;
def g_enabled2 = (range > rangeAvg) and(close > u1) and(volume > volumeA);
def g_enabled3 = (high > high1) and(range<rangeAvg/1.5) and(volume<volumeA);
def g_enabled4 = (low < low1) and(range<rangeAvg/1.5) and(volume > volumeA);
def g_enabled = g_enabled1 or g_enabled2 or g_enabled3 or g_enabled4;

def gr_enabled1 = (range > rangeAvg) and(close > d1) and(close<u1) and(volume > volumeA) and(volume<volumeA*1.5) and(volume > volume[1]);
def gr_enabled2 = (range < rangeAvg / 1.5) and(volume<volumeA/1.5);
def gr_enabled3 = (close > d1) and(close<u1);
def gr_enabled = gr_enabled1 or gr_enabled2 or gr_enabled3;

plot histogram = volume;
histogram.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
histogram.assignValueColor(if gr_enabled then color.gray else if g_enabled then color.green else if r_enabled then color.red else color.white);

 

Similar threads

Top