Convert ThinkorSwim Volume Profile Color

tu3m

New member
@BenTen Does anyone have a custom script for TOS Volume Profile that chages the profile color to red/green to show buying and selling vs the single color that it currently uses. TradingView has their volume profile color coded see image below, wondering if this is possible in ThinkorSwim.
DsuGC1rm.png
 

tu3m

New member
@tu3m Please explain how red is always larger than the green yet the price goes up. Could it be buying(green) total volume(red) ?
thats based on the levels that's been set in the volume profile setting, you can adjust how far back it should calculate in that particular picture the setting was 100 levels, not entire chart that you see.
 

jrob0124

New member
Is it possible to change the color of the volume with the Volume Profile to show red\green so that it is possible to view how much volume is sold and bought at each price point? I know stockcharts.com has the ability to do this, but I don't see if available in TOS. Any help with making this possible would be greatly appreciated. If there is another indicator or way to see this information please let me know. Thank you!
 
@jrob0124 try this:

Code:
declare lower;
declare zerobase;

input length = 50;

plot Vol = volume;
plot VolAvg = Average(volume, length);

Vol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Vol.SetLineWeight(3);
Vol.DefineColor("Up", Color.UPTICK);
Vol.DefineColor("Down", Color.DOWNTICK);
Vol.AssignValueColor(if close > close[1] then Vol.color("Up") else if close < close[1] then Vol.color("Down") else GetColor(1));
VolAvg.SetDefaultColor(GetColor(8));
alert( Crosses( Vol, VolAvg, CrossingDirection.ABOVE), concat("Vol has exceeded the ", concat(length, " bar VolAvg")),Alert.ONCE,Sound.Ring);



input length2 = 10;
input paintBars = no;

def isGreen = close > close[length2] and volume > volume[length2];
def isBlue = close > close[length2] and volume < volume[length2];
def isOrange = close < close[length2] and volume < volume[length2];
def isRed = close < close[length2] and volume > volume[length2];



Vol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Vol.SetLineWeight(3);
Vol.DefineColor("Green", Color.GREEN);
Vol.DefineColor("Blue", Color.BLUE);
Vol.DefineColor("Orange", Color.ORANGE);
Vol.DefineColor("Red", Color.RED);
Vol.AssignValueColor(if isGreen then Vol.color("Green") else if isBlue then Vol.color("Blue") else if isOrange then Vol.color("Orange") else if isRed then Vol.color("Red") else Color.LIGHT_GRAY);

DefineGlobalColor("Green", Color.GREEN);
DefineGlobalColor("Blue", Color.BLUE);
DefineGlobalColor("Orange", Color.ORANGE);
DefineGlobalColor("Red", Color.RED);
AssignPriceColor(if !paintBars then Color.CURRENT else if isGreen then globalColor("Green") else if isBlue then globalColor("Blue") else if isOrange then globalColor("Orange") else if isRed then globalColor("Red") else Color.LIGHT_GRAY);
   
plot scan = volume > VolAvg and sum(isGreen, 2) >= 2;
 

jrob0124

New member
@GimmickFace thanks for the reply.

That is not exactly what I was referring to. I should have been more descriptive in my original post.

TOS has a VolumeProfile indicator which shows the volume per price. I would like to be able to see if the volume is red (sold) or green (buy).

Here is an example with the VolumeProfile on the right.

roOjfFf.png
 

zeek

Active member
2019 Donor
This request has been raised before in some other thread here but i havn’t seen any such study yet. I know what you mean and i use VP too on all of my charts. It would be very useful to have buy vs sell coded as red/green colors in the profile.

Here’s hoping it can be done and that someone can code it for us.
 

jrob0124

New member
@zeek Yes, it is available on stockcharts and tradingview so I 'think' it could be done in TOS. I have never written a thinkscript before, but the VolumeProfile code is public, so I think it would be just altering the code to should the difference between bought and sold volume.

Hopefully, someone with more experience than me can help us out.
 

JADragon3

New member
Is it possible to change the color of the volume with the Volume Profile to show red\green so that it is possible to view how much volume is sold and bought at each price point? I know stockcharts.com has the ability to do this, but I don't see if available in TOS. Any help with making this possible would be greatly appreciated. If there is another indicator or way to see this information please let me know. Thank you!


What you are looking for is Volume Profile with Delta coloring. Other platforms have this option and is very useful. Someone please ping this post if a skilled coder ever decides to figure it out for TOS. That what be great.
 

inthefutures

Active member
The volume profile plots are done using profile plots not standard plots and are very hard to work with, if not at this stage impossible. but would be pleased to have someone tell me i am wrong
 

MotaB

New member
hello

is there any script study or code to modify the volume profile colors in thinkorswim : to change the bars to green and red (buy volume green sell volume red) such as:

DsuGC1rm.png



i realy need this ,, thanx
 

zeek

Active member
2019 Donor
This request has been raised here before but to my knowledge, there is no such script avaliable yet.
I am interested in this as well.
 

Similar threads

Top