com.dukascopy.api.indicators
Interface IIndicatorDrawingSupport


public interface IIndicatorDrawingSupport

Various helper methods to be able to draw indicators


Method Summary
 IBar[] getCandles()
          Returns array of candles.
 float getCandleWidthInPixels()
          Candle width in pixels
 int getChartHeight()
          Returns height of the panel in pixels where drawing should happen
 int getChartWidth()
          Returns width of the panel in pixels where drawing should happen
 int getIndexOfFirstCandleOnScreen()
          Index in the array of values and candles.
 Instrument getInstrument()
          Returns instrument of the chart
 float getYForValue(double value)
          Returns Y coordinate for the specified value.
 float getYForValue(int value)
          Returns Y coordinate for the specified value.
 float getMiddleOfCandle(int index)
          X coordinate of the candle with index
 int getNumberOfCandlesOnScreen()
          Returns number of candles currently visible on the screen.
 OfferSide getOfferSide()
          Return offer side of the chart or null if this is ticks chart
 Period getPeriod()
          Returns period of the chart
 float getSpaceBetweenCandlesInPixels()
          Returns number of pixels between two candles
 boolean isChartPanel()
          Returns true if Graphics passed to drawOutput method belong to main chart (where candles are shown) or false if it belongs to separate panel created for this indicator (when IndicatorInfo.isOverChart returns false).
 boolean isLastCandleInProgress()
          Returns true if the last candle is not fully formed yet
 

Method Detail

isChartPanel

boolean isChartPanel()
Returns true if Graphics passed to drawOutput method belong to main chart (where candles are shown) or false if it belongs to separate panel created for this indicator (when IndicatorInfo.isOverChart returns false).

Returns:
true for main chart and false for indicator panel under chart

getNumberOfCandlesOnScreen

int getNumberOfCandlesOnScreen()
Returns number of candles currently visible on the screen. This values is usually less than size of the array with values and array with candles

Returns:
number of candles currently visible on the screen

getIndexOfFirstCandleOnScreen

int getIndexOfFirstCandleOnScreen()
Index in the array of values and candles. Points to the first candle that is visible on the screen. Depending on type of the output (simple line for example) it may be a good idea to draw only values starting from the candle before first visible candle and to the candle after last visible candle

Returns:
index of the first visible candle in the array of values and candles

getCandleWidthInPixels

float getCandleWidthInPixels()
Candle width in pixels

Returns:
candle width in pixels

getSpaceBetweenCandlesInPixels

float getSpaceBetweenCandlesInPixels()
Returns number of pixels between two candles

Returns:
number of pixels between two candles

getMiddleOfCandle

float getMiddleOfCandle(int index)
X coordinate of the candle with index

Parameters:
index - index of the candles or/and value
Returns:
x coordinate of the candle

getYForValue

float getYForValue(double value)
Returns Y coordinate for the specified value. Coordinate is calculated depending on minimum and maximum values for indicator

Parameters:
value - indicator value
Returns:
y coordinate for the specified value

getYForValue

float getYForValue(int value)
Returns Y coordinate for the specified value. Coordinate is calculated depending on minimum and maximum values for indicator

Parameters:
value - indicator value
Returns:
y coordinate for the specified value

getCandles

IBar[] getCandles()
Returns array of candles. Each one of the candle corresponds to the value with the same index in the array of values for the current output

Returns:
array of candles with the same size as the size of the output values array

isLastCandleInProgress

boolean isLastCandleInProgress()
Returns true if the last candle is not fully formed yet

Returns:
true if last candle is in-progress candle

getChartWidth

int getChartWidth()
Returns width of the panel in pixels where drawing should happen

Returns:
width of the chart

getChartHeight

int getChartHeight()
Returns height of the panel in pixels where drawing should happen

Returns:
height of the chart

getInstrument

Instrument getInstrument()
Returns instrument of the chart

Returns:
instrument of the chart

getPeriod

Period getPeriod()
Returns period of the chart

Returns:
period of the chart

getOfferSide

OfferSide getOfferSide()
Return offer side of the chart or null if this is ticks chart

Returns:
offer side of the chart or null if this is ticks chart


Copyright © 2011. All Rights Reserved.