VRM
Volume Per Movementhttp://tos.mx/aTJtmmw
The theory here is that sometimes a security will move more easily up or down given the same volume. This indicator attempts to discern whether movement up or down takes less volume and is therefore more likely in a given market.
IMPORTANT This indicator is 'upside down' where the lower the value the more easily the stock moves. Since it is volume required for a given movement, this makes sense. When the green line is below the red, it takes less volume to move up and when the red line is below the green, it takes less volume to move lower. When either line is very low, it takes very little volume to move a signifigant distance, and conversely if the lines are both quite high, it takes a lot of volume to move the price.
That is, if you see volume as driving price movement.
Eye Candy
Code:
################################
#
# VISCOSITY
#
# Volume Required for Movement
#
# By Mashume for the UseThinkScript Community
#
# 2022-05-08
#
################################
declare lower;
input length = 20;
input k_length = 8;
input d_length = 34;
script worden {
input values = close;
input count = 25;
input length = 25;
input k = 3;
input d = 5;
def rank = fold i = 0 to length
with rankcounter = 0
do if values != 0 and values > GetValue(values, i)
then rankcounter + 1 else rankcounter;
def w = ( 100 / ( count + 0 ) ) * rank;
plot Worden = SimpleMovingAvg(w, k);
plot signal = SimpleMovingAvg(Worden, d);
}
def up = if close > open then 1 else 0;
def dn = if close < open then 1 else 0;
def nc = if close == open then 1 else 0;
def up_vols = if up == 1 then volume else Double.POSITIVE_INFINITY;
def dn_vols = if dn == 1 then volume else Double.POSITIVE_INFINITY;
def change = if AbsValue(close - open) != 0 then AbsValue((close - open) / open) else 1;
def up_change_per_volume = up_vols / change;
def dn_change_per_volume = dn_vols / change;
def up_worden = worden(up_change_per_volume, (sum(up, length) + sum(nc, length)), length, k = k_length, d = d_length).signal;
def dn_worden = worden(dn_change_per_volume, (sum(dn, length) + sum(nc, length)), length, k = k_length, d = d_length).signal;
def vol_worden = worden(VOLUME, length * 1.5, k = k_length, d = d_length).signal;
plot pos_indicator = up_worden;
plot neg_indicator = dn_worden;
pos_indicator.SetDefaultColor(Color.GREEN);
neg_indicator.SetDefaultColor(Color.RED);
As always, this is provided free for the UseThinkScript community under applicable open source licenses.
Happy Trading,
mashume