Tick Buy and Sell Volume Indicator for ThinkorSwim

BenTen

BenTen

Administrative
Staff
VIP
Warehouse
The follow 2 indicators are best used in situations where one would want to know if the majority of trading is machine-driven or not.

TicksPerVolume: Shows volume divided by ticks or in other words the volume traded divided by the number of trades. Higher means larger lots being traded and lower bar means smaller lots.

TicksBuyTicksSell: Shows the number of trades on the buy side plus the number of trades on the sell side divided by the number of trades.


thinkScript Code

Code:
declare lower;
declare zerobase;

def TradeCount = tick_count;
def MoneyCount = volume;

plot avgTradeCount = ((MoneyCount[1] + MoneyCount) / 2) / ((TradeCount + TradeCount[1]) / 2);

AvgTradeCount.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
AvgTradeCount.AssignValueColor(if TradeCount >= AvgTradeCount then Color.UPTICK else Color.DOWNTICK);

thinkScript Code

Code:
declare lower;
declare zerobase;
#plot

plot TradeCount = (((tick_count(priceType = PriceType.BID)) + (tick_count(priceType = PriceType.ASK))) / 2) / tick_count();
Credit:
 
S

SolidChiken

New member
VIP
Hi @BenTen... Thank you so much for this TicksBuyTicksSell indicator. I love it. Made some adjustment on my end to differentiate the counting of BID and ASK. Gotta use in conjuntion with volume indicator as large block of order supersede the counts.



Here's the code:

Code:
declare lower;

declare zerobase;

def TradeCountASK = tick_count(priceType = PriceType.ASK);

def TradeCountBID = tick_count(priceType = PriceType.BID);

plot TCA = TradeCountASK;

TCA.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

TCA.SetDefaultColor(Color.RED);

TCA.HideBubble();

TCA.SetLineWeight(4);

plot TCB = TradeCountBID;

TCB.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

TCB.SetDefaultColor(Color.WHITE);

TCB.HideBubble();

TCB.SetLineWeight(4);
 
Last edited by a moderator:
S

skynetgen

Active member
Warehouse
Its a great find guys! I played a bit and made diff histogram. it is quite interesting. I dont yet have the signal for it, but from first glance its shows some interesting divergence from price action
Code:
declare lower;
declare zerobase;
declare hide_on_daily;

input avglen=13;
def TradeCountASK = tick_count(priceType = PriceType.ASK);
def TradeCountBID = tick_count(priceType = PriceType.BID);

#at the ask is bullish
plot TCA = TradeCountASK;
#TCA.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
TCA.SetDefaultColor(Color.dark_green);
TCA.HideBubble();
#TCA.SetLineWeight(2);

#at the bid is bearish
plot TCB = -TradeCountBID;
#TCB.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
TCB.SetDefaultColor(Color.red);
TCB.HideBubble();
#TCB.SetLineWeight(2);

plot diff=TradeCountASK-TradeCountBID;
diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
diff.assignValueColor(if diff>0 then color.green else color.red);
plot avg=expaverage(diff,avglen);
avg.setdefaultColor(color.plum);

#plot totaldiff=Sum(diff,50);
 
S

SolidChiken

New member
VIP
Cool... Thank you @skynetgen. Gotta check it out when I'm home later
 

Top