Class SQProject
java.lang.Object
com.strategyquant.tradinglib.project.SQProject
The type Sq project.
-
Field Summary
Modifier and TypeFieldDescriptioncom.strategyquant.tradinglib.project.bestresults.BestResults
The Best results.boolean
The Corrections made.com.strategyquant.tradinglib.project.EngineCharts
The Engine charts.com.strategyquant.tradinglib.project.ProjectLog
The Log.static String
The constant MemoryProtectionError.static String
The constant OutOfMemoryError.The Progress engine.com.strategyquant.tradinglib.project.websocket.ProjectDataPublisher
The Publisher.com.strategyquant.lib.ranger.RangerConfig
The Ranger config.com.strategyquant.tradinglib.project.RangerStart
The Ranger start.static int
The constant RunFromFirstTask.static int
The constant RunFromSpecificTask.static int
The constant RunOnlySpecificTask.static String
The constant userConfigFileName.com.strategyquant.tradinglib.project.UserConfirm
The User confirm. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddDatabank(String databankName, int position)
Add databank databank.Add task isq task.Add task isq task.void
Before start.void
Check paused.void
checkProjectStatus(String action)
Check project status.Clone task isq task.void
confirm(boolean confirmed)
Confirm.boolean
Contains databank boolean.boolean
containsTask(String taskName)
Contains task boolean.boolean
containsTaskByName(String taskName)
Contains task by name boolean.generateTaskXMLFileName(String taskType)
Generate task xml file name string.Gets active task name.org.jdom2.Element
Gets config.long
Returns total running time of current task in ms.com.strategyquant.tradinglib.project.Databanks
Gets databanks.com.strategyquant.tradinglib.project.DefaultProjectConfig
Returns Project and Task XML elementdouble
Gets failed jobs percentage.Gets genetic info.Gets global log.org.json.JSONObject
getInfo()
Gets info.Gets last event.Gets last running task.getName()
Gets name.com.strategyquant.tradinglib.project.ProjectProgress
Get progress project progress.Get project config file file.Gets project folder.getProjectFolderPath(String projectName)
Get project folder path string.long
Returns total running time of this project in ms.Gets results databank.int
Gets run cycles.int
Gets running status.int
Gets run specification.long
Gets start time.getTask(int index)
Gets task.getTaskByHash(int hash)
Gets task by hash.getTaskByName(String taskName)
Gets task by name.org.jdom2.Element
getTaskConfigByName(String taskName)
Gets task config by name.int
getTaskElementIndex(String taskName)
Gets task element index.getTasks()
Gets tasks.int
Gets tasks count.org.jdom2.Element
getTaskSettingsByName(String taskName)
Gets task settings by name.org.jdom2.Element
getTaskSettingsByTitle(String taskTitle)
Gets task settings by title.org.jdom2.Element
getTaskSettingsByXMLFile(String taskXMLFile)
Gets task settings by xml file.it.unimi.dsi.fastutil.ints.IntList
Gets tasks hashes.com.strategyquant.tradinglib.project.TaskStats
getTaskStats(int taskHash)
Gets task stats.long
Returns total running time of this project in ms including time when project was paused.Gets tracking info.void
Increase failed jobs count.void
increaseGlobalStats(int taskHash, String action1, long count1, String action2, long count2)
Increase global stats.void
increaseGlobalStats(String display, int taskHash, String action, long count, int order)
Increase global stats.void
Increase strategies failed.void
Increase strategies passed.void
increaseTrackingInfoStep(int recordsCount)
Increase tracking info step.static void
init()
Init.void
Init tasks from config.boolean
Is app project boolean.static boolean
Is memory protection used boolean.boolean
Is running boolean.void
loadTrackingInfo(ProjectRunInfo projectRunInfo, boolean includingDismissalStats)
Load tracking info.void
Move task.void
onMemoryError(Error e)
On memory error.void
pause()
Pause.Print global log string.void
printToLog(String message)
Print to log.static boolean
projectIsOlderThan136(org.jdom2.Element elProject)
Project is older than 136 boolean.boolean
removeDatabank(String databankName)
Remove databank boolean.removeTask(String taskName)
Remove task isq task.void
resetGeneticInfo(boolean isGeneticEvolution, int numberOfIslands)
Reset genetic info.void
resetTracking(boolean infiniteProgress, boolean resetProjectRunningTime)
Reset tracking.void
resume()
Resume.void
Save config.void
setGlobalStats(String display, int taskHash, String action, long count, int order)
Sets global stats.void
setGlobalStats(String display, int taskHash, String action, long count, int order, String percentageCompareAction)
Sets global stats.void
setLastEvent(String message)
Sets last event.void
setProjectName(String newProjectName)
Sets project name.void
setRunSpecification(int method)
Sets run specification.void
setRunSpecification(int runSpecification, String taskName)
Sets run specification.void
setTaskActive(String taskName, boolean active)
Sets task active.void
setTaskTitle(String taskName, String taskTitle)
Sets task title.void
setTrackingInfoReasonToDismiss(int reason, String reasonToDismiss)
Sets tracking info reason to dismiss.void
start()
Start.void
stop()
Stop.toJSON()
returns JSON stringvoid
trackJob(com.strategyquant.gridlib.client.JobDetails jobDetails, int dismissalReason, com.strategyquant.tradinglib.backtestrunner.DurationStats durationStats, int backtestsInJob, long runningJobs, long waitingJobs)
Track job.void
updateConfig(org.jdom2.Element newConfig)
Update config.void
updateGeneticInfo(com.strategyquant.tradinglib.gp.GPEvolutionMessage data, boolean newGeneration)
Update genetic info.void
updateTrackingInfo(ProjectRunInfo projectRunInfo)
Update tracking info.
-
Field Details
-
MemoryProtectionError
The constant MemoryProtectionError.- See Also:
- Constant Field Values
-
OutOfMemoryError
The constant OutOfMemoryError.- See Also:
- Constant Field Values
-
RunFromFirstTask
public static final int RunFromFirstTaskThe constant RunFromFirstTask.- See Also:
- Constant Field Values
-
RunFromSpecificTask
public static final int RunFromSpecificTaskThe constant RunFromSpecificTask.- See Also:
- Constant Field Values
-
RunOnlySpecificTask
public static final int RunOnlySpecificTaskThe constant RunOnlySpecificTask.- See Also:
- Constant Field Values
-
userConfigFileName
The constant userConfigFileName.- See Also:
- Constant Field Values
-
progressEngine
The Progress engine. -
userConfirm
public com.strategyquant.tradinglib.project.UserConfirm userConfirmThe User confirm. -
log
public com.strategyquant.tradinglib.project.ProjectLog logThe Log. -
engineCharts
public com.strategyquant.tradinglib.project.EngineCharts engineChartsThe Engine charts. -
bestResults
public com.strategyquant.tradinglib.project.bestresults.BestResults bestResultsThe Best results. -
rangerStart
public com.strategyquant.tradinglib.project.RangerStart rangerStartThe Ranger start. -
rangerConfig
public com.strategyquant.lib.ranger.RangerConfig rangerConfigThe Ranger config. -
publisher
public com.strategyquant.tradinglib.project.websocket.ProjectDataPublisher publisherThe Publisher. -
correctionsMade
public boolean correctionsMadeThe Corrections made.
-
-
Constructor Details
-
SQProject
Instantiates a new Sq project.- Parameters:
projectName
- the project name- Throws:
Exception
- the exception
-
-
Method Details
-
init
public static void init()Init. -
projectIsOlderThan136
public static boolean projectIsOlderThan136(org.jdom2.Element elProject)Project is older than 136 boolean.- Parameters:
elProject
- the el project- Returns:
- the boolean
-
initTasksFromConfig
Init tasks from config.- Throws:
Exception
- the exception
-
getDefaultConfig
public com.strategyquant.tradinglib.project.DefaultProjectConfig getDefaultConfig() throws ExceptionReturns Project and Task XML element- Returns:
- default config
- Throws:
Exception
- the exception
-
generateTaskXMLFileName
Generate task xml file name string.- Parameters:
taskType
- the task type- Returns:
- the string
-
addTask
Add task isq task.- Parameters:
taskName
- the task nametaskType
- the task type- Returns:
- the isq task
- Throws:
Exception
- the exception
-
addTask
Add task isq task.- Parameters:
taskName
- the task nametaskType
- the task typeindex
- the index- Returns:
- the isq task
- Throws:
Exception
- the exception
-
removeTask
Remove task isq task.- Parameters:
taskName
- the task name- Returns:
- the isq task
- Throws:
Exception
- the exception
-
checkProjectStatus
Check project status.- Parameters:
action
- the action- Throws:
Exception
- the exception
-
moveTask
Move task.- Parameters:
taskName
- the task nametoIndex
- the to index- Throws:
Exception
- the exception
-
containsTask
Contains task boolean.- Parameters:
taskName
- the task name- Returns:
- the boolean
-
getTaskConfigByName
Gets task config by name.- Parameters:
taskName
- the task name- Returns:
- the task config by name
-
getTaskSettingsByName
Gets task settings by name.- Parameters:
taskName
- the task name- Returns:
- the task settings by name
-
getTaskSettingsByTitle
Gets task settings by title.- Parameters:
taskTitle
- the task title- Returns:
- the task settings by title
-
getTaskSettingsByXMLFile
Gets task settings by xml file.- Parameters:
taskXMLFile
- the task xml file- Returns:
- the task settings by xml file
-
getTaskElementIndex
Gets task element index.- Parameters:
taskName
- the task name- Returns:
- the task element index
-
getTasksCount
public int getTasksCount()Gets tasks count.- Returns:
- the tasks count
-
addDatabank
Add databank databank.- Parameters:
databankName
- the databank nameposition
- the position- Returns:
- the databank
- Throws:
Exception
- the exception
-
removeDatabank
Remove databank boolean.- Parameters:
databankName
- the databank name- Returns:
- the boolean
- Throws:
Exception
- the exception
-
containsDatabank
public boolean containsDatabank()Contains databank boolean.- Returns:
- the boolean
-
getResultsDatabank
Gets results databank.- Returns:
- the results databank
-
isRunning
public boolean isRunning()Is running boolean.- Returns:
- the boolean
-
getActiveTaskName
Gets active task name.- Returns:
- the active task name
-
getLastRunningTask
Gets last running task.- Returns:
- the last running task
-
saveConfig
Save config.- Throws:
Exception
- the exception
-
getTaskByName
Gets task by name.- Parameters:
taskName
- the task name- Returns:
- the task by name
- Throws:
Exception
- the exception
-
containsTaskByName
Contains task by name boolean.- Parameters:
taskName
- the task name- Returns:
- the boolean
- Throws:
Exception
- the exception
-
getTaskByHash
Gets task by hash.- Parameters:
hash
- the hash- Returns:
- the task by hash
- Throws:
Exception
- the exception
-
getTask
Gets task.- Parameters:
index
- the index- Returns:
- the task
- Throws:
Exception
- the exception
-
getTasksHashes
Gets tasks hashes.- Returns:
- the tasks hashes
- Throws:
Exception
- the exception
-
start
Start.- Throws:
Exception
- the exception
-
stop
public void stop()Stop. -
pause
public void pause()Pause. -
resume
public void resume()Resume. -
checkPaused
public void checkPaused()Check paused. -
printToLog
Print to log.- Parameters:
message
- the message
-
getRunningStatus
public int getRunningStatus()Gets running status.- Returns:
- the running status
-
resetTracking
public void resetTracking(boolean infiniteProgress, boolean resetProjectRunningTime)Reset tracking.- Parameters:
infiniteProgress
- the infinite progressresetProjectRunningTime
- the reset project running time
-
trackJob
public void trackJob(com.strategyquant.gridlib.client.JobDetails jobDetails, int dismissalReason, com.strategyquant.tradinglib.backtestrunner.DurationStats durationStats, int backtestsInJob, long runningJobs, long waitingJobs)Track job.- Parameters:
jobDetails
- the job detailsdismissalReason
- the dismissal reasondurationStats
- the duration statsbacktestsInJob
- the backtests in jobrunningJobs
- the running jobswaitingJobs
- the waiting jobs
-
increaseGlobalStats
public void increaseGlobalStats(int taskHash, String action1, long count1, String action2, long count2)Increase global stats.- Parameters:
taskHash
- the task hashaction1
- the action 1count1
- the count 1action2
- the action 2count2
- the count 2
-
setGlobalStats
public void setGlobalStats(String display, int taskHash, String action, long count, int order, String percentageCompareAction)Sets global stats.- Parameters:
display
- the displaytaskHash
- the task hashaction
- the actioncount
- the countorder
- the orderpercentageCompareAction
- the percentage compare action
-
setGlobalStats
Sets global stats.- Parameters:
display
- the displaytaskHash
- the task hashaction
- the actioncount
- the countorder
- the order
-
increaseGlobalStats
public void increaseGlobalStats(String display, int taskHash, String action, long count, int order)Increase global stats.- Parameters:
display
- the displaytaskHash
- the task hashaction
- the actioncount
- the countorder
- the order
-
getFailedJobsPercentage
public double getFailedJobsPercentage()Gets failed jobs percentage.- Returns:
- the failed jobs percentage
-
loadTrackingInfo
Load tracking info.- Parameters:
projectRunInfo
- the project run infoincludingDismissalStats
- the including dismissal stats
-
updateTrackingInfo
Update tracking info.- Parameters:
projectRunInfo
- the project run info
-
getTrackingInfo
Gets tracking info.- Returns:
- the tracking info
-
increaseTrackingInfoStep
public void increaseTrackingInfoStep(int recordsCount)Increase tracking info step.- Parameters:
recordsCount
- the records count
-
setTrackingInfoReasonToDismiss
Sets tracking info reason to dismiss.- Parameters:
reason
- the reasonreasonToDismiss
- the reason to dismiss
-
getProjectFolderPath
Get project folder path string.- Parameters:
projectName
- the project name- Returns:
- the string
-
isAppProject
public boolean isAppProject()Is app project boolean.- Returns:
- the boolean
-
getConfig
public org.jdom2.Element getConfig()Gets config.- Returns:
- the config
-
updateConfig
Update config.- Parameters:
newConfig
- the new config- Throws:
Exception
- the exception
-
getDatabanks
public com.strategyquant.tradinglib.project.Databanks getDatabanks()Gets databanks.- Returns:
- the databanks
-
getName
Gets name.- Returns:
- the name
-
getProjectFolder
Gets project folder.- Returns:
- the project folder
-
beforeStart
Before start.- Throws:
Exception
- the exception
-
confirm
public void confirm(boolean confirmed)Confirm.- Parameters:
confirmed
- the confirmed
-
getProgress
public com.strategyquant.tradinglib.project.ProjectProgress getProgress()Get progress project progress.- Returns:
- the project progress
-
increaseFailedJobsCount
public void increaseFailedJobsCount()Increase failed jobs count. -
increaseStrategiesFailed
public void increaseStrategiesFailed()Increase strategies failed. -
increaseStrategiesPassed
public void increaseStrategiesPassed()Increase strategies passed. -
getGeneticInfo
Gets genetic info.- Returns:
- the genetic info
-
resetGeneticInfo
public void resetGeneticInfo(boolean isGeneticEvolution, int numberOfIslands)Reset genetic info.- Parameters:
isGeneticEvolution
- the is genetic evolutionnumberOfIslands
- the number of islands
-
updateGeneticInfo
public void updateGeneticInfo(com.strategyquant.tradinglib.gp.GPEvolutionMessage data, boolean newGeneration)Update genetic info.- Parameters:
data
- the datanewGeneration
- the new generation
-
setTaskTitle
Sets task title.- Parameters:
taskName
- the task nametaskTitle
- the task title- Throws:
Exception
- the exception
-
setTaskActive
Sets task active.- Parameters:
taskName
- the task nameactive
- the active- Throws:
Exception
- the exception
-
cloneTask
Clone task isq task.- Parameters:
taskName
- the task nameposition
- the position- Returns:
- the isq task
- Throws:
Exception
- the exception
-
onMemoryError
On memory error.- Parameters:
e
- the e
-
isMemoryProtectionUsed
public static boolean isMemoryProtectionUsed()Is memory protection used boolean.- Returns:
- the boolean
-
setProjectName
Sets project name.- Parameters:
newProjectName
- the new project name- Throws:
Exception
- the exception
-
getProjectConfigFile
Get project config file file.- Returns:
- the file
-
setRunSpecification
public void setRunSpecification(int method)Sets run specification.- Parameters:
method
- the method
-
setRunSpecification
Sets run specification.- Parameters:
runSpecification
- the run specificationtaskName
- the task name
-
getRunCycles
public int getRunCycles()Gets run cycles.- Returns:
- the run cycles
-
getStartTime
public long getStartTime()Gets start time.- Returns:
- the start time
-
getTotalProjectRunningTime
public long getTotalProjectRunningTime()Returns total running time of this project in ms including time when project was paused.- Returns:
- total project running time
-
getProjectRunningTime
public long getProjectRunningTime()Returns total running time of this project in ms. Time when project was paused is not taken into account.- Returns:
- project running time
-
getCurrentTaskRunningTime
public long getCurrentTaskRunningTime()Returns total running time of current task in ms. Time when task was paused is not taken into account.- Returns:
- current task running time
-
printGlobalLog
Print global log string.- Returns:
- the string
- Throws:
Exception
- the exception
-
getTaskStats
public com.strategyquant.tradinglib.project.TaskStats getTaskStats(int taskHash)Gets task stats.- Parameters:
taskHash
- the task hash- Returns:
- the task stats
-
setLastEvent
Sets last event.- Parameters:
message
- the message
-
getLastEvent
Gets last event.- Returns:
- the last event
-
getInfo
public org.json.JSONObject getInfo()Gets info.- Returns:
- the info
-
getGlobalLog
Gets global log.- Returns:
- the global log
-
getTasks
Gets tasks.- Returns:
- the tasks
-
toJSON
returns JSON string- Returns:
- string
-
getRunSpecification
public int getRunSpecification()Gets run specification.- Returns:
- the run specification
-