Portfolio-Management Commit:
Managed Tasks: Starts referenced tasks from around workspace Managed Sessions: Starts referenced sessions from around workspace Install Market: Most install is hooked up, some may need refining later after Logic written
This commit is contained in:
1 parent
977035bad8
commit
1be6670171
11 files changed
+7717
-101725
No files matched your search
@@ -33,7 +33,6 @@ function newAlgorithmicTradingActionSwitch() {
|
||||
UI.projects.algorithmicTrading.functionLibraries.tradingSessionFunctions.stopSession(action.node, action.callBackFunction)
|
||||
}
|
||||
break
|
||||
|
||||
default: {
|
||||
console.log("[WARN] Action sent to Algorithmic-Trading Action Switch does not belong here. Verify at the App Schema file of the node that triggered this action that the actionProject is pointing to the right project. -> Action = " + action.name + " -> Action Node Name = " + action.node.name)
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -25,7 +25,7 @@
|
||||
"action": "Add UI Object",
|
||||
"disableIfPropertyIsDefined": true,
|
||||
"propertyToCheckFor": "portfolioMinesData",
|
||||
"label": "Add Trading Mines Data",
|
||||
"label": "Add Portfolio Mines Data",
|
||||
"relatedUiObject": "Portfolio Mines Data",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Visual-Scripting",
|
||||
|
||||
@@ -2,24 +2,26 @@
|
||||
"type": "Managed Sessions",
|
||||
"menuItems": [
|
||||
{
|
||||
"action": "Run All Sessions",
|
||||
"label": "Run All Sessions",
|
||||
"action": "Run Managed Sessions",
|
||||
"label": "Run Managed Sessions",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Run",
|
||||
"workDoneLabel": "Run Request Sent",
|
||||
"iconPathOn": "run",
|
||||
"iconPathOff": "run",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Portfolio-Management"
|
||||
},
|
||||
{
|
||||
"action": "Stop All Sessions",
|
||||
"label": "Stop All Sessions",
|
||||
"action": "Stop Managed Sessions",
|
||||
"label": "Stop Managed Sessions",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Stop",
|
||||
"workDoneLabel": "Stop Request Sent",
|
||||
"iconPathOn": "stop",
|
||||
"iconPathOff": "stop",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Portfolio-Management"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"type": "Managed Tasks",
|
||||
"menuItems": [
|
||||
{
|
||||
"action": "Run All Tasks",
|
||||
"label": "Run All Tasks",
|
||||
"action": "Run All Managed Tasks",
|
||||
"label": "Run All Managed Tasks",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Run",
|
||||
"workDoneLabel": "Run Request Sent",
|
||||
@@ -12,8 +12,8 @@
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
"action": "Stop All Tasks",
|
||||
"label": "Stop All Tasks",
|
||||
"action": "Stop All Managed Tasks",
|
||||
"label": "Stop All Managed Tasks",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Stop",
|
||||
"workDoneLabel": "Stop Request Sent",
|
||||
|
||||
@@ -49,6 +49,5 @@
|
||||
"type": "array",
|
||||
"childType": "Exchange Portfolio Products"
|
||||
}
|
||||
],
|
||||
"icon": "bitcoin"
|
||||
]
|
||||
}
|
||||
@@ -53,6 +53,16 @@ function newFoundationsActionSwitch() {
|
||||
UI.projects.foundations.functionLibraries.taskFunctions.stopAllTaskManagers(action.node)
|
||||
}
|
||||
break
|
||||
case 'Run All Managed Tasks':
|
||||
{ /* Portfolio Task References */
|
||||
UI.projects.foundations.functionLibraries.taskFunctions.runAllManagedTasks(action.node);
|
||||
}
|
||||
break;
|
||||
case 'Stop All Managed Tasks':
|
||||
{ /* Portfolio Task References */
|
||||
UI.projects.foundations.functionLibraries.taskFunctions.stopAllManagedTasks(action.node);
|
||||
}
|
||||
break;
|
||||
case 'Run All Exchange Data Tasks':
|
||||
{
|
||||
UI.projects.foundations.functionLibraries.taskFunctions.runAllExchangeDataTasks(action.node)
|
||||
|
||||
@@ -625,7 +625,7 @@ function newFoundationsFunctionLibraryCryptoEcosystemFunctions() {
|
||||
/*
|
||||
We will make ourselves sure that the Project Portfolio Products nodes are there.
|
||||
*/
|
||||
portfolioMinesData.payload.uiObject.menu.internalClick('Add Missing Project Portfolio Products')
|
||||
portfolioMinesData.payload.uiObject.menu.internalClick('Add UI Object')
|
||||
portfolioMinesData.payload.uiObject.menu.internalClick('Add Missing Project Portfolio Products')
|
||||
|
||||
for (let i = 0; i < portfolioMinesData.projectPortfolioProducts.length; i++) {
|
||||
|
||||
@@ -63,6 +63,9 @@ function newFoundationsFunctionLibraryTaskFunctions() {
|
||||
addMissingMarketPortfolioTasks: addMissingMarketPortfolioTasks,
|
||||
addMissingPortfolioMineTasks: addMissingPortfolioMineTasks,
|
||||
|
||||
runAllManagedTasks: runAllManagedTasks,
|
||||
stopAllManagedTasks: stopAllManagedTasks,
|
||||
|
||||
addAllTasks: addAllTasks
|
||||
}
|
||||
|
||||
@@ -120,6 +123,11 @@ function newFoundationsFunctionLibraryTaskFunctions() {
|
||||
|
||||
let eventsServerClient = UI.projects.foundations.spaces.designSpace.workspace.eventsServerClients.get(lanNetworkNode.id)
|
||||
|
||||
// Check for Managed-Tasks and run them first prior to bots:
|
||||
if (node.managedTasks !== undefined) {
|
||||
runAllManagedTasks(node.managedTasks);
|
||||
}
|
||||
|
||||
for (let i = 0; i < node.bot.processes.length; i++) {
|
||||
let process = node.bot.processes[i]
|
||||
process.payload.uiObject.run(eventsServerClient)
|
||||
@@ -258,6 +266,12 @@ function newFoundationsFunctionLibraryTaskFunctions() {
|
||||
callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
|
||||
return
|
||||
}
|
||||
|
||||
/* Deal with shutting down any managed tasks: */
|
||||
if (node.managedTasks !== undefined) {
|
||||
stopAllManagedTasks(node.managedTasks);
|
||||
}
|
||||
|
||||
let eventsServerClient = UI.projects.foundations.spaces.designSpace.workspace.eventsServerClients.get(lanNetworkNode.id)
|
||||
|
||||
let event = {
|
||||
@@ -700,6 +714,19 @@ function newFoundationsFunctionLibraryTaskFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
/* run|stop ManagedTasks(): Portfolio Management managed task runners: */
|
||||
function runAllManagedTasks(managedTasks) {
|
||||
for (let i = 0; i < managedTasks.taskReference.length; i++) {
|
||||
managedTasks.taskReference[i].payload.referenceParent.payload.uiObject.menu.internalClick('Run Task');
|
||||
}
|
||||
}
|
||||
|
||||
function stopAllManagedTasks(managedTasks) {
|
||||
for (let i = 0; i < managedTasks.taskReference.length; i++) {
|
||||
managedTasks.taskReference[i].payload.referenceParent.payload.uiObject.menu.internalClick('Stop Task');
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingProjectDataTasks(node, rootNodes) {
|
||||
addMissingProjectTasks(node, rootNodes, 'Project Data Tasks', 'Data Tasks')
|
||||
}
|
||||
|
||||
@@ -33,7 +33,16 @@ function newPortfolioManagementActionSwitch() {
|
||||
UI.projects.portfolioManagement.functionLibraries.portfolioSessionFunctions.stopSession(action.node, action.callBackFunction)
|
||||
}
|
||||
break
|
||||
|
||||
case 'Run Managed Sessions':
|
||||
{
|
||||
UI.projects.portfolioManagement.functionLibraries.portfolioSessionFunctions.runManagedSessions(action.node);
|
||||
}
|
||||
break;
|
||||
case 'Stop Managed Sessions':
|
||||
{
|
||||
UI.projects.portfolioManagement.functionLibraries.portfolioSessionFunctions.stopManagedSessions(action.node);
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
console.log("[WARN] Action sent to Portfolio-Management Action Switch does not belong here. Verify at the App Schema file of the node that triggered this action that the actionProject is pointing to the right project. -> Action = " + action.name + " -> Action Node Name = " + action.node.name)
|
||||
}
|
||||
|
||||
@@ -2,7 +2,9 @@ function newPortfolioManagementFunctionLibraryPortfolioSessionFunctions() {
|
||||
let thisObject = {
|
||||
syncronizeSessionWithBackEnd: syncronizeSessionWithBackEnd,
|
||||
runSession: runSession,
|
||||
stopSession: stopSession
|
||||
stopSession: stopSession,
|
||||
runManagedSessions: runManagedSessions,
|
||||
stopManagedSessions: stopManagedSessions
|
||||
}
|
||||
|
||||
return thisObject
|
||||
@@ -63,6 +65,11 @@ function newPortfolioManagementFunctionLibraryPortfolioSessionFunctions() {
|
||||
return
|
||||
}
|
||||
|
||||
// Check for Managed-Sessions and run them:
|
||||
if (node.managedSessions !== undefined) {
|
||||
runManagedSessions(node.managedSessions);
|
||||
}
|
||||
|
||||
let eventsServerClient = UI.projects.foundations.spaces.designSpace.workspace.eventsServerClients.get(lanNetworkNode.id)
|
||||
|
||||
let key = node.name + '-' + node.type + '-' + node.id
|
||||
@@ -225,6 +232,11 @@ function newPortfolioManagementFunctionLibraryPortfolioSessionFunctions() {
|
||||
return
|
||||
}
|
||||
|
||||
/* Deal with any Managed Sessions and shut them down: */
|
||||
if (node.managedSessions !== undefined) {
|
||||
stopManagedSessions(node.managedSessions);
|
||||
}
|
||||
|
||||
let eventsServerClient = UI.projects.foundations.spaces.designSpace.workspace.eventsServerClients.get(lanNetworkNode.id)
|
||||
|
||||
let key = node.name + '-' + node.type + '-' + node.id
|
||||
@@ -233,6 +245,38 @@ function newPortfolioManagementFunctionLibraryPortfolioSessionFunctions() {
|
||||
node.payload.uiObject.stop(callBackFunction, undefined, true)
|
||||
}
|
||||
|
||||
function runManagedSessions(managedSessions) {
|
||||
for (let i = 0; i < managedSessions.sessionReference.length; i++) {
|
||||
let refParent = managedSessions.sessionReference[i].payload.referenceParent;
|
||||
let sessionType = refParent.type;
|
||||
|
||||
if (sessionType === 'Live Trading Session' ||
|
||||
sessionType === 'Backtesting Session' ||
|
||||
sessionType === 'Forward Testing Session' ||
|
||||
sessionType === 'Paper Trading Session') {
|
||||
refParent.payload.uiObject.menu.internalClick('Run Trading Session');
|
||||
} else if (sessionType === 'Back Learning Session' || sessionType === 'Live Learning Session') {
|
||||
refParent.payload.uiObject.menu.internalClick('Run Learning Session');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function stopManagedSessions(managedSessions) {
|
||||
for (let i = 0; i < managedSessions.sessionReference.length; i++) {
|
||||
let refParent = managedSessions.sessionReference[i].payload.referenceParent;
|
||||
let sessionType = refParent.type;
|
||||
|
||||
if (sessionType === 'Live Trading Session' ||
|
||||
sessionType === 'Backtesting Session' ||
|
||||
sessionType === 'Forward Testing Session' ||
|
||||
sessionType === 'Paper Trading Session') {
|
||||
refParent.payload.uiObject.menu.internalClick('Stop Trading Session');
|
||||
} else if (sessionType === 'Back Learning Session' || sessionType === 'Live Learning Session') {
|
||||
refParent.payload.uiObject.menu.internalClick('Stop Learning Session');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function validations(node) {
|
||||
|
||||
let result = {}
|
||||
|
||||
Reference in new issue
Block a user