Click here to Login




How to create histogram charts

Updated on 2012-02-24





First, we will add a simple indicator then we will transform the line chart into a bar or histogram chart.


Steps:

- Create a new pane by right clicking on a chart then selecting "Create new pane"
- In the new pane, add a new indicator (Example: Moving Average or MACD). For more info regarding how to add a technical analysis indicator to a chart, read the following how-to article: How to add a trading indicator to a chart
- Click on the third icon (at the top of your pane) or right click on the chart, select "Update formula dynamically" then select the formula you have just added (The formula that calculates and plots your indicator).
- In the new popup, select the "Plot" tab
- Update the "chart type" property and set it to "ChartBar"

You have just created your first histogram chart.

If you analyze the formula behind the graph you will see that changing a line chart to a bar chart, simply involves changing the forth parameter of the "Plot" function.



a = Macd(); // Calculates the Moving Average Convergence-Divergence or MACD of a stock
Plot(a, "Macd", colorBlack, ChartBar, StyleSymbolNone);


The above instruction plots a histogram of the MACD indicator while the following one plots a line:

Plot(a, "Macd", colorBlack, ChartLine, StyleSymbolNone);








no comments (Log in)

Back







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