com.dukascopy.api
Enum Instrument

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

public enum Instrument
extends java.lang.Enum<Instrument>

Defines all currency pairs traded by Dukascopy


Enum Constant Summary
AUDCAD
           
AUDCHF
           
AUDJPY
           
AUDNZD
           
AUDSGD
           
AUDUSD
           
CADCHF
           
CADHKD
           
CADJPY
           
CHFJPY
           
CHFPLN
           
CHFSGD
           
EURAUD
           
EURBRL
           
EURCAD
           
EURCHF
           
EURDKK
           
EURGBP
           
EURHKD
           
EURHUF
           
EURJPY
           
EURMXN
           
EURNOK
           
EURNZD
           
EURPLN
           
EURRUB
           
EURSEK
           
EURSGD
           
EURTRY
           
EURUSD
           
EURZAR
           
GBPAUD
           
GBPCAD
           
GBPCHF
           
GBPJPY
           
GBPNZD
           
GBPUSD
           
HKDJPY
           
HUFJPY
           
MXNJPY
           
NZDCAD
           
NZDCHF
           
NZDJPY
           
NZDSGD
           
NZDUSD
           
SGDJPY
           
USDBRL
           
USDCAD
           
USDCHF
           
USDCZK
           
USDDKK
           
USDHKD
           
USDHUF
           
USDJPY
           
USDMXN
           
USDNOK
           
USDPLN
           
USDRON
           
USDRUB
           
USDSEK
           
USDSGD
           
USDTRY
           
USDZAR
           
XAGUSD
           
XAUUSD
           
ZARJPY
           
 
Method Summary
static boolean contains(java.lang.String instrumentString)
          Returns true if specified instrument is one of the traded instruments
 boolean equals(java.lang.String symbol)
           
static Instrument fromInvertedString(java.lang.String instrumentAsString)
          Returns corresponding inverted instrument for string in "CUR2/CUR1" format, e.g., string USD/EUR returns instrument EUR/USD, but string EUR/USD returns null
static Instrument fromString(java.lang.String instrumentAsString)
          Returns corresponding instrument for string in "CUR1/CUR2" format
static java.util.Set<Instrument> fromStringSet(java.util.Set<java.lang.String> instrumentsAsString)
           
static java.lang.String getPairsSeparator()
          Returns currency separator
 int getPipScale()
           
 double getPipValue()
          Returns value of one pip for this currency pair
 java.util.Currency getPrimaryCurrency()
          Returns primary currency of this currency pair
 java.util.Currency getSecondaryCurrency()
          Returns secondary currency of this currency pair
static boolean isInverted(java.lang.String instrumentStr)
          Returns true if instrument is inverted (such as USD/EUR or JPY/USD)
 java.lang.String toString()
           
static java.util.Set<java.lang.String> toStringSet(java.util.Collection<Instrument> instruments)
          Returns set of strings, which are instruments in "CUR1/CUR2" format
static Instrument valueOf(java.lang.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

AUDCAD

public static final Instrument AUDCAD

AUDCHF

public static final Instrument AUDCHF

AUDNZD

public static final Instrument AUDNZD

AUDSGD

public static final Instrument AUDSGD

AUDUSD

public static final Instrument AUDUSD

CADCHF

public static final Instrument CADCHF

CADHKD

public static final Instrument CADHKD

CADJPY

public static final Instrument CADJPY

CHFJPY

public static final Instrument CHFJPY

CHFPLN

public static final Instrument CHFPLN

CHFSGD

public static final Instrument CHFSGD

EURAUD

public static final Instrument EURAUD

EURBRL

public static final Instrument EURBRL

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

EURHUF

public static final Instrument EURHUF

EURJPY

public static final Instrument EURJPY

EURMXN

public static final Instrument EURMXN

EURNOK

public static final Instrument EURNOK

EURNZD

public static final Instrument EURNZD

EURPLN

public static final Instrument EURPLN

EURRUB

public static final Instrument EURRUB

EURSEK

public static final Instrument EURSEK

EURSGD

public static final Instrument EURSGD

EURTRY

public static final Instrument EURTRY

EURUSD

public static final Instrument EURUSD

EURZAR

public static final Instrument EURZAR

GBPAUD

public static final Instrument GBPAUD

GBPCAD

public static final Instrument GBPCAD

GBPCHF

public static final Instrument GBPCHF

GBPJPY

public static final Instrument GBPJPY

GBPNZD

public static final Instrument GBPNZD

GBPUSD

public static final Instrument GBPUSD

HKDJPY

public static final Instrument HKDJPY

HUFJPY

public static final Instrument HUFJPY

MXNJPY

public static final Instrument MXNJPY

NZDCAD

public static final Instrument NZDCAD

NZDCHF

public static final Instrument NZDCHF

NZDJPY

public static final Instrument NZDJPY

NZDSGD

public static final Instrument NZDSGD

NZDUSD

public static final Instrument NZDUSD

SGDJPY

public static final Instrument SGDJPY

USDBRL

public static final Instrument USDBRL

USDCAD

public static final Instrument USDCAD

USDCHF

public static final Instrument USDCHF

USDCZK

public static final Instrument USDCZK

USDDKK

public static final Instrument USDDKK

USDHKD

public static final Instrument USDHKD

USDHUF

public static final Instrument USDHUF

USDJPY

public static final Instrument USDJPY

USDMXN

public static final Instrument USDMXN

USDNOK

public static final Instrument USDNOK

USDPLN

public static final Instrument USDPLN

USDRON

public static final Instrument USDRON

USDRUB

public static final Instrument USDRUB

USDSEK

public static final Instrument USDSEK

USDSGD

public static final Instrument USDSGD

USDTRY

public static final Instrument USDTRY

USDZAR

public static final Instrument USDZAR

XAGUSD

public static final Instrument XAGUSD

XAUUSD

public static final Instrument XAUUSD

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(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

toString

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

getPairsSeparator

public static java.lang.String getPairsSeparator()
Returns currency separator

Returns:
currency separator

fromString

public static Instrument fromString(java.lang.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

fromInvertedString

public static Instrument fromInvertedString(java.lang.String instrumentAsString)
Returns corresponding inverted instrument for string in "CUR2/CUR1" format, e.g., string USD/EUR returns instrument EUR/USD, but string EUR/USD returns null

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

isInverted

public static boolean isInverted(java.lang.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 java.util.Set<java.lang.String> toStringSet(java.util.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

fromStringSet

public static java.util.Set<Instrument> fromStringSet(java.util.Set<java.lang.String> instrumentsAsString)

contains

public static boolean contains(java.lang.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 java.util.Currency getPrimaryCurrency()
Returns primary currency of this currency pair

Returns:
primary currency

getSecondaryCurrency

public java.util.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(java.lang.String symbol)


Copyright © 2012. All Rights Reserved.