I have been working on a study to show what the top players in NQ are doing in relation to what NQ is doing. I took another study on cumulative delta and added the ability to view multiple symbols. I think it has some value but needs a bit more analysis to relative volume of each symbol to gauge the strength of the move. So if anyone has ideas please post your thoughts. I mentioned TickStrike as a hint I'm sure their algo is far more sophisticated but this is just a starting point.
Code:
# Cumulative Volume Delta with Normalized Code
# tomsk
# 1.7.2020
# Cumulative Volume Delta
#
# The length of the accumulation is user controlled. The cumulative bar
# is the sum of the deltas for the past 10 bars. Change that length to
# 252 (a year in days) then plot something like AAPL. Very interesting.
#
# LongShort
# 5.7.2019
# 7.6.2022 --- irishgold added multiple tickers showing normalized delta as a labels
declare lower;
input symbol1 = "AAPL";
input symbol2 = "MSFT";
input symbol3 = "AMZN";
input symbol4 = "TSLA";
input symbol5 = "NVDA";
script computeDelta {
input O = 123.0;
input H = 123.0;
input C = 123.0;
input L = 123.0;
input V = 123.0;
def Buying = V * (C - L) / (H - L);
def Selling = V * (H - C) / (H - L);
plot Delt = Buying - Selling;
}
script normalizePlot {
input data = close;
input newRngMin = -1;
input newRngMax = 1;
def hhData = HighestAll( data );
def llData = LowestAll( data );
plot nr = ((( newRngMax - newRngMin ) * ( data - llData )) / ( hhData - llData )) + newRngMin;
}
input length = 10;
def symbol1Delta =normalizePlot(Sum(computeDelta(open(symbol1), high(symbol1), close(symbol1), low(symbol1), volume(symbol1)),length),-40,40);
def symbol2Delta =normalizePlot(Sum(computeDelta(open(symbol2), high(symbol2), close(symbol2), low(symbol2), volume(symbol2)),length),-40,40);
def symbol3Delta =normalizePlot(Sum(computeDelta(open(symbol3), high(symbol3), close(symbol3), low(symbol3), volume(symbol3)),length),-40,40);
def symbol4Delta =normalizePlot(Sum(computeDelta(open(symbol4), high(symbol4), close(symbol4), low(symbol4), volume(symbol4)),length),-40,40);
def symbol5Delta =normalizePlot(Sum(computeDelta(open(symbol5), high(symbol5), close(symbol5), low(symbol5), volume(symbol5)),length),-40,40);
AddLabel(yes, symbol1 + ":" + symbol1Delta, if symbol1Delta > 0 then Color.Green else Color.Red);
AddLabel(yes, symbol2 + ":" + symbol2Delta, if symbol2Delta > 0 then Color.Green else Color.Red);
AddLabel(yes, symbol3 + ":" + symbol3Delta, if symbol3Delta > 0 then Color.Green else Color.Red);
AddLabel(yes, symbol4 + ":" + symbol4Delta, if symbol4Delta > 0 then Color.Green else Color.Red);
AddLabel(yes, symbol5 + ":" + symbol5Delta, if symbol5Delta > 0 then Color.Green else Color.Red);
def O = open;
def H = high;
def C = close;
def L = low;
def V = volume;
def Buying = V * (C - L) / (H - L);
def Selling = V * (H - C) / (H - L);
def Delt = Buying - Selling;
plot CumulativeVolumeDelta = normalizePlot(Sum(Delt, length), -40, 40);
CumulativeVolumeDelta.AssignValueColor(if CumulativeVolumeDelta > 0 then Color.GREEN else Color.RED);
CumulativeVolumeDelta.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
plot zero = 0;
zero.SetDefaultColor(GetColor(5));
# End Cumulative Volume Delta with Normalized Code