com.dukascopy.api
Enum Instrument

java.lang.Object
  extended by java.lang.Enum<Instrument>
      extended by com.dukascopy.api.Instrument
All Implemented Interfaces:
Serializable, Comparable<Instrument>

public enum Instrument
extends Enum<Instrument>

Defines all currency pairs traded by Dukascopy


Enum Constant Summary
AUDCAD
           
AUDCHF
           
AUDJPY
           
AUDNZD
           
AUDUSD
           
CADCHF
           
CADJPY
           
CHFJPY
           
EURAUD
           
EURCAD
           
EURCHF
           
EURDKK
           
EURGBP
           
EURHKD
           
EURHUF
           
EURJPY
           
EURNOK
           
EURNZD
           
EURPLN
           
EURSEK
           
EURTRY
           
EURUSD
           
GBPAUD
           
GBPCAD
           
GBPCHF
           
GBPJPY
           
GBPNZD
           
GBPUSD
           
NZDCAD
           
NZDCHF
           
NZDJPY
           
NZDUSD
           
USDCAD
           
USDCHF
           
USDCZK
           
USDDKK
           
USDHKD
           
USDHUF
           
USDJPY
           
USDMXN
           
USDNOK
           
USDPLN
           
USDRON
           
USDRUB
           
USDSEK
           
USDSGD
           
USDTRY
           
USDZAR
           
XAGUSD
           
XAUUSD
           
ZARJPY
           
 
Method Summary
static boolean contains(String instrumentString)
          Returns true if specified instrument is one of the traded instruments
 boolean equals(String symbol)
           
static Instrument fromString(String instrumentAsString)
          Returns corresponding instrument for string in "CUR1/CUR2" format
static String getPairsSeparator()
          Returns currency separator
 int getPipScale()
           
 double getPipValue()
          Returns value of one pip for this currency pair
 Currency getPrimaryCurrency()
          Returns primary currency of this currency pair
 Currency getSecondaryCurrency()
          Returns secondary currency of this currency pair
static boolean isInverted(String instrumentStr)
          Returns true if instrument is inverted (such as USD/EUR or JPY/USD)
 String toString()
           
static Set<String> toStringSet(Collection<Instrument> instruments)
          Returns set of strings, which are instruments in "CUR1/CUR2" format
static Instrument valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Instrument[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

AUDJPY

public static final Instrument AUDJPY

AUDNZD

public static final Instrument AUDNZD

AUDUSD

public static final Instrument AUDUSD

CADJPY

public static final Instrument CADJPY

CHFJPY

public static final Instrument CHFJPY

EURAUD

public static final Instrument EURAUD

EURCAD

public static final Instrument EURCAD

EURCHF

public static final Instrument EURCHF

EURDKK

public static final Instrument EURDKK

EURGBP

public static final Instrument EURGBP

EURHKD

public static final Instrument EURHKD

EURJPY

public static final Instrument EURJPY

EURNOK

public static final Instrument EURNOK

EURSEK

public static final Instrument EURSEK

EURUSD

public static final Instrument EURUSD

GBPCHF

public static final Instrument GBPCHF

GBPJPY

public static final Instrument GBPJPY

GBPUSD

public static final Instrument GBPUSD

NZDUSD

public static final Instrument NZDUSD

USDCAD

public static final Instrument USDCAD

USDCHF

public static final Instrument USDCHF

USDDKK

public static final Instrument USDDKK

USDHKD

public static final Instrument USDHKD

USDJPY

public static final Instrument USDJPY

USDMXN

public static final Instrument USDMXN

USDNOK

public static final Instrument USDNOK

USDSEK

public static final Instrument USDSEK

USDSGD

public static final Instrument USDSGD

USDTRY

public static final Instrument USDTRY

AUDCAD

public static final Instrument AUDCAD

AUDCHF

public static final Instrument AUDCHF

CADCHF

public static final Instrument CADCHF

EURNZD

public static final Instrument EURNZD

GBPAUD

public static final Instrument GBPAUD

GBPCAD

public static final Instrument GBPCAD

GBPNZD

public static final Instrument GBPNZD

NZDCAD

public static final Instrument NZDCAD

NZDCHF

public static final Instrument NZDCHF

NZDJPY

public static final Instrument NZDJPY

XAUUSD

public static final Instrument XAUUSD

XAGUSD

public static final Instrument XAGUSD

EURHUF

public static final Instrument EURHUF

EURPLN

public static final Instrument EURPLN

EURTRY

public static final Instrument EURTRY

USDCZK

public static final Instrument USDCZK

USDHUF

public static final Instrument USDHUF

USDPLN

public static final Instrument USDPLN

USDRON

public static final Instrument USDRON

USDRUB

public static final Instrument USDRUB

USDZAR

public static final Instrument USDZAR

ZARJPY

public static final Instrument ZARJPY
Method Detail

values

public static Instrument[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Instrument c : Instrument.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Instrument valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

toString

public String toString()
Overrides:
toString in class Enum<Instrument>

getPairsSeparator

public static String getPairsSeparator()
Returns currency separator

Returns:
currency separator

fromString

public static Instrument fromString(String instrumentAsString)
Returns corresponding instrument for string in "CUR1/CUR2" format

Parameters:
instrumentAsString - string in "CUR1/CUR2" format
Returns:
corresponding instrument or null if no instrument was found for specified string

isInverted

public static boolean isInverted(String instrumentStr)
Returns true if instrument is inverted (such as USD/EUR or JPY/USD)

Parameters:
instrumentStr - instrument string representation
Returns:
true if inverted, false if not inverted or not instrument

toStringSet

public static Set<String> toStringSet(Collection<Instrument> instruments)
Returns set of strings, which are instruments in "CUR1/CUR2" format

Parameters:
instruments - collection of instruments
Returns:
set of strings in "CUR1/CUR2" format

contains

public static boolean contains(String instrumentString)
Returns true if specified instrument is one of the traded instruments

Parameters:
instrumentString - instrument to check
Returns:
true if corresponding instrument was found, false otherwise

getPrimaryCurrency

public Currency getPrimaryCurrency()
Returns primary currency of this currency pair

Returns:
primary currency

getSecondaryCurrency

public Currency getSecondaryCurrency()
Returns secondary currency of this currency pair

Returns:
secondary currency

getPipValue

public double getPipValue()
Returns value of one pip for this currency pair

Returns:
pip

getPipScale

public int getPipScale()

equals

public boolean equals(String symbol)


Copyright © 2011. All Rights Reserved.