com.dukascopy.api
Interface IChart

All Superinterfaces:
Iterable<IChartObject>

public interface IChart
extends Iterable<IChartObject>

Allows to draw graphical objects on the chart

Author:
Denis Larka

Nested Class Summary
static class IChart.Type
          Type of the graphical object
 
Method Summary
 void comment(String comment)
          Writes a comment in the upper left corner.
 IChartObject draw(String key, IChart.Type type, long time1, double price1)
          Draws graphical object that requires only 1 point
 IChartObject draw(String key, IChart.Type type, long time1, double price1, long time2, double price2)
          Draws graphical object that requires up to 2 points
 IChartObject draw(String key, IChart.Type type, long time1, double price1, long time2, double price2, long time3, double price3)
          Draws graphical object that requires up to 3 points
 IChartObject get(String key)
          Returns graphical object by key
 List<IChartObject> getAll()
          Returns all graphical objects
 OfferSide getSelectedOfferSide()
           
 Period getSelectedPeriod()
           
 void move(IChartObject objectToMove, long newTime, double newPrice)
          Moves graphical object to new coordinates
 void move(String chartObjectKey, long newTime, double newPrice)
          Moves graphical object to new coordinates
 double priceMax(int index)
          Returns maximal value of the vertical scale of the specified subwindow of the current chart (0-main chart window, the indicators' subwindows are numbered starting from 1).
 double priceMin(int index)
          Returns minimal value of the vertical scale of the specified subwindow of the current chart (0-main chart window, the indicators' subwindows are numbered starting from 1).
 IChartObject remove(String key)
          Deletes and returns graphical object by key
 void removeAll()
          Removes all graphical objects on the chart
 int size()
          Returns number of the graphical objects on the chart
 int windowsTotal()
          Returns count of indicator windows on the chart (including main chart).
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

draw

IChartObject draw(String key,
                  IChart.Type type,
                  long time1,
                  double price1,
                  long time2,
                  double price2,
                  long time3,
                  double price3)
Draws graphical object that requires up to 3 points

Parameters:
key - unique id of the object
type - type of the object
time1 - time of first point
price1 - price of first point
time2 - time of second point
price2 - price of second point
time3 - time of third point
price3 - price of third point
Returns:
graphical object

draw

IChartObject draw(String key,
                  IChart.Type type,
                  long time1,
                  double price1,
                  long time2,
                  double price2)
Draws graphical object that requires up to 2 points

Parameters:
key - unique id of the object
type - type of the object
time1 - time of first point
price1 - price of first point
time2 - time of second point
price2 - price of second point
Returns:
graphical object

draw

IChartObject draw(String key,
                  IChart.Type type,
                  long time1,
                  double price1)
Draws graphical object that requires only 1 point

Parameters:
key - unique id of the object
type - type of the object
time1 - time of the point
price1 - price of the point
Returns:
graphical object

move

void move(IChartObject objectToMove,
          long newTime,
          double newPrice)
Moves graphical object to new coordinates

Parameters:
objectToMove - chart object to move
newTime - new time coordinate
newPrice - new price coordinate

move

void move(String chartObjectKey,
          long newTime,
          double newPrice)
Moves graphical object to new coordinates

Parameters:
chartObjectKey - key of the chart object to move
newTime - new time coordinate
newPrice - new price coordinate

comment

void comment(String comment)
Writes a comment in the upper left corner. Line is splitted by new line characters

Parameters:
comment - string to display

get

IChartObject get(String key)
Returns graphical object by key

Parameters:
key - unique id of the object
Returns:
graphical object or null if no object was found by specified key

remove

IChartObject remove(String key)
Deletes and returns graphical object by key

Parameters:
key - unique id of the object
Returns:
graphical object that was deleted or null if no object was found by specified key

getAll

List<IChartObject> getAll()
Returns all graphical objects

Returns:
list of all graphical objects on the chart

removeAll

void removeAll()
Removes all graphical objects on the chart


size

int size()
Returns number of the graphical objects on the chart

Returns:
number of the graphical objects on the chart

priceMin

double priceMin(int index)
Returns minimal value of the vertical scale of the specified subwindow of the current chart (0-main chart window, the indicators' subwindows are numbered starting from 1). If the subwindow index has not been specified, the minimal value of the price scale of the main chart window is returned.

Parameters:
index - of the (sub-)window
Returns:
minimal value of the vertical scale

priceMax

double priceMax(int index)
Returns maximal value of the vertical scale of the specified subwindow of the current chart (0-main chart window, the indicators' subwindows are numbered starting from 1). If the subwindow index has not been specified, the maximal value of the price scale of the main chart window is returned.

Parameters:
index - of the (sub-)window
Returns:
maximal value of the vertical scale

windowsTotal

int windowsTotal()
Returns count of indicator windows on the chart (including main chart).

Returns:
total count of chart windows (main window + indicator subwindows)

getSelectedPeriod

Period getSelectedPeriod()
Returns:
selected period

getSelectedOfferSide

OfferSide getSelectedOfferSide()
Returns:
selected offer side


Copyright © 2009. All Rights Reserved.