Click here to Login





How to change volume bar colors when the price closes down

Updated on 2011-04-23 04:46:11

Share |

Default volume bar colors can be changed by right clicking on one bar, selecting the "Volume" tab then updating the "color" field. You can choose one or two colors, update the alpha or opacity of each one of these colors and even the direction of the colors.

The same color settings will be applied to all volume bars, unless you explicitly specify a different color for each bar depending on a measure, value or formula. Changing the bar colors dynamically is done by adding "UpdateColor" function in the chart formula.

Steps:

- Right click on the chart then select "Edit Formula"
- Select the formula that displays the volume bars (Plot(volume...). You can update the active formula by clicking on the left/right arrows in the Formula Editor menu bar.
- After the (Plot(volume...) line, type the following line:
UpdateColor(perf(close, 1) < 0, colorRed|20);

The "UpdateColor" function updates the color of the last 'Plot' formula. The first argument is the condition it will check to determine whether to update a bar color or not.

In our example, the color of a volume bar is changed if on the same bar, the price of the asset has closed down.
The color is changed to Red with an alpha value of 20. (255 means that bar is completely opaque, while a value of 0 means that the bar is fully transparent).










no reviews (Log in)







Other how-to articles




How to create volume bar charts





How to dynamically change the number of positions in a portfolio?





How to display the bar index of a stock on a chart





How to download new quotes when selecting a chart





How to download a trading item from the Sharing Server





How to perform a basic quantitative analysis using the S&P 500





How to plot the ratio of two stocks





How to add a metric in the trading system simulation report





How to create trading rules based on Put and Call volume data







QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.