com.dukascopy.api.system
Class Commissions

java.lang.Object
  extended by com.dukascopy.api.system.Commissions
All Implemented Interfaces:
Serializable

public class Commissions
extends Object
implements Serializable

Class allows detailed configuration of commissions. Default values are filled when class is created

See Also:
Serialized Form

Constructor Summary
Commissions(boolean custodianBankOrGuarantee)
          Creates commissions class and fills in default values
 
Method Summary
 SortedMap<Double,Double> getDepositLimits()
          Returns all deposit limits.
 SortedMap<Double,Double> getEquityLimits()
          Returns all equity limits.
 double[] getLast30DaysTurnoverAtStart()
          Returns turnover values for the last 30 days that will be used at tester start time.
 double getMaxCommission()
          Returns commission for situations when deposit, equity and turnover is less than minimum limit
 SortedMap<Double,Double> getTurnoverLimits()
          Returns all turnover limits.
 boolean isCustodianBankOrGuarantee()
          Returns true if deposit is with custodian bank or there is a bank guarantee.
 void setDepositLimit(double limit, double commission)
          Sets limits for deposit amounts.
 void setEquityLimit(double limit, double commission)
          Sets limits for equity amounts.
 void setLast30DaysTurnoverAtStart(double[] last30DaysTurnoverAtStart)
          Sets turnover values for the last 30 days that will be used at tester start time.
 void setMaxCommission(double maxCommission)
          Sets commission for situations when deposit, equity and turnover is less than minimum limit
 void setTurnoverLimit(double limit, double commission)
          Sets limits for turnover amounts.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Commissions

public Commissions(boolean custodianBankOrGuarantee)
Creates commissions class and fills in default values

Parameters:
custodianBankOrGuarantee - if true then deposit with custodian bank or bank guarantee is assumed
Method Detail

setMaxCommission

public void setMaxCommission(double maxCommission)
Sets commission for situations when deposit, equity and turnover is less than minimum limit

Parameters:
maxCommission - commission for minimum deposit, equity and turnover

getMaxCommission

public double getMaxCommission()
Returns commission for situations when deposit, equity and turnover is less than minimum limit

Returns:
commission for minimum deposit, equity and turnover

setLast30DaysTurnoverAtStart

public void setLast30DaysTurnoverAtStart(double[] last30DaysTurnoverAtStart)
                                  throws ArrayIndexOutOfBoundsException
Sets turnover values for the last 30 days that will be used at tester start time. Size of the array must be 30 elements

Parameters:
last30DaysTurnoverAtStart - turnover values for the last 30 days
Throws:
ArrayIndexOutOfBoundsException - when array length is not 30

getLast30DaysTurnoverAtStart

public double[] getLast30DaysTurnoverAtStart()
Returns turnover values for the last 30 days that will be used at tester start time. By default all values are zeros. Changing values in array will change values in Commissions class

Returns:
turnover values for the last 30 days

setDepositLimit

public void setDepositLimit(double limit,
                            double commission)
Sets limits for deposit amounts. If deposit amount at the commission calculation time is >= limit then it's value will be used. The biggest limit that complies the condition will be used to get the commission

Parameters:
limit - deposit amount limit
commission - commission to use when deposit amount is over the limit

getDepositLimits

public SortedMap<Double,Double> getDepositLimits()
Returns all deposit limits. Changes in map will result in changes of the actual map of this class

Returns:
deposit limits

setEquityLimit

public void setEquityLimit(double limit,
                           double commission)
Sets limits for equity amounts. If equity amount at the commission calculation time is >= limit then it's value will be used. The biggest limit that complies the condition will be used to get the commission

Parameters:
limit - equity amount limit
commission - commission to use when equity amount is over the limit

getEquityLimits

public SortedMap<Double,Double> getEquityLimits()
Returns all equity limits. Changes in map will result in changes of the actual map of this class

Returns:
equity limits

setTurnoverLimit

public void setTurnoverLimit(double limit,
                             double commission)
Sets limits for turnover amounts. If turnover amount at the commission calculation time is >= limit then it's value will be used. The biggest limit that complies the condition will be used to get the commission

Parameters:
limit - turnover amount limit
commission - commission to use when turnover amount is over the limit

getTurnoverLimits

public SortedMap<Double,Double> getTurnoverLimits()
Returns all turnover limits. Changes in map will result in changes of the actual map of this class

Returns:
turnover limits

isCustodianBankOrGuarantee

public boolean isCustodianBankOrGuarantee()
Returns true if deposit is with custodian bank or there is a bank guarantee. Once used in constructor to fill in correct levels, this field becomes only informational

Returns:
true if deposit is with custodian bank or there is a bank guarantee


Copyright © 2011. All Rights Reserved.