Trade Volume Delta Indicator for ThinkorSwim

A

anycolour

Member
Is there anything close to "footprints" indicator in Thinkorswim? If so, I'd like a combination with that! Thanks
 
T

Trading51

Active member
2019 Donor
TOS is not built for nor can it produce net delta buying or selling
 
D

dolomick

Member
@tomsk unfortunately the Cumulative delta portion is not displaying the same way as it does on the original indicator... looking at TSLA on a one minute chart today there are periods of red negative bars on the original indicator, but on the new one there are no red, negative bars showing. I tested on MU as well and found similar discrepancy. Thanks for any help...
 
A

anycolour

Member
TOS is not built for nor can it produce net delta buying or selling
So what are these 2 indicators in this thread actually measuring? Are we fools for using these 2 indicators with invalid and/or partial data?
 
T

tomsk

Well-known member
VIP
@tomsk unfortunately the Cumulative delta portion is not displaying the same way as it does on the original indicator... looking at TSLA on a one minute chart today there are periods of red negative bars on the original indicator, but on the new one there are no red, negative bars showing. I tested on MU as well and found similar discrepancy. Thanks for any help...

Looking through the notes that the original author of the CVD supplied in the header, it appears that this is designed for use on a daily chart rather than intraday. When I assembled the CSA for you yesterday I retained the code logic and all's I did was to normalize the plots to co-incide with other two Chaikin studies.

Since there are way too many variables here, as a test I removed the two Chaikin components so that we are just left with the CVD. I then normalized this CVD study on a daily aggregation. The result? It looks exactly the same on a daily aggregation.

Here is the original CVD study. Load that on your charts and name that study "CVDOne".

Code:
# 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

declare lower;

input length = 10;

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 Delta = Delt;
Delta.AssignValueColor(if Delta > 0 then Color.GREEN else Color.RED);
Delta.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Delta.hide();

plot zero = 0;
zero.setDefaultColor(Color.BLUE);

plot CumulativeVolumeDelta = sum(Delta,length);
CumulativeVolumeDelta.AssignValueColor(if CumulativeVolumeDelta > 0 then Color.GREEN else Color.RED);
CumulativeVolumeDelta.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

# End Code

Next load the following study which essentially is the CVD but with the normalized code built in. Call this study "CVDTwo"

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

declare lower;

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 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

Now after loading both studies, compare this on a DAILY aggregation. It looks exactly the same. If you'd still like to use this on a 1 minute chart, that is entirely up to you, in which case just use the original CVD code from LongShort. However as noted earlier, my understanding is that this was designed to be used on a daily chart. All the best out there
 
Last edited:
D

dolomick

Member
Thanks for checking! So this is interesting, as I have been using it on one and five minute charts with great success. If I understand correctly, there is no way to normalize and combine Chaikin money flow and Cumulative delta successfully into one normalized study, based on what you see?
 
T

tomsk

Well-known member
VIP
Thanks for checking! So this is interesting, as I have been using it on one and five minute charts with great success. If I understand correctly, there is no way to normalize and combine Chaikin money flow and Cumulative delta successfully into one normalized study, based on what you see?

I normalized all three 2 days ago, have a look at that post, it runs fine on a daily chart.
 
D

dolomick

Member
Sorry, I didn't word my question well. I meant to ask, is there no way to normalize and combine Chaikin money flow and Cumulative delta successfully, for a five minute chart, based on what you see in the code? The Cumulative delta works great for me on tick and five minute charts, despite what is in the header of the code. That said, the combined indicator shows different cumulative delta when I throw it on a five minute chart and compare to the originally posted Cumulative delta chart. This seems odd to me, but I am no coder. Worst case, I will do what I have been doing and use them separately, but I was hoping to save lower screen real estate. Thanks.
 
D

dolomick

Member
Jus
Mind sharing how the Chaikins provide value to you?
Just like most indicators I look for divergences, and/or crossings above or below the zero line to go long or short. I find Chaikin Money flow to be the more useful of the two. If consolidating but Chaikin is rising above zero line, it's a good play to go long.
 
D

dolomick

Member
@tomsk can you confirm the combined indicator won't work on a 5 minute time frame, based on what you see in the code? Thanks...
 
A

anycolour

Member
Do either of these two indicators in the original post "repaint"?
 
T

tomsk

Well-known member
VIP
Typically indicators that repaint uses future bars to confirm pivots/trends. Since no future bar is used in the code above, that means it won't repaint.
 
