ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  MACD
Posted by Richard on Feb-11-2022 17:47
using the MACD on the finance chart can i get the histogram to be red when one bar is smaller than the previous bar?

  Re: MACD
Posted by Peter Kwan on Feb-13-2022 19:04
Hi Richard,

For PHP, the financial chart is implemented in the file FinanceChart.php, To achieve what you need, you have to modify the code in FInanceChart.php.

For MACD, you can look for the addMACD function in FinanceChart.php. The current implementation has around 15 lines of code. The bars are added using the addBarIndicator2. For what you need, one way is to separate the bars into two groups for the red and non-red bars. You can then use two addBarIndicator2 lines to add them with different colors.

Regards
Peter Kwan