|
Venice 0.74beta | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnz.org.venice.chart.graph.AbstractGraph
nz.org.venice.chart.graph.SupportAndResistenceGraph
Support and Resistence "graph". This graph draws single lines across common price occurrances. The support and resistence levels are determined by the most numerous troughs and peaks within the last year of data that have the greatest vertical separation and do not overlap. There is a new heuristic which extends the peak/trough counting by placing them into bins and counting their frequency. This improves the results for some charts. NOTE: Experimental and work in progress.
| Field Summary | |
static int |
BINS
|
static int |
HEURISTIC
|
| Fields inherited from interface nz.org.venice.chart.graph.Graph |
TOOL_TIP_BUFFER |
| Constructor Summary | |
SupportAndResistenceGraph(GraphSource source)
Create a new support and Resistence graph. |
|
SupportAndResistenceGraph(GraphSource source,
java.util.HashMap settings)
Create a new support and Resistence graph. |
|
| Method Summary | |
Graphable[] |
createSupportAndResistence(Graphable source,
Graphable support,
Graphable resistence,
int lag,
int type)
Creates a new support and resistence based on the given data source. |
double |
getHighestY(java.util.List x)
Return the highest Y value in the given X range. |
double |
getLowestY(java.util.List x)
Return the loweset Y value in the given X range. |
java.lang.String |
getName()
Return the name of this graph. |
java.lang.String |
getToolTipText(java.lang.Comparable x,
int y,
int yoffset,
double verticalScale,
double bottomLineValue)
Get the tool tip text for the given X value and y coordinate. |
GraphUI |
getUI(java.util.HashMap settings)
Returns the graph's user interface. |
boolean |
isPrimary()
Return whether the graph is a primary graph. |
void |
render(java.awt.Graphics g,
java.awt.Color c,
int xoffset,
int yoffset,
double horizontalScale,
double verticalScale,
double topLineValue,
double bottomLineValue,
java.util.List xRange,
boolean vertOrientation)
Draw the graph. |
void |
setSettings(java.util.HashMap settings)
Set the graph's user definable settings. |
| Methods inherited from class nz.org.venice.chart.graph.AbstractGraph |
dataAvailable, getAcceptableMajorDeltas, getAcceptableMinorDeltas, getEndX, getSettings, getSource, getSourceName, getSourceType, getStartX, getXRange, getY, getYLabel |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int HEURISTIC
public static final int BINS
| Constructor Detail |
public SupportAndResistenceGraph(GraphSource source)
source - containing the data source, typically day close.
public SupportAndResistenceGraph(GraphSource source,
java.util.HashMap settings)
source - containing the data source, typically day close.settings - the settings of the graph| Method Detail |
public void render(java.awt.Graphics g,
java.awt.Color c,
int xoffset,
int yoffset,
double horizontalScale,
double verticalScale,
double topLineValue,
double bottomLineValue,
java.util.List xRange,
boolean vertOrientation)
Graph
g - the Graphics object to render toc - the colour the graph should be rendered in; override
this if the graph should be drawn in
a certain colour - such as a Moving Average graphxoffset - the x offset in the graphics object where the graph
startsyoffset - the y offset in the graphics object where the graph
startshorizontalScale - horizontal scale factor; use this to convert
between X value in the xRange to a
cartesian coordinate xverticalScale - vertical scale factor; use this to convert
between Y value to a cartesian coordinate ytopLineValue - the Y value of the lowest line in the graphbottomLineValue - the Y value of the lowest line in the graphxRange - a List of Comparable
that contain the X values to plotvertOrientation - true if increasing y values mean decreasing Y values
public java.lang.String getToolTipText(java.lang.Comparable x,
int y,
int yoffset,
double verticalScale,
double bottomLineValue)
getToolTipText in interface GraphgetToolTipText in class AbstractGraphx - the X valuey - the y coordinateyoffset - y offset from top of graphverticalScale - vertical scale factorbottomLineValue - the Y value of the lowest line in the graph
public double getHighestY(java.util.List x)
AbstractGraph
getHighestY in interface GraphgetHighestY in class AbstractGraphx - range of X values
GraphSourcepublic double getLowestY(java.util.List x)
AbstractGraph
getLowestY in interface GraphgetLowestY in class AbstractGraphx - range of X values
GraphSourcepublic java.lang.String getName()
Bar Chartpublic boolean isPrimary()
Graph
true if the graph is a primary graph
public Graphable[] createSupportAndResistence(Graphable source,
Graphable support,
Graphable resistence,
int lag,
int type)
source - the graph source to averagesupport - the data points of a support lineresistence - the data points of a resistence line
Currently only the points of the most numerous peaks and troughs are used as a heuristic to determine the points of support and resistence. It's a
heuristic only, and still needs work.public void setSettings(java.util.HashMap settings)
AbstractGraph
setSettings in interface GraphsetSettings in class AbstractGraphsettings - the new settingspublic GraphUI getUI(java.util.HashMap settings)
AbstractGraphnull which indicates that the graph does not
have a user interface. If the graph does have a user interface then
it should override this method.
getUI in interface GraphgetUI in class AbstractGraphsettings - initial settings (ignored)
null
|
Venice 0.74beta | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||