public interface ITesterClient
Contains methods to control testing process
| Nested Class Summary | |
|---|---|
static class |
ITesterClient.DataLoadingMethod
Different ticks loading methods Depending on selected method different amount of ticks will be passed to the IStrategy.onTick() method |
static class |
ITesterClient.InterpolationMethod
Different technics of how to convert bars into ticks |
| Method Summary | |
|---|---|
void |
createReport(java.io.File file)
Deprecated. use createReport(long, File) instead |
void |
createReport(long processId,
java.io.File file)
Will create and write report into the given file. |
java.util.concurrent.Future<?> |
downloadData(LoadingProgressListener loadingProgressListener)
Downloads data into the local cache. |
Commissions |
getCommissions()
Returns Commissions object filled with limits and corresponding commissions for deposit, equity and turnover amounts |
boolean |
getEventLogEnabled()
Returns true if event log enabled |
boolean |
getGatherReportData()
Deprecated. use createReport(long, File) instead |
double |
getInitialDeposit()
Returns initial deposit |
java.util.Currency |
getInitialDepositCurrency()
Return deposit currency |
int |
getLeverage()
Returns leverage |
int |
getMarginCutLevel()
Returns margin cut level in percents |
double |
getMCEquity()
Returns minimum equity amount |
Overnights |
getOvernights()
Returns Overnights object |
boolean |
getProcessingStats()
Returns true if processing stats enabled |
ITesterReportData |
getReportData(long processId)
Returns object containing results of the execution of a strategy. |
void |
setCommissions(Commissions commissions)
Sets the commissions information. |
void |
setDataInterval(ITesterClient.DataLoadingMethod dataLoadingMethod,
long from,
long to)
Sets the DataLoadingMethod to use for ticks generation and time interval when to start and end testing process. |
void |
setDataInterval(Period period,
OfferSide offerSide,
ITesterClient.InterpolationMethod interpolationMethod,
long from,
long to)
Sets the period to use for ticks generation and time interval when to start and end testing process. |
void |
setEventLogEnabled(boolean eventLogEnabled)
If true then event log information will be collected when strategy is run. |
void |
setGatherReportData(boolean gatherReportData)
Deprecated. use createReport(long, File) instead |
void |
setInitialDeposit(java.util.Currency currency,
double deposit)
Sets initial deposit amount and currency. |
void |
setLeverage(int leverage)
Sets leverage. |
void |
setMarginCutLevel(int mcLevel)
Sets level in percents, exceeding which the system will start margin cut procedure reducing use of leverage. |
void |
setMCEquity(double mcEquity)
Sets minimum equity amount. |
void |
setOvernights(Overnights overnights)
Sets the overnight vales. |
void |
setProcessingStatsEnabled(boolean processingStats)
If true then the tester will collect statistics about processing time in different subsystems. |
long |
startStrategy(IStrategy strategy,
IStrategyExceptionHandler exceptionHandler,
LoadingProgressListener testerProgressListener)
Starts the strategy |
long |
startStrategy(IStrategy strategy,
LoadingProgressListener testerProgressListener)
Starts the strategy |
long |
startStrategy(IStrategy strategy,
LoadingProgressListener testerProgressListener,
ITesterExecution testerExecution,
ITesterUserInterface testerUserInterface)
Starts the strategy |
long |
startStrategy(IStrategy strategy,
LoadingProgressListener testerProgressListener,
ITesterVisualModeParameters testerVisualModeParameters,
ITesterExecution testerExecution,
ITesterUserInterface testerUserInterface)
Starts the strategy |
| Methods inherited from interface com.dukascopy.api.system.IClient |
|---|
addClientGUIListener, addNewsFilter, closeChart, compileStrategy, connect, connect, disconnect, getAvailableInstruments, getCaptchaImage, getClientGUI, getNewsFilter, getStartedStrategies, getSubscribedInstruments, isConnected, loadStrategy, openChart, reconnect, removeClientGUIListener, removeNewsFilter, setCacheDirectory, setErr, setOut, setSystemListener, setSubscribedInstruments, startStrategy, startStrategy, stopStrategy |
| Method Detail |
|---|
void setDataInterval(Period period,
OfferSide offerSide,
ITesterClient.InterpolationMethod interpolationMethod,
long from,
long to)
period - defines period that will be used for ticks generation. Default value Period.TICK will be used if this parameter is nullfrom - when to start testing process. Default value will be previous day startto - when to stop testing process. Default value will be previous day end
void setDataInterval(ITesterClient.DataLoadingMethod dataLoadingMethod,
long from,
long to)
from - when to start testing process. Default value will be previous day startto - when to stop testing process. Default value will be previous day endjava.util.concurrent.Future<?> downloadData(LoadingProgressListener loadingProgressListener)
loadingProgressListener - listener to control downloading process
long startStrategy(IStrategy strategy,
LoadingProgressListener testerProgressListener)
throws java.lang.IllegalStateException,
java.lang.IllegalArgumentException
strategy - strategy to runtesterProgressListener - provides progress information, allows to cancel strategy
java.lang.IllegalStateException - if not connected
java.lang.IllegalArgumentException - if one of the parameters is null
long startStrategy(IStrategy strategy,
IStrategyExceptionHandler exceptionHandler,
LoadingProgressListener testerProgressListener)
throws java.lang.IllegalStateException,
java.lang.IllegalArgumentException
strategy - strategy to runexceptionHandler - if not null then passed exception handler will be called when strategy throws exceptiontesterProgressListener - provides progress information, allows to cancel strategy
java.lang.IllegalStateException - if not connected
java.lang.IllegalArgumentException - if one of the parameters is null
long startStrategy(IStrategy strategy,
LoadingProgressListener testerProgressListener,
ITesterExecution testerExecution,
ITesterUserInterface testerUserInterface)
throws java.lang.IllegalStateException,
java.lang.IllegalArgumentException
strategy - strategy to runtesterProgressListener - provides progress information, allows to cancel strategytesterExecution - allows to control strategy execution process(stop, continue, cancel)testerUserInterface - provides access to various strategy testing GUI parts
java.lang.IllegalStateException - if not connected
java.lang.IllegalArgumentException - if one of the parameters is null
long startStrategy(IStrategy strategy,
LoadingProgressListener testerProgressListener,
ITesterVisualModeParameters testerVisualModeParameters,
ITesterExecution testerExecution,
ITesterUserInterface testerUserInterface)
throws java.lang.IllegalStateException,
java.lang.IllegalArgumentException
strategy - strategy to runtesterProgressListener - provides progress information, allows to cancel strategytesterVisualModeParameters - visual mode optional parameterstesterExecution - allows to control strategy execution process(stop, continue, cancel)testerUserInterface - provides access to various strategy testing GUI parts
java.lang.IllegalStateException - if not connected
java.lang.IllegalArgumentException - if one of the parameters is nullvoid setGatherReportData(boolean gatherReportData)
createReport(long, File) instead
createReport(long, File)boolean getGatherReportData()
createReport(long, File) instead
createReport(long, File)void setEventLogEnabled(boolean eventLogEnabled)
eventLogEnabled - true to enable event logboolean getEventLogEnabled()
void setProcessingStatsEnabled(boolean processingStats)
processingStats - if true then processing statistics will be collected by the testerboolean getProcessingStats()
void createReport(java.io.File file)
throws java.io.IOException,
java.lang.IllegalStateException
createReport(long, File) instead
java.io.IOException
java.lang.IllegalStateExceptioncreateReport(long, File)
void createReport(long processId,
java.io.File file)
throws java.io.IOException,
java.lang.IllegalStateException
processId - process id assigned to the strategyfile - file where to save report
java.io.IOException - if file cannot be written
java.lang.IllegalStateException - when there is not report data available
ITesterReportData getReportData(long processId)
throws java.lang.IllegalStateException
processId - process id assigned to the strategy
java.io.IOException - if file cannot be written
java.lang.IllegalStateException - when there is not report data available
void setInitialDeposit(java.util.Currency currency,
double deposit)
throws java.lang.IllegalArgumentException
currency - deposit currency. Must be one of the accepted currencies for deposit. Default value USDdeposit - deposit amount. Default 50,000
java.lang.IllegalArgumentException - if currency is not one of accepted currencies for depositsdouble getInitialDeposit()
java.util.Currency getInitialDepositCurrency()
void setLeverage(int leverage)
leverage - leverageint getLeverage()
void setCommissions(Commissions commissions)
new Commissions(false) object is passed,
the commission will be calculated as described in
Commission Policy
document using "Deposit with Dukascopy" column values.
Changing this value will take effect only if called before testing process is started
commissions - commission in usd per 1milCommissions getCommissions()
void setOvernights(Overnights overnights)
new Overnights(false) object is passed,
the default overnights will be used
Changing this value will take effect only if called before testing process is started
overnights - commission in usd per 1milOvernights getOvernights()
void setMarginCutLevel(int mcLevel)
mcLevel - margin cut levelint getMarginCutLevel()
void setMCEquity(double mcEquity)
mcEquity - minimum equity amountdouble getMCEquity()