Cumulative Delta with Multiple Tickers, pseudo "TickStrike" need help to add more analysis

irishgold

Active member
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
 
  • Love
Reactions: IPA

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

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

Did you ever get anywhere with this?
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
418 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top