Buying vs Selling Power Indicator for ThinkorSwim


This indicator will calculate the current buying and selling power of the stock. It's a lower study but comes with paintbar for better visual. You can turn it off from the indicator's settings page.

...when ever one cross the other we can see if asset is bearish =red or bullish= blue


thinkScript Code

# Buying vs. Selling Power
# Assembled by BenTen at
# Converted from

declare lower;

input s = 5;
input m = 9;
input l = 14;
input paintbar = yes;

def source = close;
def hilow = ((high - low) * 100);
def openclose = ((close - open) * 100);
def vol = (close / hilow);
def spreadv = (openclose * close);
def pt = spreadv + totalSum(spreadv);

def a = expAverage(pt, l) - expAverage(pt, m);
def b = expAverage(pt, s) - expAverage(pt, m);
def p = a + b;

plot blue = b;
plot red = p;

def bullishRule = b >= p;
def bearishRule = b <= p;

assignPriceColor(if paintbar and bullishRule then Color.Green else if paintbar and bearishRule then Color.Red else Color.Current);

Similar threads