Learning Tasks with their sessions being created
This commit is contained in:
1 parent
3cba3daad8
commit
e8a3cdceea
4 files changed
+201
-125
No files matched your search
@@ -43,6 +43,18 @@
|
||||
"childType": "Mines",
|
||||
"autoAdd": true
|
||||
},
|
||||
{
|
||||
"name": "trading",
|
||||
"type": "node",
|
||||
"childType": "Trading",
|
||||
"autoAdd": true
|
||||
},
|
||||
{
|
||||
"name": "learning",
|
||||
"type": "node",
|
||||
"childType": "Learning",
|
||||
"autoAdd": true
|
||||
},
|
||||
{
|
||||
"name": "otherHierarchies",
|
||||
"type": "node",
|
||||
@@ -154,7 +166,7 @@
|
||||
"propertyNameAtParent": "mines"
|
||||
},
|
||||
{
|
||||
"type": "Other Hierarchies",
|
||||
"type": "Trading",
|
||||
"menuItems": [
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
@@ -162,24 +174,70 @@
|
||||
"relatedUiObject": "Trading System",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Network",
|
||||
"relatedUiObject": "Network",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Super Scripts",
|
||||
"relatedUiObject": "Super Scripts",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Trading Engine",
|
||||
"relatedUiObject": "Trading Engine",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Delete",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity"
|
||||
}
|
||||
],
|
||||
"isTitleAllwaysVisible": false,
|
||||
"addLeftIcons": true,
|
||||
"isPinned": false,
|
||||
"level": 2,
|
||||
"propertyNameAtParent": "mines",
|
||||
"icon": "bitcoin"
|
||||
},
|
||||
{
|
||||
"type": "Learning",
|
||||
"menuItems": [
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Learning System",
|
||||
"relatedUiObject": "Learning System",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Learning Engine",
|
||||
"relatedUiObject": "Learning Engine",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Delete",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity"
|
||||
}
|
||||
],
|
||||
"isTitleAllwaysVisible": false,
|
||||
"addLeftIcons": true,
|
||||
"isPinned": false,
|
||||
"level": 2,
|
||||
"propertyNameAtParent": "mines",
|
||||
"icon": "bitcoin"
|
||||
},
|
||||
{
|
||||
"type": "Other Hierarchies",
|
||||
"menuItems": [
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Network",
|
||||
"relatedUiObject": "Network",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Tutorial",
|
||||
@@ -10535,7 +10593,7 @@
|
||||
{
|
||||
"action": "Add Missing Children",
|
||||
"label": "Add Missing Children",
|
||||
"relatedUiObject": "Trading Parameters",
|
||||
"relatedUiObject": "Learning Parameters",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
@@ -10571,15 +10629,15 @@
|
||||
"autoAdd": true
|
||||
},
|
||||
{
|
||||
"name": "tradingSystemReference",
|
||||
"name": "learningSystemReference",
|
||||
"type": "node",
|
||||
"childType": "Trading System Reference",
|
||||
"childType": "Learning System Reference",
|
||||
"autoAdd": true
|
||||
},
|
||||
{
|
||||
"name": "tradingEngineReference",
|
||||
"name": "learningEngineReference",
|
||||
"type": "node",
|
||||
"childType": "Trading Engine Reference",
|
||||
"childType": "Learning Engine Reference",
|
||||
"autoAdd": true
|
||||
},
|
||||
{
|
||||
@@ -10637,7 +10695,7 @@
|
||||
{
|
||||
"action": "Add Missing Children",
|
||||
"label": "Add Missing Children",
|
||||
"relatedUiObject": "Trading Parameters",
|
||||
"relatedUiObject": "Learning Parameters",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
@@ -10673,15 +10731,15 @@
|
||||
"autoAdd": true
|
||||
},
|
||||
{
|
||||
"name": "tradingSystemReference",
|
||||
"name": "learningSystemReference",
|
||||
"type": "node",
|
||||
"childType": "Trading System Reference",
|
||||
"childType": "Learning System Reference",
|
||||
"autoAdd": true
|
||||
},
|
||||
{
|
||||
"name": "tradingEngineReference",
|
||||
"name": "learningEngineReference",
|
||||
"type": "node",
|
||||
"childType": "Trading Engine Reference",
|
||||
"childType": "Learning Engine Reference",
|
||||
"autoAdd": true
|
||||
},
|
||||
{
|
||||
|
||||
@@ -754,140 +754,157 @@ function newSuperalgosFunctionLibraryTaskFunctions() {
|
||||
for (let i = 0; i < botsArray.length; i++) {
|
||||
let bot = botsArray[i]
|
||||
|
||||
let task = UI.projects.superalgos.functionLibraries.uiObjectsFromNodes.addUIObject(taskManager, 'Task')
|
||||
|
||||
if (systemNode !== undefined) {
|
||||
task.name = systemNode.name
|
||||
} else {
|
||||
task.name = bot.name
|
||||
}
|
||||
|
||||
let botInstance
|
||||
switch (bot.type) {
|
||||
case 'Sensor Bot': {
|
||||
let task = addTask(taskManager)
|
||||
|
||||
botInstance = UI.projects.superalgos.functionLibraries.uiObjectsFromNodes.addUIObject(task, 'Sensor Bot Instance')
|
||||
botInstance.name = bot.name
|
||||
|
||||
addProcessInstance(task, bot, botInstance)
|
||||
break
|
||||
}
|
||||
case 'Indicator Bot': {
|
||||
let task = addTask(taskManager)
|
||||
|
||||
botInstance = UI.projects.superalgos.functionLibraries.uiObjectsFromNodes.addUIObject(task, 'Indicator Bot Instance')
|
||||
botInstance.name = bot.name
|
||||
|
||||
addProcessInstance(task, bot, botInstance)
|
||||
break
|
||||
}
|
||||
case 'Trading Bot': {
|
||||
let task = addTask(taskManager)
|
||||
|
||||
botInstance = UI.projects.superalgos.functionLibraries.uiObjectsFromNodes.addUIObject(task, 'Trading Bot Instance')
|
||||
botInstance.name = bot.name
|
||||
|
||||
addProcessInstance(task, bot, botInstance)
|
||||
break
|
||||
}
|
||||
case 'Learning Bot': {
|
||||
let task
|
||||
/*
|
||||
For Learning Bots we will add two Tasks, each one with a different
|
||||
Session Type.
|
||||
*/
|
||||
task = addTask(taskManager)
|
||||
task.name = 'Back ' + task.name
|
||||
|
||||
botInstance = UI.projects.superalgos.functionLibraries.uiObjectsFromNodes.addUIObject(task, 'Learning Bot Instance')
|
||||
botInstance.name = bot.name
|
||||
botInstance.name = 'Back ' + bot.name
|
||||
|
||||
addProcessInstance(task, bot, botInstance, 'Back Learning Session')
|
||||
|
||||
task = addTask(taskManager)
|
||||
task.name = 'Live ' + task.name
|
||||
|
||||
botInstance = UI.projects.superalgos.functionLibraries.uiObjectsFromNodes.addUIObject(task, 'Learning Bot Instance')
|
||||
botInstance.name = 'Live ' + bot.name
|
||||
|
||||
addProcessInstance(task, bot, botInstance, 'Live Learning Session')
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
for (let j = 0; j < bot.processes.length; j++) {
|
||||
let process = bot.processes[j]
|
||||
let processInstance
|
||||
switch (bot.type) {
|
||||
case 'Sensor Bot': {
|
||||
processInstance = UI.projects.superalgos.functionLibraries.uiObjectsFromNodes.addUIObject(botInstance, 'Sensor Process Instance')
|
||||
processInstance.payload.referenceParent = process
|
||||
break
|
||||
}
|
||||
case 'Indicator Bot': {
|
||||
processInstance = UI.projects.superalgos.functionLibraries.uiObjectsFromNodes.addUIObject(botInstance, 'Indicator Process Instance')
|
||||
processInstance.payload.referenceParent = process
|
||||
break
|
||||
}
|
||||
case 'Trading Bot': {
|
||||
processInstance = UI.projects.superalgos.functionLibraries.uiObjectsFromNodes.addUIObject(botInstance, 'Trading Process Instance')
|
||||
processInstance.payload.referenceParent = process
|
||||
function addTask(taskManager){
|
||||
let task = UI.projects.superalgos.functionLibraries.uiObjectsFromNodes.addUIObject(taskManager, 'Task')
|
||||
|
||||
if (node.payload.parentNode === undefined) { return }
|
||||
if (node.payload.parentNode.payload === undefined) { return }
|
||||
if (node.payload.parentNode.payload.parentNode === undefined) { return }
|
||||
if (node.payload.parentNode.payload.parentNode.payload === undefined) { return }
|
||||
if (node.payload.parentNode.payload.parentNode.payload.parentNode === undefined) { return }
|
||||
if (node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) { return }
|
||||
if (systemNode !== undefined) {
|
||||
task.name = systemNode.name
|
||||
} else {
|
||||
task.name = bot.name
|
||||
}
|
||||
return task
|
||||
}
|
||||
|
||||
let environment = node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode
|
||||
let session
|
||||
|
||||
switch (environment.type) {
|
||||
case 'Testing Trading Tasks': {
|
||||
addSession('Backtesting Session')
|
||||
break
|
||||
}
|
||||
case 'Production Trading Tasks': {
|
||||
addSession('Live Trading Session')
|
||||
break
|
||||
}
|
||||
function addProcessInstance(task, bot, botInstance, sessionType) {
|
||||
for (let j = 0; j < bot.processes.length; j++) {
|
||||
let process = bot.processes[j]
|
||||
let processInstance
|
||||
switch (bot.type) {
|
||||
case 'Sensor Bot': {
|
||||
processInstance = UI.projects.superalgos.functionLibraries.uiObjectsFromNodes.addUIObject(botInstance, 'Sensor Process Instance')
|
||||
processInstance.payload.referenceParent = process
|
||||
break
|
||||
}
|
||||
case 'Indicator Bot': {
|
||||
processInstance = UI.projects.superalgos.functionLibraries.uiObjectsFromNodes.addUIObject(botInstance, 'Indicator Process Instance')
|
||||
processInstance.payload.referenceParent = process
|
||||
break
|
||||
}
|
||||
break
|
||||
|
||||
function addSession(sessionType) {
|
||||
session = UI.projects.superalgos.functionLibraries.uiObjectsFromNodes.addUIObject(processInstance, sessionType)
|
||||
session.name = task.name
|
||||
let config = JSON.parse(session.config)
|
||||
config.folderName = session.name.split(" ").join("-")
|
||||
session.config = JSON.stringify(config)
|
||||
|
||||
for (let m = 0; m < rootNodes.length; m++) {
|
||||
let rootNode = rootNodes[m]
|
||||
if (rootNode.type === 'Trading Engine' && rootNode.isPlugin === true) {
|
||||
let tradingEngine = rootNode
|
||||
session.tradingEngineReference.payload.referenceParent = tradingEngine
|
||||
session.tradingSystemReference.payload.referenceParent = systemNode
|
||||
case 'Trading Bot': {
|
||||
processInstance = UI.projects.superalgos.functionLibraries.uiObjectsFromNodes.addUIObject(botInstance, 'Trading Process Instance')
|
||||
processInstance.payload.referenceParent = process
|
||||
|
||||
if (node.payload.parentNode === undefined) { return }
|
||||
if (node.payload.parentNode.payload === undefined) { return }
|
||||
if (node.payload.parentNode.payload.parentNode === undefined) { return }
|
||||
if (node.payload.parentNode.payload.parentNode.payload === undefined) { return }
|
||||
if (node.payload.parentNode.payload.parentNode.payload.parentNode === undefined) { return }
|
||||
if (node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) { return }
|
||||
|
||||
let environment = node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode
|
||||
let session
|
||||
|
||||
switch (environment.type) {
|
||||
case 'Testing Trading Tasks': {
|
||||
addSession('Backtesting Session')
|
||||
break
|
||||
}
|
||||
case 'Production Trading Tasks': {
|
||||
addSession('Live Trading Session')
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
case 'Learning Bot': {
|
||||
processInstance = UI.projects.superalgos.functionLibraries.uiObjectsFromNodes.addUIObject(botInstance, 'Learning Process Instance')
|
||||
processInstance.payload.referenceParent = process
|
||||
|
||||
if (node.payload.parentNode === undefined) { return }
|
||||
if (node.payload.parentNode.payload === undefined) { return }
|
||||
if (node.payload.parentNode.payload.parentNode === undefined) { return }
|
||||
if (node.payload.parentNode.payload.parentNode.payload === undefined) { return }
|
||||
if (node.payload.parentNode.payload.parentNode.payload.parentNode === undefined) { return }
|
||||
if (node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) { return }
|
||||
|
||||
let environment = node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode
|
||||
let session
|
||||
|
||||
switch (environment.type) {
|
||||
case 'Testing Learning Tasks': {
|
||||
addSession('Backtesting Session')
|
||||
break
|
||||
}
|
||||
case 'Production Learning Tasks': {
|
||||
addSession('Live Learning Session')
|
||||
break
|
||||
break
|
||||
|
||||
function addSession(sessionType) {
|
||||
session = UI.projects.superalgos.functionLibraries.uiObjectsFromNodes.addUIObject(processInstance, sessionType)
|
||||
session.name = task.name
|
||||
let config = JSON.parse(session.config)
|
||||
config.folderName = session.name.split(" ").join("-")
|
||||
session.config = JSON.stringify(config)
|
||||
|
||||
for (let m = 0; m < rootNodes.length; m++) {
|
||||
let rootNode = rootNodes[m]
|
||||
if (rootNode.type === 'Trading Engine' && rootNode.isPlugin === true) {
|
||||
let tradingEngine = rootNode
|
||||
session.tradingEngineReference.payload.referenceParent = tradingEngine
|
||||
session.tradingSystemReference.payload.referenceParent = systemNode
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break
|
||||
|
||||
function addSession(sessionType) {
|
||||
session = UI.projects.superalgos.functionLibraries.uiObjectsFromNodes.addUIObject(processInstance, sessionType)
|
||||
session.name = task.name
|
||||
let config = JSON.parse(session.config)
|
||||
config.folderName = session.name.split(" ").join("-")
|
||||
session.config = JSON.stringify(config)
|
||||
|
||||
for (let m = 0; m < rootNodes.length; m++) {
|
||||
let rootNode = rootNodes[m]
|
||||
if (rootNode.type === 'Learning Engine' && rootNode.isPlugin === true) {
|
||||
let learningEngine = rootNode
|
||||
session.learningEngineReference.payload.referenceParent = learningEngine
|
||||
session.learningSystemReference.payload.referenceParent = systemNode
|
||||
case 'Learning Bot': {
|
||||
processInstance = UI.projects.superalgos.functionLibraries.uiObjectsFromNodes.addUIObject(botInstance, 'Learning Process Instance')
|
||||
processInstance.payload.referenceParent = process
|
||||
|
||||
let session
|
||||
addSession(sessionType)
|
||||
break
|
||||
|
||||
function addSession(sessionType) {
|
||||
session = UI.projects.superalgos.functionLibraries.uiObjectsFromNodes.addUIObject(processInstance, sessionType)
|
||||
session.name = task.name
|
||||
let config = JSON.parse(session.config)
|
||||
config.folderName = session.name.split(" ").join("-")
|
||||
session.config = JSON.stringify(config)
|
||||
|
||||
for (let m = 0; m < rootNodes.length; m++) {
|
||||
let rootNode = rootNodes[m]
|
||||
if (rootNode.type === 'Learning Engine' && rootNode.isPlugin === true) {
|
||||
let learningEngine = rootNode
|
||||
session.learningEngineReference.payload.referenceParent = learningEngine
|
||||
session.learningSystemReference.payload.referenceParent = systemNode
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
processInstance.payload.floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_90
|
||||
}
|
||||
processInstance.payload.floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_90
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@ function newSuperalgosDocsSearchEngine() {
|
||||
}
|
||||
|
||||
function setUpSearchEngine(callbackFunction) {
|
||||
//callbackFunction()
|
||||
//return
|
||||
callbackFunction()
|
||||
return
|
||||
|
||||
let totalAsyncCallsMade = 0
|
||||
let totalAsyncCallsFinished = 0
|
||||
|
||||
@@ -1490,12 +1490,13 @@ function newUiObject() {
|
||||
drawValue()
|
||||
drawPercentage()
|
||||
drawStatus()
|
||||
drawNodeType()
|
||||
|
||||
if (drawTitle === true) {
|
||||
thisObject.uiObjectTitle.draw()
|
||||
thisObject.uiObjectMessage.draw()
|
||||
}
|
||||
|
||||
drawNodeType()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user