You can subscribe to this list here.
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(12) |
Jun
(12) |
Jul
(5) |
Aug
(8) |
Sep
(15) |
Oct
(6) |
Nov
(13) |
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
(1) |
Apr
(5) |
May
(1) |
Jun
(4) |
Jul
|
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2013 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Josh T. <nli...@ya...> - 2012-06-27 13:07:07
|
http://arcabrindes.com.br/dfgqp.html |
|
From: Steve G. <sgr...@gm...> - 2012-05-29 01:47:05
|
Hi, I need some changes made to Chartsy and I am willing to pay. I need the following changes: 1) Read favorites from database 2) Store/read chartFrame to database on close of chart (currently serializes on program exit) If interested, can you please contact me regard costs? Thanks, Steve |
|
From: (coinfreak) <bit...@gm...> - 2011-08-03 16:14:22
|
>From https://github.com/chartsy/chartsy/pull/1 Fixing trivial build errors |
|
From: (coinfreak) <bit...@gm...> - 2011-08-03 16:12:58
|
>From https://github.com/chartsy/chartsy/pull/2 |
|
From: (coinfreak) <bit...@gm...> - 2011-08-03 16:11:55
|
>From https://github.com/chartsy/chartsy/pull/3 Make sure that data provider supports desired interval. |
|
From: (coinfreak) <bit...@gm...> - 2011-08-03 15:58:41
|
Hi everyone! I've made Chartsy repository mirror on GitHub and reserved "chartsy" organization name for possible future use while working on my derived project. Take a look please to: http://github.com/chartsy/ At now I'm only admin member of this organization and its project and I want to transfer admin rights and organization ownership to real developers. Regards, coinfreak! |
|
From: Josh T. <nli...@ya...> - 2011-06-29 00:14:12
|
No documentation unfortunately. There are some very basic tutorials on the website. This is about all you can do in Chartsy right now unless you've got some decent development skills. Other things will come along in time where developers will provide "frameworks" for creating or altering or adding to the program. I'm not sure what's up next though. ________________________________ From: Kee Haskins <kee...@gm...> To: cha...@li... Sent: Tue, June 28, 2011 2:36:42 PM Subject: Re: [Chartsy-devel] NetBeans 7.0 and the latest chartsy doesn't build? Are there any design documents that layout the architecture of the program? Documentation stating where and how the data is stored, which programs or classes are responsible for what etc.? I’ve been looking at the program and there are a lot of modules contained in the program. Some of them are obvious, some not so much. Kee From:Josh Taylor [mailto:nli...@ya...] Sent: Tuesday, June 28, 2011 6:24 AM To: cha...@li... Subject: Re: [Chartsy-devel] NetBeans 7.0 and the latest chartsy doesn't build? Apologies for the late response to this. I've been VERY busy with my current job. The fix actually is easy... use Netbeans 6.9.1. We haven't converted over to 7.0 yet that Iknow of. Plus, the error says it's looking for hte 6.9.x build harness. Stick with 6.9.1 for now. I have both 6.9.1 and v7.0 on my machine at the moment. I haven't contributed to Chartsy since last October but I just haven't had a chance. I'll be finishing up the TA-Lib technical indicators integration when I can get back to it. I have the Japanese Candlestick recognition code to integrate. Good luck. 6.9.1 should work for you. r, josh ________________________________ From:Frank Wang <fra...@ya...> To: "cha...@li..." <cha...@li...> Sent: Sun, June 26, 2011 1:54:25 AM Subject: [Chartsy-devel] NetBeans 7.0 and the latest chartsy doesn't build? Hi, I am a new subscriber to this list. Pulled down the source along with the new NetBeans 7.0. When I try to build, I got the following error: C:\projects\chartsy\trunk\Chartsy\build.xml:7: The following error occurred while executing this line: C:\projects\chartsy\trunk\Chartsy\nbproject\build-impl.xml:41: Cannot find NetBeans build harness. Check that nbplatform.NetBeans_IDE_6.9_(Build_201006101454).netbeans.dest.dir and nbplatform.NetBeans_IDE_6.9_(Build_201006101454).harness.dir are defined. On a developer machine these are normally defined in C:\Users\johndoe\.netbeans\7.0\build.properties=C:\Users\johndoe\.netbeans\7.0/build.properties but for automated builds you should pass these properties to Ant explicitly. Any easy fix that exists? thanks Frank |
|
From: Kee H. <kee...@gm...> - 2011-06-28 18:36:50
|
Are there any design documents that layout the architecture of the program? Documentation stating where and how the data is stored, which programs or classes are responsible for what etc.? I've been looking at the program and there are a lot of modules contained in the program. Some of them are obvious, some not so much. Kee From: Josh Taylor [mailto:nli...@ya...] Sent: Tuesday, June 28, 2011 6:24 AM To: cha...@li... Subject: Re: [Chartsy-devel] NetBeans 7.0 and the latest chartsy doesn't build? Apologies for the late response to this. I've been VERY busy with my current job. The fix actually is easy... use Netbeans 6.9.1. We haven't converted over to 7.0 yet that Iknow of. Plus, the error says it's looking for hte 6.9.x build harness. Stick with 6.9.1 for now. I have both 6.9.1 and v7.0 on my machine at the moment. I haven't contributed to Chartsy since last October but I just haven't had a chance. I'll be finishing up the TA-Lib technical indicators integration when I can get back to it. I have the Japanese Candlestick recognition code to integrate. Good luck. 6.9.1 should work for you. r, josh _____ From: Frank Wang <fra...@ya...> To: "cha...@li..." <cha...@li...> Sent: Sun, June 26, 2011 1:54:25 AM Subject: [Chartsy-devel] NetBeans 7.0 and the latest chartsy doesn't build? Hi, I am a new subscriber to this list. Pulled down the source along with the new NetBeans 7.0. When I try to build, I got the following error: C:\projects\chartsy\trunk\Chartsy\build.xml:7: The following error occurred while executing this line: C:\projects\chartsy\trunk\Chartsy\nbproject\build-impl.xml:41: Cannot find NetBeans build harness. Check that nbplatform.NetBeans_IDE_6.9_(Build_201006101454).netbeans.dest.dir and nbplatform.NetBeans_IDE_6.9_(Build_201006101454).harness.dir are defined. On a developer machine these are normally defined in C:\Users\johndoe\.netbeans\7.0\build.properties=C:\Users\johndoe\.netbeans\7 .0/build.properties but for automated builds you should pass these properties to Ant explicitly. Any easy fix that exists? thanks Frank |
|
From: Josh T. <nli...@ya...> - 2011-06-28 10:24:06
|
Apologies for the late response to this. I've been VERY busy with my current job. The fix actually is easy... use Netbeans 6.9.1. We haven't converted over to 7.0 yet that Iknow of. Plus, the error says it's looking for hte 6.9.x build harness. Stick with 6.9.1 for now. I have both 6.9.1 and v7.0 on my machine at the moment. I haven't contributed to Chartsy since last October but I just haven't had a chance. I'll be finishing up the TA-Lib technical indicators integration when I can get back to it. I have the Japanese Candlestick recognition code to integrate. Good luck. 6.9.1 should work for you. r, josh ________________________________ From: Frank Wang <fra...@ya...> To: "cha...@li..." <cha...@li...> Sent: Sun, June 26, 2011 1:54:25 AM Subject: [Chartsy-devel] NetBeans 7.0 and the latest chartsy doesn't build? Hi, I am a new subscriber to this list. Pulled down the source along with the new NetBeans 7.0. When I try to build, I got the following error: C:\projects\chartsy\trunk\Chartsy\build.xml:7: The following error occurred while executing this line: C:\projects\chartsy\trunk\Chartsy\nbproject\build-impl.xml:41: Cannot find NetBeans build harness. Check that nbplatform.NetBeans_IDE_6.9_(Build_201006101454).netbeans.dest.dir and nbplatform.NetBeans_IDE_6.9_(Build_201006101454).harness.dir are defined. On a developer machine these are normally defined in C:\Users\johndoe\.netbeans\7.0\build.properties=C:\Users\johndoe\.netbeans\7.0/build.properties but for automated builds you should pass these properties to Ant explicitly. Any easy fix that exists? thanks Frank |
|
From: Frank W. <fra...@ya...> - 2011-06-26 05:54:32
|
Hi, I am a new subscriber to this list. Pulled down the source along with the new NetBeans 7.0. When I try to build, I got the following error: C:\projects\chartsy\trunk\Chartsy\build.xml:7: The following error occurred while executing this line: C:\projects\chartsy\trunk\Chartsy\nbproject\build-impl.xml:41: Cannot find NetBeans build harness. Check that nbplatform.NetBeans_IDE_6.9_(Build_201006101454).netbeans.dest.dir and nbplatform.NetBeans_IDE_6.9_(Build_201006101454).harness.dir are defined. On a developer machine these are normally defined in C:\Users\johndoe\.netbeans\7.0\build.properties=C:\Users\johndoe\.netbeans\7.0/build.properties but for automated builds you should pass these properties to Ant explicitly. Any easy fix that exists? thanks Frank |
|
From: Kee H. <kee...@gm...> - 2011-05-16 14:27:29
|
Is there a forum where you discuss development changes or is this it? I've used forums in the past but never mailing lists. I remember hearing about mailing lists 20 years ago but I've actually never been on one or used one. Before I submit any questions or write any code I want to make sure I'm in the right place. Kee Haskins |
|
From: Josh T. <nli...@ya...> - 2011-04-18 13:19:44
|
Thanks Vio. I will download 6.9.1 and continue the development. I worked my way through the JUnit issue with 7.0. It's a nasty issue with the JUnit integration into that baseline delivery for Netbeans. Not an easily solvable problem and not solvable in the GUI. If the issue persists in release 7.0. I can tell you guys how to overcome it. It's not a natural progression of logic. I had to find a way to fix it without changing our project file. respectfully, josh ________________________________ From: Viorel Gheba <vio...@gm...> To: cha...@li... Sent: Mon, April 18, 2011 4:21:42 AM Subject: Re: [Chartsy-devel] no dependent module error JUnit Hi Josh, We are still developing Chartsy in NetBeans 6.9.1. The next version of Chartsy 1.5.0 will be developed on NetBeans 7.0, but there will be major changes. For now you should continue to develop the TALib on NetBeans 6.9.1. Best regards, Viorel ------------------------------------------------------------------------------ Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev _______________________________________________ Chartsy-devel mailing list Cha...@li... https://lists.sourceforge.net/lists/listinfo/chartsy-devel |
|
From: Viorel G. <vio...@gm...> - 2011-04-18 08:21:47
|
Hi Josh, We are still developing Chartsy in NetBeans 6.9.1. The next version of Chartsy 1.5.0 will be developed on NetBeans 7.0, but there will be major changes. For now you should continue to develop the TALib on NetBeans 6.9.1. Best regards, Viorel |
|
From: Josh T. <nli...@ya...> - 2011-04-17 17:12:28
|
guys, I just downloaded Netbeans 7.0 rc2 and when I go to do a clean and build on Chartsy I get: C:\Program Files\NetBeans 7.0 RC2\harness\suite.xml:182: The following error occurred while executing this line: C:\Program Files\NetBeans 7.0 RC2\harness\build.xml:171: No dependent module org.netbeans.libs.junit4 I tried downloading and installing (NBv6.9) org.netbeans.libs.junit4 and re-running the clean and build to no effect. I'm looking all over in my IDE for some way to set JUnit to "Global" but it's not coming up anywhere. I can't even find the dang thing except in my installed plugins but you can't do anything with it there. This is clearly an IDE thing and not a Chartsy thing. Is there something I need to manually edit that I don't know about? I shouldn't have to go and manually edit something knowing full well the edit might mess up Chartsy on your systems. What is the resolution to this problem? have you encountered this? I'm assuming you have already overcome this issue. r, josh |
|
From: Alex H. <hig...@gm...> - 2011-04-14 06:33:08
|
Hi all, There is a small improvement I've been meaning to find the time to implement. But I'm not Java programmer, so I just thought I'd mention it in case somebody else was up for it. With the fibonnaci indicator, I want to be able to set my own fib lines, and to set the colours for each line. So, for instance, I'd want to be able to set a 85% retrace line, and give it my own colour, say yellow. I'd like to make the 61.8% retrace red and the 38.2% retrace green. With the projection tool, I'd like to have the same ability. I'd like to be able to set my own projection levels and colour them. This ability should be application wide. So that every time I draw a retrace it uses my preset colours. Then I can click on the individual retracements and recolour them if I wish. I did take a look at the code a few months back and it seemed relatively clean. I'm willing to have a crack at it if nobody else is interested. Cheers, Alex |
|
From: Josh T. <nli...@ya...> - 2011-04-10 23:29:48
|
All,
I'm back to coding chartsy starting this week. I will finish where I left off
with the TA-Lib integration and I will do the candle indicators next. I will
download the latest code tomorrow night.
I was thinking about how to efficiently use indicators in chartsy. It will be
important most especially for the candle indicator calculations. I think we have
a requirement that should read something like: "The chart shall update
indicators only once at each new time bar." The goal is to allow candlesticks to
update as needed but the indicators should only be calculated at the moment
of each new candle being created. The logical flow is something like:
if (Not New Time Bar){
update Timebar Data
}
else //it's a new time bar so....
{
update Timebar Data
update indicator data
}
It's not meant to be beautiful code but it's meant to show the idea. This should
be done because the indicator associated with any timebar is representative of
the complete calculation up to that bar. This means that whatever activity that
happens in that timebar is not calculated until that timebar ends and the new
timebar opens. Then the resulting indicator calculation is performed and the
result of all activity including the most recent timebar closure is represented
above the current active timebar. the complete calculation of an indicator above
any timebar is based on all the timebars before it only and does not include any
activity from the timebar with which it is associated.
Knowing this, we can insure that indicator calculations only happen once at the
beginning of the active timebar. I'm not sure Chartsy does this but I'm going to
investigate it to see if this has been considered already. This will greatly
enhance the ability of the AI framework (next on my list) to perform it's
functions and calculations without worrying about chart performance, CPU usage,
memory management, etc, etc. Some of the indicator calculations can be
monstrous.
I look forward to contributing again!
respectfully,
Josh |
|
From: Josh T. <nli...@ya...> - 2011-03-11 13:35:48
|
Hello Chartsy crew, Sorry I haven't been in contact. I've had some issues with my previous company not being able to stay in business so I was looking for another company to keep me employed. I have been picked up by Accenture now and am leading the engineering of a key piece of a cool new project (www.paywithisis.com). It has been keeping me quite busy and I haven't had a lot of time to put toward Chartsy. I'm hoping as I get into a "rhythm" on this project that I'll be able to spend some time on Chartsy at night or on the weekends. I still want to complete the TA-Lib integration. Apologies for leaving that half-way implemented. Also I will still be interested in building out the A.I. Framework that can be leveraged by developers. I'm thinking if my current work schedule becomes predictable and consistent that I can be back to building out Chartsy by late next month or May. I travel a lot for this job and it's early in development for this contract so my schedule and work duties are crazy right now. I will stay in touch and hopefully before the summer I will be back to contributing to Chartsy. Josh |
|
From: Alex L. <dj...@gm...> - 2010-11-17 14:59:06
|
Hi Laurentiu I will try to use the new chart for awhile, to verify that there are no other problems in it and that I got it right. When I'm done, I'll send you my details. Thanks for the help guys. Alex. On Wed, Nov 17, 2010 at 4:54 PM, Laurentiu Matei <la...@mr...> wrote: > Hi Alex, > > We would appreciate if you can make the plugin available for everyone, of > course. > > Also, if you're interested in becoming a constant code contributor please > give me your sf.net username and I will give you svn access (you also need > to sign the CLA at the bottom of this page: > http://www.chartsy.org/community). > > If not, you can just send the code and we'll add it. > > > > On 11/17/2010 4:49 PM, Alex Lourie wrote: > > Hi Viorel! > > You're great! It works now! > > Should I somehow post the plugin for everyone to use? > > On Wed, Nov 17, 2010 at 4:38 PM, Viorel Gheba <vio...@gm...> wrote: > >> Hi Alex, >> >> Problem solved. EMA and MACD plugins are now private. I made them public, >> but you need to update them. >> 1. Uninstall Elder Impulse Chart. >> 2. Update SMA and MACD plugins >> 3. Install again Elder Impulse Chart >> >> Best regards, >> Viorel >> > > > > -- > Alex Lourie > > > ------------------------------------------------------------------------------ > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > Spend less time writing and rewriting code and more time creating great > experiences on the web. Be a part of the beta todayhttp://p.sf.net/sfu/msIE9-sfdev2dev > > > _______________________________________________ > Chartsy-devel mailing lis...@li...://lists.sourceforge.net/lists/listinfo/chartsy-devel > > > > -- > Dipl. Eng. Laurentiu Matei > MrSwing Senior Engineerwww.mrswing.com > > > > ------------------------------------------------------------------------------ > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > Spend less time writing and rewriting code and more time creating great > experiences on the web. Be a part of the beta today > http://p.sf.net/sfu/msIE9-sfdev2dev > _______________________________________________ > Chartsy-devel mailing list > Cha...@li... > https://lists.sourceforge.net/lists/listinfo/chartsy-devel > > -- Alex Lourie |
|
From: Laurentiu M. <la...@mr...> - 2010-11-17 14:54:53
|
Hi Alex, We would appreciate if you can make the plugin available for everyone, of course. Also, if you're interested in becoming a constant code contributor please give me your sf.net username and I will give you svn access (you also need to sign the CLA at the bottom of this page: http://www.chartsy.org/community). If not, you can just send the code and we'll add it. On 11/17/2010 4:49 PM, Alex Lourie wrote: > Hi Viorel! > > You're great! It works now! > > Should I somehow post the plugin for everyone to use? > > On Wed, Nov 17, 2010 at 4:38 PM, Viorel Gheba <vio...@gm... > <mailto:vio...@gm...>> wrote: > > Hi Alex, > > Problem solved. EMA and MACD plugins are now private. I made them > public, but you need to update them. > 1. Uninstall Elder Impulse Chart. > 2. Update SMA and MACD plugins > 3. Install again Elder Impulse Chart > > Best regards, > Viorel > > > > > -- > Alex Lourie > > > ------------------------------------------------------------------------------ > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2& L3. > Spend less time writing and rewriting code and more time creating great > experiences on the web. Be a part of the beta today > http://p.sf.net/sfu/msIE9-sfdev2dev > > > _______________________________________________ > Chartsy-devel mailing list > Cha...@li... > https://lists.sourceforge.net/lists/listinfo/chartsy-devel -- Dipl. Eng. Laurentiu Matei MrSwing Senior Engineer www.mrswing.com |
|
From: Alex L. <dj...@gm...> - 2010-11-17 14:49:19
|
Hi Viorel! You're great! It works now! Should I somehow post the plugin for everyone to use? On Wed, Nov 17, 2010 at 4:38 PM, Viorel Gheba <vio...@gm...> wrote: > Hi Alex, > > Problem solved. EMA and MACD plugins are now private. I made them public, > but you need to update them. > 1. Uninstall Elder Impulse Chart. > 2. Update SMA and MACD plugins > 3. Install again Elder Impulse Chart > > Best regards, > Viorel > -- Alex Lourie |
|
From: Josh T. <nli...@ya...> - 2010-11-17 12:39:55
|
Alex,
First, "org.charty.macd" and "org.charty.ema" are mispelled. They are missing the "s" in chartsy. That's why they aren't valid packages.
Next, if you have created a module in Chartsy to build your chart, do the following:-Right click the Chartsy Project Module in the "Project" Panel.-Select "sources" in the left pane.-Your module should appear in the right pane in the long list of Chartsy modules. If not, select "add" and find your module. This should not be your problem though but covering all bases here.
for whatever reason, I've found on two occasions that a module (random) stops showing up in that list on my system. Not sure if it's something I'm doing when building/compiling/submitting or what but it seems rare and sporadic for now so I'm not worried.
Now, if the above doesn't fix your problem, go into the Project panel again, got to Chartsy project, open the "modules" folder, and find your module. If you did the above, it's visible in the list in this folder.- double click your module and then scroll down/up in the project pane to where it is opened.- Right click your opened module and select "properties"- Select Libraries in the left pane- Select "Module Dependencies" tab in the right pane- you should see "Moving Average Convergence/Divergence" and "Exponential Moving Average" listed in the module dependencies. If not, add them via "Add Dependency."
Inside the Chartsy project, all modules are accessible only in so far as you identify them as dependencies. This is the Netbeans approach as well and it's a very solid approach to creating, protecting, and managing code. If none of this works, let us know.
Josh
--- On Wed, 11/17/10, Alex Lourie <dj...@gm...> wrote:
From: Alex Lourie <dj...@gm...>
Subject: Re: [Chartsy-devel] Developing a new chart
To: cha...@li...
Date: Wednesday, November 17, 2010, 5:56 AM
Hi Viorel
How do I:
1. Make sure that EMA and MACD packages are included in project libraries (I've added them as non-api module dependencies in NetBeans. Is it enough?).
2. Make EMA and MACD public packages - How do I do that?
In addition, I've added your example code but NetBeans doesn't "see" org.charty.macd and org.charty.ema as valid packages.
Thank you for your help.
On Wed, Nov 17, 2010 at 12:17 PM, Alex Lourie <dj...@gm...> wrote:
Hi Viorel!
Thank you so much for the help. I've tried to do this on my own and came up with something similar.
I now only have 2 questions:
1. I think that the more correct code would be:
if (emaDataset.getDataItem(i) != null && emaDataset.getDataItem(i-1) != null
&& macdDataset.getDataItem(i) != null && macdDataset.getDataItem(i-1) != null)
{
if (emaDataset.getCloseAt(i) > emaDataset.getCloseAt(i-1) && macdDataset.getCloseAt(i) > macdDataset.getCloseAt(i-1) )
g.setColor(Color.GREEN);
else if (emaDataset.getCloseAt(i) < emaDataset.getCloseAt(i-1) && macdDataset.getCloseAt(i) < macdDataset.getCloseAt(i-1))
g.setColor(Color.RED);
else
g.setColor(Color.BLUE);
}
2. Should it just compile? I had a problem at home with compiling this module for some reason...
On Wed, Nov 17, 2010 at 11:24 AM, Viorel Gheba <vio...@gm...> wrote:
Hi Alex
I tried to make a chart as you described.
This is the code that i used:
package org.chartsy.testmodule;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import org.chartsy.ema.EMA;
import org.chartsy.ema.OverlayProperties;
import org.chartsy.macd.IndicatorProperties;
import org.chartsy.macd.MACD;
import org.chartsy.main.ChartFrame;
import org.chartsy.main.ChartProperties;
import org.chartsy.main.chart.Chart;
import org.chartsy.main.data.ChartData;
import org.chartsy.main.data.Dataset;
import org.chartsy.main.utils.CoordCalc;
import org.chartsy.main.utils.Range;
import org.chartsy.main.utils.SerialVersion;
import org.chartsy.main.utils.StrokeGenerator;
/**
*
* @author Viorel
*/
public class TestChart extends Chart
{
private static final long serialVersionUID =
SerialVersion.APPVERSION;
private EMA ema;
private MACD macd;
private Dataset mainDataset;
public TestChart()
{
ema = new EMA();
OverlayProperties emaProps =
ema.getNode().getLookup().lookup(OverlayProperties.class);
emaProps.setPeriod(13);
macd = new MACD();
IndicatorProperties macdProps =
macd.getNode().getLookup().lookup(IndicatorProperties.class);
macdProps.setFast(12);
macdProps.setSlow(26);
macdProps.setSmooth(9);
}
private void setDataset(Dataset dataset)
{
if (mainDataset == null)
{
mainDataset = dataset;
calculateDatasets();
}
else if (!mainDataset.equals(dataset))
{
mainDataset = dataset;
calculateDatasets();
}
}
private void calculateDatasets()
{
ema.setDataset(mainDataset);
ema.calculate();
macd.setDataset(mainDataset);
macd.calculate();
}
@Override public String getName()
{
return "Test Chart";
}
@Override public void paint(Graphics2D g, ChartFrame cf)
{
setDataset(cf.getChartData().getDataset());
ChartData cd = cf.getChartData();
ChartProperties cp = cf.getChartProperties();
Rectangle rect =
cf.getSplitPanel().getChartPanel().getBounds();
rect.grow(-2, -2);
Range range = cf.getSplitPanel().getChartPanel().getRange();
Dataset dataset = cd.getVisible();
Dataset emaDataset = ema.visibleDataset(cf, EMA.EMA);
Dataset macdDataset = macd.visibleDataset(cf,
MACD.HISTOGRAM);
if (dataset != null && emaDataset != null &&
macdDataset != null)
{
g.setStroke(StrokeGenerator.getStroke(3));
int count = emaDataset.getItemsCount();
for (int i = 0; i < count; i++)
{
double open = dataset.getOpenAt(i);
double close = dataset.getCloseAt(i);
double high = dataset.getHighAt(i);
double low = dataset.getLowAt(i);
double x = cd.getX(i, rect);
double yOpen = cd.getY(open, rect, range);
double yClose = cd.getY(close, rect, range);
double yHigh = cd.getY(high, rect, range);
double yLow = cd.getY(low, rect, range);
double candleWidth = cp.getBarWidth();
if (emaDataset.getDataItem(i) != null
&& macdDataset.getDataItem(i) != null)
{
if (emaDataset.getCloseAt(i) > close
&& macdDataset.getCloseAt(i) > 0)
g.setColor(Color.GREEN);
else if (emaDataset.getCloseAt(i) < close
&& macdDataset.getCloseAt(i) < 0)
g.setColor(Color.RED);
else
g.setColor(Color.BLUE);
}
else
{
g.setColor(Color.BLUE);
}
g.draw(CoordCalc.line(x, yLow, x, yHigh));
g.draw(CoordCalc.line(x, yOpen, x - candleWidth/2,
yOpen));
g.draw(CoordCalc.line(x, yClose, x + candleWidth/2,
yClose));
}
}
}
}
You ca see that I copied the OHLC code.
Note:
- Make sure that EMA and MACD packages are included in your project
libraries.
- Make EMA and MACD public packages.
For more questions, please contact us.
Best regards,
Viorel
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Chartsy-devel mailing list
Cha...@li...
https://lists.sourceforge.net/lists/listinfo/chartsy-devel
--
Alex Lourie
--
Alex Lourie
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
-----Inline Attachment Follows-----
_______________________________________________
Chartsy-devel mailing list
Cha...@li...
https://lists.sourceforge.net/lists/listinfo/chartsy-devel
|
|
From: Viorel G. <vio...@gm...> - 2010-11-17 11:04:45
|
Hi Alex, I'll send some screenshots on your email. Best regards, Viorel |
|
From: Alex L. <dj...@gm...> - 2010-11-17 10:56:34
|
Hi Viorel
How do I:
1. Make sure that EMA and MACD packages are included in project libraries
(I've added them as non-api module dependencies in NetBeans. Is it enough?).
2. Make EMA and MACD public packages - How do I do that?
In addition, I've added your example code but NetBeans doesn't "see"
org.charty.macd and org.charty.ema as valid packages.
Thank you for your help.
On Wed, Nov 17, 2010 at 12:17 PM, Alex Lourie <dj...@gm...> wrote:
> Hi Viorel!
>
> Thank you so much for the help. I've tried to do this on my own and came up
> with something similar.
>
> I now only have 2 questions:
>
> 1. I think that the more correct code would be:
>
> if (emaDataset.getDataItem(i) != null && emaDataset.getDataItem(i-1) !=
> null
> && macdDataset.getDataItem(i) != null &&
> macdDataset.getDataItem(i-1) != null)
> {
> if (emaDataset.getCloseAt(i)
> > emaDataset.getCloseAt(i-1)
> && macdDataset.getCloseAt(i)
> > macdDataset.getCloseAt(i-1) )
> g.setColor(Color.GREEN);
> else if (emaDataset.getCloseAt(i)
> < emaDataset.getCloseAt(i-1)
> && macdDataset.getCloseAt(i)
> < macdDataset.getCloseAt(i-1))
> g.setColor(Color.RED);
> else
> g.setColor(Color.BLUE);
> }
>
> 2. Should it just compile? I had a problem at home with compiling this
> module for some reason...
>
>
> On Wed, Nov 17, 2010 at 11:24 AM, Viorel Gheba <vio...@gm...> wrote:
>
>> Hi Alex
>>
>> I tried to make a chart as you described.
>> This is the code that i used:
>>
>>
>> package org.chartsy.testmodule;
>>
>> import java.awt.Color;
>> import java.awt.Graphics2D;
>> import java.awt.Rectangle;
>> import org.chartsy.ema.EMA;
>> import org.chartsy.ema.OverlayProperties;
>> import org.chartsy.macd.IndicatorProperties;
>> import org.chartsy.macd.MACD;
>> import org.chartsy.main.ChartFrame;
>> import org.chartsy.main.ChartProperties;
>> import org.chartsy.main.chart.Chart;
>> import org.chartsy.main.data.ChartData;
>> import org.chartsy.main.data.Dataset;
>> import org.chartsy.main.utils.CoordCalc;
>> import org.chartsy.main.utils.Range;
>> import org.chartsy.main.utils.SerialVersion;
>> import org.chartsy.main.utils.StrokeGenerator;
>>
>> /**
>> *
>> * @author Viorel
>> */
>> public class TestChart extends Chart
>> {
>>
>> private static final long serialVersionUID = SerialVersion.APPVERSION;
>> private EMA ema;
>> private MACD macd;
>>
>> private Dataset mainDataset;
>>
>> public TestChart()
>> {
>> ema = new EMA();
>> OverlayProperties emaProps =
>> ema.getNode().getLookup().lookup(OverlayProperties.class);
>> emaProps.setPeriod(13);
>> macd = new MACD();
>> IndicatorProperties macdProps =
>> macd.getNode().getLookup().lookup(IndicatorProperties.class);
>> macdProps.setFast(12);
>> macdProps.setSlow(26);
>> macdProps.setSmooth(9);
>> }
>>
>> private void setDataset(Dataset dataset)
>> {
>> if (mainDataset == null)
>> {
>> mainDataset = dataset;
>> calculateDatasets();
>> }
>> else if (!mainDataset.equals(dataset))
>> {
>> mainDataset = dataset;
>> calculateDatasets();
>> }
>> }
>>
>> private void calculateDatasets()
>> {
>> ema.setDataset(mainDataset);
>> ema.calculate();
>> macd.setDataset(mainDataset);
>> macd.calculate();
>> }
>>
>> @Override public String getName()
>> {
>> return "Test Chart";
>> }
>>
>> @Override public void paint(Graphics2D g, ChartFrame cf)
>> {
>> setDataset(cf.getChartData().getDataset());
>>
>> ChartData cd = cf.getChartData();
>> ChartProperties cp = cf.getChartProperties();
>> Rectangle rect = cf.getSplitPanel().getChartPanel().getBounds();
>> rect.grow(-2, -2);
>> Range range = cf.getSplitPanel().getChartPanel().getRange();
>>
>> Dataset dataset = cd.getVisible();
>> Dataset emaDataset = ema.visibleDataset(cf, EMA.EMA);
>> Dataset macdDataset = macd.visibleDataset(cf, MACD.HISTOGRAM);
>>
>> if (dataset != null && emaDataset != null && macdDataset != null)
>> {
>> g.setStroke(StrokeGenerator.getStroke(3));
>>
>> int count = emaDataset.getItemsCount();
>> for (int i = 0; i < count; i++)
>> {
>> double open = dataset.getOpenAt(i);
>> double close = dataset.getCloseAt(i);
>> double high = dataset.getHighAt(i);
>> double low = dataset.getLowAt(i);
>>
>> double x = cd.getX(i, rect);
>> double yOpen = cd.getY(open, rect, range);
>> double yClose = cd.getY(close, rect, range);
>> double yHigh = cd.getY(high, rect, range);
>> double yLow = cd.getY(low, rect, range);
>>
>> double candleWidth = cp.getBarWidth();
>>
>> if (emaDataset.getDataItem(i) != null
>> && macdDataset.getDataItem(i) != null)
>> {
>> if (emaDataset.getCloseAt(i) > close &&
>> macdDataset.getCloseAt(i) > 0)
>> g.setColor(Color.GREEN);
>> else if (emaDataset.getCloseAt(i) < close &&
>> macdDataset.getCloseAt(i) < 0)
>> g.setColor(Color.RED);
>> else
>> g.setColor(Color.BLUE);
>> }
>> else
>> {
>> g.setColor(Color.BLUE);
>> }
>>
>> g.draw(CoordCalc.line(x, yLow, x, yHigh));
>> g.draw(CoordCalc.line(x, yOpen, x - candleWidth/2,
>> yOpen));
>> g.draw(CoordCalc.line(x, yClose, x + candleWidth/2,
>> yClose));
>> }
>> }
>> }
>>
>> }
>>
>> You ca see that I copied the OHLC code.
>> Note:
>> - Make sure that EMA and MACD packages are included in your project
>> libraries.
>> - Make EMA and MACD public packages.
>>
>> For more questions, please contact us.
>> Best regards,
>> Viorel
>>
>>
>> ------------------------------------------------------------------------------
>> Beautiful is writing same markup. Internet Explorer 9 supports
>> standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
>> Spend less time writing and rewriting code and more time creating great
>> experiences on the web. Be a part of the beta today
>> http://p.sf.net/sfu/msIE9-sfdev2dev
>> _______________________________________________
>> Chartsy-devel mailing list
>> Cha...@li...
>> https://lists.sourceforge.net/lists/listinfo/chartsy-devel
>>
>>
>
>
> --
> Alex Lourie
>
--
Alex Lourie
|
|
From: Viorel G. <vio...@gm...> - 2010-11-17 10:29:29
|
On 17.11.2010 12:17, cha...@li... wrote: > Send Chartsy-devel mailing list submissions to > cha...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/chartsy-devel > or, via email, send a message with subject or body 'help' to > cha...@li... > > You can reach the person managing the list at > cha...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Chartsy-devel digest..." > > > Today's Topics: > > 1. Developing a new chart (Viorel Gheba) > 2. Re: Developing a new chart (Alex Lourie) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 17 Nov 2010 11:24:09 +0200 > From: Viorel Gheba<vio...@gm...> > Subject: [Chartsy-devel] Developing a new chart > To: cha...@li... > Message-ID:<4CE...@gm...> > Content-Type: text/plain; charset="iso-8859-1" > > Hi Alex > > I tried to make a chart as you described. > This is the code that i used: > > > package org.chartsy.testmodule; > > import java.awt.Color; > import java.awt.Graphics2D; > import java.awt.Rectangle; > import org.chartsy.ema.EMA; > import org.chartsy.ema.OverlayProperties; > import org.chartsy.macd.IndicatorProperties; > import org.chartsy.macd.MACD; > import org.chartsy.main.ChartFrame; > import org.chartsy.main.ChartProperties; > import org.chartsy.main.chart.Chart; > import org.chartsy.main.data.ChartData; > import org.chartsy.main.data.Dataset; > import org.chartsy.main.utils.CoordCalc; > import org.chartsy.main.utils.Range; > import org.chartsy.main.utils.SerialVersion; > import org.chartsy.main.utils.StrokeGenerator; > > /** > * > * @author Viorel > */ > public class TestChart extends Chart > { > > private static final long serialVersionUID = SerialVersion.APPVERSION; > private EMA ema; > private MACD macd; > > private Dataset mainDataset; > > public TestChart() > { > ema = new EMA(); > OverlayProperties emaProps = > ema.getNode().getLookup().lookup(OverlayProperties.class); > emaProps.setPeriod(13); > macd = new MACD(); > IndicatorProperties macdProps = > macd.getNode().getLookup().lookup(IndicatorProperties.class); > macdProps.setFast(12); > macdProps.setSlow(26); > macdProps.setSmooth(9); > } > > private void setDataset(Dataset dataset) > { > if (mainDataset == null) > { > mainDataset = dataset; > calculateDatasets(); > } > else if (!mainDataset.equals(dataset)) > { > mainDataset = dataset; > calculateDatasets(); > } > } > > private void calculateDatasets() > { > ema.setDataset(mainDataset); > ema.calculate(); > macd.setDataset(mainDataset); > macd.calculate(); > } > > @Override public String getName() > { > return "Test Chart"; > } > > @Override public void paint(Graphics2D g, ChartFrame cf) > { > setDataset(cf.getChartData().getDataset()); > > ChartData cd = cf.getChartData(); > ChartProperties cp = cf.getChartProperties(); > Rectangle rect = cf.getSplitPanel().getChartPanel().getBounds(); > rect.grow(-2, -2); > Range range = cf.getSplitPanel().getChartPanel().getRange(); > > Dataset dataset = cd.getVisible(); > Dataset emaDataset = ema.visibleDataset(cf, EMA.EMA); > Dataset macdDataset = macd.visibleDataset(cf, MACD.HISTOGRAM); > > if (dataset != null&& emaDataset != null&& macdDataset != null) > { > g.setStroke(StrokeGenerator.getStroke(3)); > > int count = emaDataset.getItemsCount(); > for (int i = 0; i< count; i++) > { > double open = dataset.getOpenAt(i); > double close = dataset.getCloseAt(i); > double high = dataset.getHighAt(i); > double low = dataset.getLowAt(i); > > double x = cd.getX(i, rect); > double yOpen = cd.getY(open, rect, range); > double yClose = cd.getY(close, rect, range); > double yHigh = cd.getY(high, rect, range); > double yLow = cd.getY(low, rect, range); > > double candleWidth = cp.getBarWidth(); > > if (emaDataset.getDataItem(i) != null > && macdDataset.getDataItem(i) != null) > { > if (emaDataset.getCloseAt(i)> close&& > macdDataset.getCloseAt(i)> 0) > g.setColor(Color.GREEN); > else if (emaDataset.getCloseAt(i)< close&& > macdDataset.getCloseAt(i)< 0) > g.setColor(Color.RED); > else > g.setColor(Color.BLUE); > } > else > { > g.setColor(Color.BLUE); > } > > g.draw(CoordCalc.line(x, yLow, x, yHigh)); > g.draw(CoordCalc.line(x, yOpen, x - candleWidth/2, yOpen)); > g.draw(CoordCalc.line(x, yClose, x + candleWidth/2, > yClose)); > } > } > } > > } > > You ca see that I copied the OHLC code. > Note: > - Make sure that EMA and MACD packages are included in your project > libraries. > - Make EMA and MACD public packages. > > For more questions, please contact us. > Best regards, > Viorel > -------------- next part -------------- > An HTML attachment was scrubbed... > > ------------------------------ > > Message: 2 > Date: Wed, 17 Nov 2010 12:17:07 +0200 > From: Alex Lourie<dj...@gm...> > Subject: Re: [Chartsy-devel] Developing a new chart > To: cha...@li... > Message-ID: > <AAN...@ma...> > Content-Type: text/plain; charset="iso-8859-1" > > Hi Viorel! > > Thank you so much for the help. I've tried to do this on my own and came up > with something similar. > > I now only have 2 questions: > > 1. I think that the more correct code would be: > > if (emaDataset.getDataItem(i) != null&& emaDataset.getDataItem(i-1) != null > && macdDataset.getDataItem(i) != null&& > macdDataset.getDataItem(i-1) != null) > { > if (emaDataset.getCloseAt(i) >> emaDataset.getCloseAt(i-1) > && macdDataset.getCloseAt(i) >> macdDataset.getCloseAt(i-1) ) > g.setColor(Color.GREEN); > else if (emaDataset.getCloseAt(i) > < emaDataset.getCloseAt(i-1) > && macdDataset.getCloseAt(i) > < macdDataset.getCloseAt(i-1)) > g.setColor(Color.RED); > else > g.setColor(Color.BLUE); > } > > 2. Should it just compile? I had a problem at home with compiling this > module for some reason... > > > On Wed, Nov 17, 2010 at 11:24 AM, Viorel Gheba<vio...@gm...> wrote: > >> Hi Alex >> >> I tried to make a chart as you described. >> This is the code that i used: >> >> >> package org.chartsy.testmodule; >> >> import java.awt.Color; >> import java.awt.Graphics2D; >> import java.awt.Rectangle; >> import org.chartsy.ema.EMA; >> import org.chartsy.ema.OverlayProperties; >> import org.chartsy.macd.IndicatorProperties; >> import org.chartsy.macd.MACD; >> import org.chartsy.main.ChartFrame; >> import org.chartsy.main.ChartProperties; >> import org.chartsy.main.chart.Chart; >> import org.chartsy.main.data.ChartData; >> import org.chartsy.main.data.Dataset; >> import org.chartsy.main.utils.CoordCalc; >> import org.chartsy.main.utils.Range; >> import org.chartsy.main.utils.SerialVersion; >> import org.chartsy.main.utils.StrokeGenerator; >> >> /** >> * >> * @author Viorel >> */ >> public class TestChart extends Chart >> { >> >> private static final long serialVersionUID = SerialVersion.APPVERSION; >> private EMA ema; >> private MACD macd; >> >> private Dataset mainDataset; >> >> public TestChart() >> { >> ema = new EMA(); >> OverlayProperties emaProps = >> ema.getNode().getLookup().lookup(OverlayProperties.class); >> emaProps.setPeriod(13); >> macd = new MACD(); >> IndicatorProperties macdProps = >> macd.getNode().getLookup().lookup(IndicatorProperties.class); >> macdProps.setFast(12); >> macdProps.setSlow(26); >> macdProps.setSmooth(9); >> } >> >> private void setDataset(Dataset dataset) >> { >> if (mainDataset == null) >> { >> mainDataset = dataset; >> calculateDatasets(); >> } >> else if (!mainDataset.equals(dataset)) >> { >> mainDataset = dataset; >> calculateDatasets(); >> } >> } >> >> private void calculateDatasets() >> { >> ema.setDataset(mainDataset); >> ema.calculate(); >> macd.setDataset(mainDataset); >> macd.calculate(); >> } >> >> @Override public String getName() >> { >> return "Test Chart"; >> } >> >> @Override public void paint(Graphics2D g, ChartFrame cf) >> { >> setDataset(cf.getChartData().getDataset()); >> >> ChartData cd = cf.getChartData(); >> ChartProperties cp = cf.getChartProperties(); >> Rectangle rect = cf.getSplitPanel().getChartPanel().getBounds(); >> rect.grow(-2, -2); >> Range range = cf.getSplitPanel().getChartPanel().getRange(); >> >> Dataset dataset = cd.getVisible(); >> Dataset emaDataset = ema.visibleDataset(cf, EMA.EMA); >> Dataset macdDataset = macd.visibleDataset(cf, MACD.HISTOGRAM); >> >> if (dataset != null&& emaDataset != null&& macdDataset != null) >> { >> g.setStroke(StrokeGenerator.getStroke(3)); >> >> int count = emaDataset.getItemsCount(); >> for (int i = 0; i< count; i++) >> { >> double open = dataset.getOpenAt(i); >> double close = dataset.getCloseAt(i); >> double high = dataset.getHighAt(i); >> double low = dataset.getLowAt(i); >> >> double x = cd.getX(i, rect); >> double yOpen = cd.getY(open, rect, range); >> double yClose = cd.getY(close, rect, range); >> double yHigh = cd.getY(high, rect, range); >> double yLow = cd.getY(low, rect, range); >> >> double candleWidth = cp.getBarWidth(); >> >> if (emaDataset.getDataItem(i) != null >> && macdDataset.getDataItem(i) != null) >> { >> if (emaDataset.getCloseAt(i)> close&& >> macdDataset.getCloseAt(i)> 0) >> g.setColor(Color.GREEN); >> else if (emaDataset.getCloseAt(i)< close&& >> macdDataset.getCloseAt(i)< 0) >> g.setColor(Color.RED); >> else >> g.setColor(Color.BLUE); >> } >> else >> { >> g.setColor(Color.BLUE); >> } >> >> g.draw(CoordCalc.line(x, yLow, x, yHigh)); >> g.draw(CoordCalc.line(x, yOpen, x - candleWidth/2, yOpen)); >> g.draw(CoordCalc.line(x, yClose, x + candleWidth/2, >> yClose)); >> } >> } >> } >> >> } >> >> You ca see that I copied the OHLC code. >> Note: >> - Make sure that EMA and MACD packages are included in your project >> libraries. >> - Make EMA and MACD public packages. >> >> For more questions, please contact us. >> Best regards, >> Viorel >> >> >> ------------------------------------------------------------------------------ >> Beautiful is writing same markup. Internet Explorer 9 supports >> standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2& L3. >> Spend less time writing and rewriting code and more time creating great >> experiences on the web. Be a part of the beta today >> http://p.sf.net/sfu/msIE9-sfdev2dev >> _______________________________________________ >> Chartsy-devel mailing list >> Cha...@li... >> https://lists.sourceforge.net/lists/listinfo/chartsy-devel >> >> > Hi Alex, 1. My code was an example :). Make the changes that you need to implement the new chart. 2. Can you please send me the error text? Best regards, Viorel |
|
From: Alex L. <dj...@gm...> - 2010-11-17 10:17:15
|
Hi Viorel!
Thank you so much for the help. I've tried to do this on my own and came up
with something similar.
I now only have 2 questions:
1. I think that the more correct code would be:
if (emaDataset.getDataItem(i) != null && emaDataset.getDataItem(i-1) != null
&& macdDataset.getDataItem(i) != null &&
macdDataset.getDataItem(i-1) != null)
{
if (emaDataset.getCloseAt(i)
> emaDataset.getCloseAt(i-1)
&& macdDataset.getCloseAt(i)
> macdDataset.getCloseAt(i-1) )
g.setColor(Color.GREEN);
else if (emaDataset.getCloseAt(i)
< emaDataset.getCloseAt(i-1)
&& macdDataset.getCloseAt(i)
< macdDataset.getCloseAt(i-1))
g.setColor(Color.RED);
else
g.setColor(Color.BLUE);
}
2. Should it just compile? I had a problem at home with compiling this
module for some reason...
On Wed, Nov 17, 2010 at 11:24 AM, Viorel Gheba <vio...@gm...> wrote:
> Hi Alex
>
> I tried to make a chart as you described.
> This is the code that i used:
>
>
> package org.chartsy.testmodule;
>
> import java.awt.Color;
> import java.awt.Graphics2D;
> import java.awt.Rectangle;
> import org.chartsy.ema.EMA;
> import org.chartsy.ema.OverlayProperties;
> import org.chartsy.macd.IndicatorProperties;
> import org.chartsy.macd.MACD;
> import org.chartsy.main.ChartFrame;
> import org.chartsy.main.ChartProperties;
> import org.chartsy.main.chart.Chart;
> import org.chartsy.main.data.ChartData;
> import org.chartsy.main.data.Dataset;
> import org.chartsy.main.utils.CoordCalc;
> import org.chartsy.main.utils.Range;
> import org.chartsy.main.utils.SerialVersion;
> import org.chartsy.main.utils.StrokeGenerator;
>
> /**
> *
> * @author Viorel
> */
> public class TestChart extends Chart
> {
>
> private static final long serialVersionUID = SerialVersion.APPVERSION;
> private EMA ema;
> private MACD macd;
>
> private Dataset mainDataset;
>
> public TestChart()
> {
> ema = new EMA();
> OverlayProperties emaProps =
> ema.getNode().getLookup().lookup(OverlayProperties.class);
> emaProps.setPeriod(13);
> macd = new MACD();
> IndicatorProperties macdProps =
> macd.getNode().getLookup().lookup(IndicatorProperties.class);
> macdProps.setFast(12);
> macdProps.setSlow(26);
> macdProps.setSmooth(9);
> }
>
> private void setDataset(Dataset dataset)
> {
> if (mainDataset == null)
> {
> mainDataset = dataset;
> calculateDatasets();
> }
> else if (!mainDataset.equals(dataset))
> {
> mainDataset = dataset;
> calculateDatasets();
> }
> }
>
> private void calculateDatasets()
> {
> ema.setDataset(mainDataset);
> ema.calculate();
> macd.setDataset(mainDataset);
> macd.calculate();
> }
>
> @Override public String getName()
> {
> return "Test Chart";
> }
>
> @Override public void paint(Graphics2D g, ChartFrame cf)
> {
> setDataset(cf.getChartData().getDataset());
>
> ChartData cd = cf.getChartData();
> ChartProperties cp = cf.getChartProperties();
> Rectangle rect = cf.getSplitPanel().getChartPanel().getBounds();
> rect.grow(-2, -2);
> Range range = cf.getSplitPanel().getChartPanel().getRange();
>
> Dataset dataset = cd.getVisible();
> Dataset emaDataset = ema.visibleDataset(cf, EMA.EMA);
> Dataset macdDataset = macd.visibleDataset(cf, MACD.HISTOGRAM);
>
> if (dataset != null && emaDataset != null && macdDataset != null)
> {
> g.setStroke(StrokeGenerator.getStroke(3));
>
> int count = emaDataset.getItemsCount();
> for (int i = 0; i < count; i++)
> {
> double open = dataset.getOpenAt(i);
> double close = dataset.getCloseAt(i);
> double high = dataset.getHighAt(i);
> double low = dataset.getLowAt(i);
>
> double x = cd.getX(i, rect);
> double yOpen = cd.getY(open, rect, range);
> double yClose = cd.getY(close, rect, range);
> double yHigh = cd.getY(high, rect, range);
> double yLow = cd.getY(low, rect, range);
>
> double candleWidth = cp.getBarWidth();
>
> if (emaDataset.getDataItem(i) != null
> && macdDataset.getDataItem(i) != null)
> {
> if (emaDataset.getCloseAt(i) > close &&
> macdDataset.getCloseAt(i) > 0)
> g.setColor(Color.GREEN);
> else if (emaDataset.getCloseAt(i) < close &&
> macdDataset.getCloseAt(i) < 0)
> g.setColor(Color.RED);
> else
> g.setColor(Color.BLUE);
> }
> else
> {
> g.setColor(Color.BLUE);
> }
>
> g.draw(CoordCalc.line(x, yLow, x, yHigh));
> g.draw(CoordCalc.line(x, yOpen, x - candleWidth/2, yOpen));
> g.draw(CoordCalc.line(x, yClose, x + candleWidth/2,
> yClose));
> }
> }
> }
>
> }
>
> You ca see that I copied the OHLC code.
> Note:
> - Make sure that EMA and MACD packages are included in your project
> libraries.
> - Make EMA and MACD public packages.
>
> For more questions, please contact us.
> Best regards,
> Viorel
>
>
> ------------------------------------------------------------------------------
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
> Spend less time writing and rewriting code and more time creating great
> experiences on the web. Be a part of the beta today
> http://p.sf.net/sfu/msIE9-sfdev2dev
> _______________________________________________
> Chartsy-devel mailing list
> Cha...@li...
> https://lists.sourceforge.net/lists/listinfo/chartsy-devel
>
>
--
Alex Lourie
|