Change Volume Profile Color?

J

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

GimmickFace

New member
@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;
 
J

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.

 
zeek

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

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

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

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
 
A

AryanP

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.
by altering the code, Im only able to change the color of the entire profile and the value area
 

Similar threads

Top