How to create MACD(Moving Average Convergence Divergence)?

Discussion about JFreeChart related to stockmarket charts.
Locked
ratna

How to create MACD(Moving Average Convergence Divergence)?

Post by ratna » Thu Oct 06, 2005 1:20 pm

Anybody how to create MACD(Moving Average Convergence Divergence)?
can i create MACD by using spesial class,or i must calculate manually, and then use line chart to draw it?

Thanks before.


regards,
Ratna

Fujiko

Post by Fujiko » Sat Oct 22, 2005 6:09 pm

Here is the routine I use to calculate it:

public String [] histo2( String[] st,int n)
{
double fm26,fm12;
int k;
String [] tab =new String[2];

String [] tm= new String[n+1];
String [] ts= new String[n+1];

for( k=n-50; k <n+1; k++) {
fm26 =Float.parseFloat(calMoymeu(st,26,k));
fm12=Float.parseFloat(calMoymeu(st,12,k));

tm[k]=String.valueOf(fm12-fm26);
}
for( k=n-40; k <n+1; k++) {

ts[k]=calMoymeu(tm,9,k);
}
int iflagk,i,j;

tab[0]=tm[n];
tab[1]=ts[n];

return tab;
}

// tm and ts are respectively the fast and slow Moving Average
n is the time index (can be day,month or whatever)
st is the corresponding stock value
You have also to create Exponential Moving function(CalMoymeu) //

wzwei28
Posts: 105
Joined: Wed Mar 16, 2005 9:17 am
Location: Malaysia, Earth
Contact:

Post by wzwei28 » Mon Nov 07, 2005 11:15 am

are u want something like this...(I created using JFreeChart few months ago)

Image

If yes, u have to calculate everything & combined the Line Chart with the histogram...(1 weeks may done it)

regards,
wei wei.[/url]

wzwei28
Posts: 105
Joined: Wed Mar 16, 2005 9:17 am
Location: Malaysia, Earth
Contact:

Post by wzwei28 » Tue Nov 08, 2005 9:58 am

Forget to tell, calculation algorithm of MACD and other technical indicators like Stochastic oscillator, ADX, Chaikin Money Flow, Bollinger Bands at following URL:

http://stockcharts.com/education/Indica ... index.html

I had also compare it with several famous URL. It is correct & tested by QE/QA team.... The algorithm for technical indicators above in this website is accurate...

If u have any doubts, maybe I can help (if I am capable to do so).

regards,
wei wei.

Guest

Post by Guest » Sat Nov 19, 2005 6:48 am

I'm matamicoka, Just Wanna Say Hi
ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage

Guest

Post by Guest » Mon Nov 21, 2005 11:00 am

check http://www.activestocks.de/ccapi for indicator implementations in java.
Thanks,
If you find errors, please report them.

Thanks,
Ulrich

ratna

MACD

Post by ratna » Thu Nov 24, 2005 1:08 pm

Thank u all
:)

Locked