Creative plotting of volume
Author: infiltrator
Creation Date: 2/15/2009 12:44 AM
profile picture

infiltrator

#1
The WealthScript Programming Guide shows the following example of how to plot volume ABOVE the PricePane:

CODE:
Please log in to see this code.


Let’s say you want to plot volume BELOW the PricePane. If you change the parameter in CreatePane to display below the PricePane:
ChartPane myVolumePane = CreatePane(40, false, true);
Then the bar colors all appear black. By removing the HideVolume() command and changing the colors, I found that what’s happening is that the SetSeriesBarColor is affecting the volume bars which appear with the PricePane regardless of whether they are hidden with the HideVolume() command. This is probably because SetSeriesBarColor is acting on Bars.Volume. Is there a way to plot the volume bars in a separate pane below the PricePane and still apply the green and red colors like the example does? Any help would be greatly appreciated.
profile picture

Eugene

#2
Looks like a bug which affects the Volume series. If you would plot any other series, they would be colored properly.

Here's a quick workaround:
CODE:
Please log in to see this code.
profile picture

infiltrator

#3
Excellent, thank you Eugene! I found other uses for your DataSeries trick as well. For example, if I want to change the label for a line, I can use code similar to your workaround. In this example I can have the close lines labeled “Close(symbol)” instead of just “Close”:
CODE:
Please log in to see this code.

There may be a better way to change the labels, but I haven’t found one yet. I am curious why I didn’t have to multiply Bars.Close*1 to make this work yet the volume had to be “Bars.Volume*1”?
profile picture

Eugene

#4
QUOTE:
why I didn’t have to multiply Bars.Close*1 to make this work yet the volume had to be “Bars.Volume*1”?

It seems like some bug is hiding there. Thank you for the heads-up.
profile picture

infiltrator

#5
Thanks for the help Eugene