T

Tiredoflosing

New member
VIP
Does anyone have a Delta (Cumulative Delta) indicator they could share? Something like the attached image. Thank you!

Were you able to find anything like this? I'm also looking for this. Ninja trader has a bunch of cumulative delta indicators but I'm hoping to find it for TOS.
 
C

cesarword

New member
I wrote this code to plot the real cumulative volume using BID and ASK transactions no the close of the candle, please take a look and let me know what do you think.

it works only for 15 min charts other wise you must change the aggregation period within the code. doesn't work with tick charts.

input displace = 0;
def ASK = tick_count(priceType = PriceType.ASK , period = AggregationPeriod.FIFTEEN_MIN);
def BID = tick_count(priceType = PriceType.BID , period = AggregationPeriod.FIFTEEN_MIN);
def MARK = tick_count(priceType = PriceType.MARK , period = AggregationPeriod.FIFTEEN_MIN);
def LAST = tick_count(priceType = PriceType.LAST , period = AggregationPeriod.FIFTEEN_MIN);

def ba = BID - ASK;

plot data = Sum(ba-displace, 100);



Here is the same code plus the histogram



#start code

declare lower;
declare zerobase;
input displace = 0;
def ASK = tick_count(priceType = PriceType.ASK , period = AggregationPeriod.FIFTEEN_MIN);
def BID = tick_count(priceType = PriceType.BID , period = AggregationPeriod.FIFTEEN_MIN);
def MARK = tick_count(priceType = PriceType.MARK , period = AggregationPeriod.FIFTEEN_MIN);
def LAST = tick_count(priceType = PriceType.LAST , period = AggregationPeriod.FIFTEEN_MIN);
def ba = BID - ASK;
plot BUVol=if(ba>0,ba,0);
plot BEVol=if(ba<0,ba,0);

plot data = Sum(ba-displace, 100);

BEVol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
BEVol.SetDefaultColor(Color.RED);
BUVOL.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
BUVol.SetDefaultColor(Color.GREEN);
 
Last edited:
T

Tiredoflosing

New member
VIP
I wrote this code to plot the real cumulative volume using BID and ASK transactions no the close of the candle, please take a look and let me know what do you think.

it works only for 15 min charts other wise you must change the aggregation period within the code. doesn't work with tick charts.

input displace = 0;
def ASK = tick_count(priceType = PriceType.ASK , period = AggregationPeriod.FIFTEEN_MIN);
def BID = tick_count(priceType = PriceType.BID , period = AggregationPeriod.FIFTEEN_MIN);
def MARK = tick_count(priceType = PriceType.MARK , period = AggregationPeriod.FIFTEEN_MIN);
def LAST = tick_count(priceType = PriceType.LAST , period = AggregationPeriod.FIFTEEN_MIN);

def ba = BID - ASK;

plot data = Sum(ba-displace, 100);
can you go in detail what the blue lines represent?
 
C

cesarword

New member
I think this Study works better with futures no with equities.
 
C

cesarword

New member
Is there anything close to "footprints" indicator in Thinkorswim? If so, I'd like a combination with that! Thanks
I have a code but it works best with futures take a look let me know what you think! Use 15 min time frame other wise you have to change the aggregation code for specific time fame. Doesn't work with tick charts.

Code:
declare lower;
declare zerobase;
def displace = 0;
def ASK = tick_count(priceType = PriceType.ASK, period = AggregationPeriod.FIFTEEN_MIN);
def BID = tick_count(priceType = PriceType.BID , period = AggregationPeriod.FIFTEEN_MIN);
def MARK = tick_count(priceType = PriceType.MARK , period = AggregationPeriod.FIFTEEN_MIN);
def LAST = tick_count(priceType = PriceType.LAST , period = AggregationPeriod.FIFTEEN_MIN);
def  ba = BID - ASK;
plot data = Sum(ba - displace, 100);
 
horserider

horserider

Well-known member
VIP
@cesarword
declare lower;
declare zerobase;

Input agg = aggregationPeriod.DAY;

def ASK = tick_count(priceType = PriceType.ASK, period = Agg);
def BID = tick_count(priceType = PriceType.BID , period = Agg);
def MARK = tick_count(priceType = PriceType.MARK , period = Agg);
def LAST = tick_count(priceType = PriceType.LAST , period = Agg);
def ba = BID - ASK;
plot data = Sum(ba , 100);
 

Similar threads

Top