Merge pull request #2064 from Luis-Fernando-Molina/develop
Contribution: Extracting from Foundations several projects: Data-Mining, Algorithmic Trading and Community Plugins, Machine Learning
This commit is contained in:
203 files changed
+2873
-1430
No files matched your search
@@ -4,6 +4,8 @@ My-Workspaces
|
||||
My-Social-Trading-Data
|
||||
My-Network-Nodes-Data
|
||||
My-Secrets
|
||||
My-Data-Storage
|
||||
My-Log-Files
|
||||
debug.log
|
||||
.DS_Store
|
||||
*.db
|
||||
|
||||
+3
-3
@@ -4,14 +4,14 @@ exports.newEnvironment = function () {
|
||||
WEB_SERVER_URL: 'localhost',
|
||||
CLIENT_WEB_SOCKETS_INTERFACE_PORT: 18041,
|
||||
CLIENT_HTTP_INTERFACE_PORT: 34248,
|
||||
PATH_TO_DATA_STORAGE: './Data-Storage',
|
||||
PATH_TO_DATA_STORAGE: './Platform/My-Data-Storage',
|
||||
PATH_TO_LOG_FILES: './Platform/My-Log-Files',
|
||||
PATH_TO_PROJECTS: './Projects',
|
||||
PATH_TO_LOG_FILES: './Log-Files',
|
||||
PATH_TO_PROJECTS_REQUIRED: './Projects',
|
||||
PATH_TO_PROJECT_SCHEMA: './Projects/ProjectsSchema.json',
|
||||
PATH_TO_CLIENT: './Platform',
|
||||
PATH_TO_DEFAULT_WORKSPACE: './Projects/Foundations/Plugins/Workspaces',
|
||||
PATH_TO_MY_WORKSPACES: './My-Workspaces',
|
||||
PATH_TO_MY_WORKSPACES: './Platform/My-Workspaces',
|
||||
PATH_TO_FONTS: './Platform/WebServer/Fonts'
|
||||
}
|
||||
|
||||
|
||||
@@ -8,15 +8,15 @@ exports.newEnvironment = function () {
|
||||
DESKTOP_WEB_SOCKETS_INTERFACE_HOST: 'localhost',
|
||||
CLIENT_HTTP_INTERFACE_PORT: 34248,
|
||||
DESKTOP_HTTP_INTERFACE_PORT: 34249,
|
||||
PATH_TO_DATA_STORAGE: './Data-Storage',
|
||||
PATH_TO_DATA_STORAGE: './Platform/My-Data-Storage',
|
||||
PATH_TO_LOG_FILES: './Platform/My-Log-Files',
|
||||
PATH_TO_PROJECTS: './Projects',
|
||||
PATH_TO_LOG_FILES: './Log-Files',
|
||||
PATH_TO_PROJECTS_REQUIRED: './Projects',
|
||||
PATH_TO_PROJECT_SCHEMA: './Projects/ProjectsSchema.json',
|
||||
PATH_TO_CLIENT: './Platform',
|
||||
PATH_TO_DESKTOP: './Desktop',
|
||||
PATH_TO_DEFAULT_WORKSPACE: './Projects/Foundations/Plugins/Workspaces',
|
||||
PATH_TO_MY_WORKSPACES: './My-Workspaces',
|
||||
PATH_TO_MY_WORKSPACES: './Platform/My-Workspaces',
|
||||
PATH_TO_FONTS: './Platform/WebServer/Fonts'
|
||||
}
|
||||
|
||||
|
||||
@@ -340,7 +340,7 @@ exports.newGithubServer = function newGithubServer() {
|
||||
owner: owner,
|
||||
repo: repo,
|
||||
issue_number: pullRequest.number,
|
||||
body: 'This Pull Request could not be automatically merged and was closed by the Superalgos Governance System because it was detected that a User Profile file... \n\n' + fileContentUrl + '\n\n...was submitted together with ' + (filesChanged.length - 1) + ' other file/s. User Profiles files as per the Governance System rules, must be the only file present at a Pull Request in order to pass all the validations and be automatically merged.'
|
||||
body: 'This Pull Request could not be automatically merged and was closed by the Superalgos Governance System because it was detected that a User Profile file... \n\n' + fileContentUrl + '\n\n...was submitted together with ' + (filesChanged.length - 1) + ' other file/s. User Profiles files as per the Governance System rules, must be the only file present at a Pull Request in order to pass all the validations and be automatically merged. \n\n If you intentionally submitted the extra files, the way to get your work merged is by first removing your User Profile file from the Plugins folder at your local installation and executing an app.contribute again. Then wait until the PR is merged (manually reviewed) and after that you put your User Profile file again and create a new PR only with that file with an app.contribute. That last PR should be merged automatically.'
|
||||
});
|
||||
|
||||
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
|
||||
@@ -508,14 +508,14 @@ exports.newGithubServer = function newGithubServer() {
|
||||
unless the existing one belongs to the same Github username.
|
||||
*/
|
||||
let userProfileIdMap = new Map()
|
||||
let pluginFileNames = await SA.projects.foundations.utilities.plugins.getPluginFileNames(
|
||||
let pluginFileNames = await SA.projects.communityPlugins.utilities.plugins.getPluginFileNames(
|
||||
'Governance',
|
||||
'User-Profiles'
|
||||
)
|
||||
for (let i = 0; i < pluginFileNames.length; i++) {
|
||||
let pluginFileName = pluginFileNames[i]
|
||||
|
||||
let pluginFileContent = await SA.projects.foundations.utilities.plugins.getPluginFileContent(
|
||||
let pluginFileContent = await SA.projects.communityPlugins.utilities.plugins.getPluginFileContent(
|
||||
'Governance',
|
||||
'User-Profiles',
|
||||
pluginFileName
|
||||
@@ -558,13 +558,13 @@ exports.newGithubServer = function newGithubServer() {
|
||||
unless the existing one belongs to the same Github username.
|
||||
*/
|
||||
let userProfileIdMap = new Map()
|
||||
let pluginFileNames = await SA.projects.foundations.utilities.plugins.getPluginFileNames(
|
||||
let pluginFileNames = await SA.projects.communityPlugins.utilities.plugins.getPluginFileNames(
|
||||
'Governance',
|
||||
'User-Profiles'
|
||||
)
|
||||
for (let i = 0; i < pluginFileNames.length; i++) {
|
||||
let pluginFileName = pluginFileNames[i]
|
||||
let pluginFileContent = await SA.projects.foundations.utilities.plugins.getPluginFileContent(
|
||||
let pluginFileContent = await SA.projects.communityPlugins.utilities.plugins.getPluginFileContent(
|
||||
'Governance',
|
||||
'User-Profiles',
|
||||
pluginFileName
|
||||
|
||||
@@ -1387,11 +1387,13 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
try {
|
||||
let project = unescape(requestPath[2])
|
||||
let folder = unescape(requestPath[3])
|
||||
|
||||
let response = await SA.projects.foundations.utilities.plugins.getPluginFileNames(
|
||||
|
||||
let response = await SA.projects.communityPlugins.utilities.plugins.getPluginFileNames(
|
||||
project,
|
||||
folder
|
||||
)
|
||||
).catch(err => {
|
||||
console.log('[ERROR] httpInterface -> PluginFileNames -> err.stack = ' + err.stack)
|
||||
})
|
||||
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithContent(JSON.stringify(response), httpResponse)
|
||||
|
||||
@@ -1424,12 +1426,18 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
if (fileName === 'Superalgos-CL.json') {
|
||||
fileName = 'Superalgos-PL.json'
|
||||
}
|
||||
|
||||
let response = await SA.projects.foundations.utilities.plugins.getPluginFileContent(
|
||||
|
||||
await SA.projects.communityPlugins.utilities.plugins.getPluginFileContent(
|
||||
project,
|
||||
folder,
|
||||
fileName
|
||||
).catch(err => {
|
||||
)
|
||||
.then( response =>
|
||||
{
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithContent(response, httpResponse)
|
||||
}
|
||||
)
|
||||
.catch(err => {
|
||||
let error = {
|
||||
result: 'Fail Because',
|
||||
message: err
|
||||
@@ -1438,8 +1446,6 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
return
|
||||
})
|
||||
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithContent(response, httpResponse)
|
||||
|
||||
} catch (err) {
|
||||
console.log('[ERROR] httpInterface -> LoadPlugin -> Method call produced an error.')
|
||||
console.log('[ERROR] httpInterface -> LoadPlugin -> err.stack = ' + err.stack)
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,63 @@
|
||||
{
|
||||
"type": "Algorithmic-Trading Project",
|
||||
"menuItems": [
|
||||
{
|
||||
"action": "Add Missing Children",
|
||||
"label": "Add Missing Children",
|
||||
"iconPathOn": "algorithmic-trading-project",
|
||||
"iconPathOff": "algorithmic-trading-project",
|
||||
"iconProject": "Algorithmic-Trading",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Trading Mine",
|
||||
"relatedUiObject": "Trading Mine",
|
||||
"relatedUiObjectProject": "Algorithmic-Trading",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Trading Engine",
|
||||
"relatedUiObject": "Trading Engine",
|
||||
"relatedUiObjectProject": "Algorithmic-Trading",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Trading System",
|
||||
"relatedUiObject": "Trading System",
|
||||
"relatedUiObjectProject": "Algorithmic-Trading",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Delete",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionProject": "Foundations"
|
||||
}
|
||||
],
|
||||
"isProjectHead": true,
|
||||
"isTitleAllwaysVisible": false,
|
||||
"addLeftIcons": true,
|
||||
"isPinned": true,
|
||||
"positionLocked": true,
|
||||
"icon": "algorithmic-trading-project",
|
||||
"childrenNodesProperties": [
|
||||
{
|
||||
"name": "projectDefinition",
|
||||
"type": "node",
|
||||
"childType": "Project Definition",
|
||||
"project": "Foundations",
|
||||
"autoAdd": true
|
||||
}
|
||||
]
|
||||
}
|
||||
+16
-8
@@ -7,25 +7,29 @@
|
||||
"iconPathOn": "configuration",
|
||||
"iconPathOff": "configuration",
|
||||
"dontShowAtFullscreen": true,
|
||||
"actionFunction": "uiObject.configEditor.activate"
|
||||
"actionFunction": "uiObject.configEditor.activate",
|
||||
"actionProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Process Definition",
|
||||
"relatedUiObject": "Process Definition",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Product Definition",
|
||||
"relatedUiObject": "Product Definition",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Product Definition Folder",
|
||||
"relatedUiObject": "Product Definition Folder",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
@@ -34,7 +38,8 @@
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
}
|
||||
],
|
||||
"isTitleAllwaysVisible": true,
|
||||
@@ -54,19 +59,22 @@
|
||||
"name": "processes",
|
||||
"type": "array",
|
||||
"childType": "Process Definition",
|
||||
"autoAdd": true
|
||||
"autoAdd": true,
|
||||
"project": "Foundations"
|
||||
},
|
||||
{
|
||||
"name": "products",
|
||||
"type": "array",
|
||||
"childType": "Product Definition",
|
||||
"autoAdd": true
|
||||
"autoAdd": true,
|
||||
"project": "Foundations"
|
||||
},
|
||||
{
|
||||
"name": "productDefinitionFolders",
|
||||
"type": "array",
|
||||
"childType": "Product Definition Folder",
|
||||
"autoAdd": true
|
||||
"autoAdd": true,
|
||||
"project": "Foundations"
|
||||
}
|
||||
],
|
||||
"propertyNameAtParent": "tradingBots"
|
||||
+10
-5
@@ -5,7 +5,8 @@
|
||||
"action": "Add Missing Children",
|
||||
"label": "Add Missing Children",
|
||||
"relatedUiObject": "Trading Engine",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
@@ -14,7 +15,8 @@
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
}
|
||||
],
|
||||
"isHierarchyHead": true,
|
||||
@@ -25,19 +27,22 @@
|
||||
"name": "tradingCurrent",
|
||||
"type": "node",
|
||||
"childType": "Trading Current",
|
||||
"autoAdd": true
|
||||
"autoAdd": false,
|
||||
"project": "Foundations"
|
||||
},
|
||||
{
|
||||
"name": "tradingLast",
|
||||
"type": "node",
|
||||
"childType": "Trading Last",
|
||||
"autoAdd": true
|
||||
"autoAdd": false,
|
||||
"project": "Foundations"
|
||||
},
|
||||
{
|
||||
"name": "exchangeOrders",
|
||||
"type": "node",
|
||||
"childType": "Exchange Orders",
|
||||
"autoAdd": true
|
||||
"autoAdd": false,
|
||||
"project": "Foundations"
|
||||
}
|
||||
]
|
||||
}
|
||||
+15
-6
@@ -6,20 +6,26 @@
|
||||
"label": "Configure",
|
||||
"iconPathOn": "configuration",
|
||||
"iconPathOff": "configuration",
|
||||
"iconProject": "Foundations",
|
||||
"dontShowAtFullscreen": true,
|
||||
"actionFunction": "uiObject.configEditor.activate"
|
||||
"actionFunction": "uiObject.configEditor.activate",
|
||||
"actionProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Trading Bot",
|
||||
"relatedUiObject": "Trading Bot",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"relatedUiObjectProject": "Algorithmic-Trading",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Plotter",
|
||||
"relatedUiObject": "Plotter",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"relatedUiObjectProject": "Foundations",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
@@ -28,7 +34,8 @@
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
}
|
||||
],
|
||||
"isTitleAllwaysVisible": true,
|
||||
@@ -45,12 +52,14 @@
|
||||
{
|
||||
"name": "tradingBots",
|
||||
"type": "array",
|
||||
"childType": "Trading Bot"
|
||||
"childType": "Trading Bot",
|
||||
"project": "Algorithmic-Trading"
|
||||
},
|
||||
{
|
||||
"name": "plotters",
|
||||
"type": "array",
|
||||
"childType": "Plotter"
|
||||
"childType": "Plotter",
|
||||
"project": "Foundations"
|
||||
}
|
||||
]
|
||||
}
|
||||
+10
-5
@@ -5,7 +5,8 @@
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Trading Strategy",
|
||||
"relatedUiObject": "Trading Strategy",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
@@ -13,7 +14,8 @@
|
||||
"propertyToCheckFor": "dynamicIndicators",
|
||||
"label": "Add Dynamic Indicators",
|
||||
"relatedUiObject": "Dynamic Indicators",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
@@ -22,7 +24,8 @@
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
}
|
||||
],
|
||||
"isHierarchyHead": true,
|
||||
@@ -33,13 +36,15 @@
|
||||
"name": "tradingStrategies",
|
||||
"type": "array",
|
||||
"childType": "Trading Strategy",
|
||||
"autoAdd": true
|
||||
"autoAdd": true,
|
||||
"project": "Foundations"
|
||||
},
|
||||
{
|
||||
"name": "dynamicIndicators",
|
||||
"type": "node",
|
||||
"childType": "Dynamic Indicators",
|
||||
"autoAdd": true
|
||||
"autoAdd": true,
|
||||
"project": "Foundations"
|
||||
}
|
||||
]
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -1,4 +1,4 @@
|
||||
exports.newFoundationsBotModulesExchangeAPI = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesExchangeAPI = function (processIndex) {
|
||||
|
||||
let MODULE_NAME = "Exchange API";
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
exports.newFoundationsBotModulesOrdersCalculations = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesOrdersCalculations = function (processIndex) {
|
||||
/*
|
||||
When we are live trading, we need to syncronize with the exchange.
|
||||
*/
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
exports.newFoundationsBotModulesOrdersSimulations = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesOrdersSimulations = function (processIndex) {
|
||||
/*
|
||||
When we are backtesting or paper trading, we need to simulate what would have happened at the exchange.
|
||||
*/
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
exports.newFoundationsBotModulesSnapshots = function(processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesSnapshots = function(processIndex) {
|
||||
/*
|
||||
This module encapsulates the snapshots functionality.
|
||||
*/
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
exports.newFoundationsBotModulesTradingEngine = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesTradingEngine = function (processIndex) {
|
||||
/*
|
||||
We call the Trading Engine to the data structure that is needed in order to exevute the
|
||||
trading protocol with the specific rules defined at the Trading System.
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
exports.newFoundationsBotModulesTradingEpisode = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesTradingEpisode = function (processIndex) {
|
||||
/*
|
||||
This module packages all functions related to Episodes.
|
||||
*/
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
exports.newFoundationsBotModulesTradingExecution = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesTradingExecution = function (processIndex) {
|
||||
/*
|
||||
The Trading Execution modules manages the execution nodes and execution algoritms.
|
||||
*/
|
||||
@@ -16,7 +16,7 @@ exports.newFoundationsBotModulesTradingExecution = function (processIndex) {
|
||||
let tradingSystem
|
||||
let sessionParameters
|
||||
|
||||
let tradingOrdersModuleObject = TS.projects.foundations.botModules.tradingOrders.newFoundationsBotModulesTradingOrders(processIndex)
|
||||
let tradingOrdersModuleObject = TS.projects.algorithmicTrading.botModules.tradingOrders.newAlgorithmicTradingBotModulesTradingOrders(processIndex)
|
||||
|
||||
return thisObject
|
||||
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
exports.newFoundationsBotModulesTradingOrders = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesTradingOrders = function (processIndex) {
|
||||
/*
|
||||
The Trading Orders modules manages the execution of orders against the exchanges.
|
||||
*/
|
||||
@@ -16,7 +16,7 @@ exports.newFoundationsBotModulesTradingOrders = function (processIndex) {
|
||||
let tradingSystem
|
||||
let sessionParameters
|
||||
|
||||
let exchangeAPIModuleObject = TS.projects.foundations.botModules.exchangeAPI.newFoundationsBotModulesExchangeAPI(processIndex)
|
||||
let exchangeAPIModuleObject = TS.projects.algorithmicTrading.botModules.exchangeAPI.newAlgorithmicTradingBotModulesExchangeAPI(processIndex)
|
||||
let announcementsModuleObject = TS.projects.foundations.botModules.announcements.newFoundationsBotModulesAnnouncements(processIndex)
|
||||
|
||||
return thisObject
|
||||
@@ -843,7 +843,7 @@ exports.newFoundationsBotModulesTradingOrders = function (processIndex) {
|
||||
let previousBaseAssetFeesPaid = tradingEngineOrder.orderBaseAsset.feesPaid.value
|
||||
let previousQuotedAssetFeesPaid = tradingEngineOrder.orderQuotedAsset.feesPaid.value
|
||||
|
||||
let ordersSimulationsModuleObject = TS.projects.foundations.botModules.ordersSimulations.newFoundationsBotModulesOrdersSimulations(processIndex)
|
||||
let ordersSimulationsModuleObject = TS.projects.algorithmicTrading.botModules.ordersSimulations.newAlgorithmicTradingBotModulesOrdersSimulations(processIndex)
|
||||
ordersSimulationsModuleObject.initialize()
|
||||
|
||||
ordersSimulationsModuleObject.actualSizeSimulation(tradingEngineStage, tradingSystemOrder, tradingEngineOrder, applyFeePercentage)
|
||||
@@ -874,7 +874,7 @@ exports.newFoundationsBotModulesTradingOrders = function (processIndex) {
|
||||
let previousBaseAssetFeesPaid = tradingEngineOrder.orderBaseAsset.feesPaid.value
|
||||
let previousQuotedAssetFeesPaid = tradingEngineOrder.orderQuotedAsset.feesPaid.value
|
||||
|
||||
let ordersCalculationsModuleObject = TS.projects.foundations.botModules.ordersCalculations.newFoundationsBotModulesOrdersCalculations(processIndex)
|
||||
let ordersCalculationsModuleObject = TS.projects.algorithmicTrading.botModules.ordersCalculations.newAlgorithmicTradingBotModulesOrdersCalculations(processIndex)
|
||||
ordersCalculationsModuleObject.initialize()
|
||||
|
||||
await ordersCalculationsModuleObject.actualSizeCalculation(tradingEngineStage, tradingSystemOrder, tradingEngineOrder, order, applyFeePercentage)
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
exports.newFoundationsBotModulesTradingOutput = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesTradingOutput = function (processIndex) {
|
||||
/*
|
||||
This module will load if necesary all the data outputs so that they can be appended with new
|
||||
records if needed. After running the simulation, it will save all the data outputs.
|
||||
@@ -29,7 +29,7 @@ exports.newFoundationsBotModulesTradingOutput = function (processIndex) {
|
||||
}
|
||||
|
||||
/* Preparing everything for the Simulation */
|
||||
let tradingSimulationModuleObject = TS.projects.foundations.botModules.tradingSimulation.newFoundationsBotModulesTradingSimulation(processIndex)
|
||||
let tradingSimulationModuleObject = TS.projects.algorithmicTrading.botModules.tradingSimulation.newAlgorithmicTradingBotModulesTradingSimulation(processIndex)
|
||||
|
||||
let outputDatasets = TS.projects.foundations.utilities.nodeFunctions.nodeBranchToArray(TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.processOutput, 'Output Dataset')
|
||||
let outputDatasetsMap = new Map()
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
exports.newFoundationsBotModulesTradingPosition = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesTradingPosition = function (processIndex) {
|
||||
/*
|
||||
This module packages all functions related to Positions.
|
||||
*/
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
exports.newFoundationsBotModulesTradingProcess = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesTradingProcess = function (processIndex) {
|
||||
/*
|
||||
This Module will load all the process data dependencies from files and send them downstream.
|
||||
After execution, will save the time range and status report of the process.
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
let dataFiles = new Map()
|
||||
let multiTimeFrameDataFiles = new Map()
|
||||
TS.projects.foundations.globals.processModuleObjects.MODULE_OBJECTS_BY_PROCESS_INDEX_MAP.get(processIndex).TRADING_ENGINE_MODULE_OBJECT = TS.projects.foundations.botModules.tradingEngine.newFoundationsBotModulesTradingEngine(processIndex)
|
||||
let tradingOutputModuleObject = TS.projects.foundations.botModules.tradingOutput.newFoundationsBotModulesTradingOutput(processIndex)
|
||||
TS.projects.foundations.globals.processModuleObjects.MODULE_OBJECTS_BY_PROCESS_INDEX_MAP.get(processIndex).TRADING_ENGINE_MODULE_OBJECT = TS.projects.algorithmicTrading.botModules.tradingEngine.newAlgorithmicTradingBotModulesTradingEngine(processIndex)
|
||||
let tradingOutputModuleObject = TS.projects.algorithmicTrading.botModules.tradingOutput.newAlgorithmicTradingBotModulesTradingOutput(processIndex)
|
||||
|
||||
let currentTimeFrame = {}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
exports.newFoundationsBotModulesTradingRecords = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesTradingRecords = function (processIndex) {
|
||||
/*
|
||||
This module facilitates the appending of records to the output of the process.
|
||||
*/
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
exports.newFoundationsBotModulesTradingSimulation = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesTradingSimulation = function (processIndex) {
|
||||
/*
|
||||
This Module represents the trading simulacion. Escentially a loop through a set of candles and
|
||||
the execution at each loop cycle of the Trading System Protocol.
|
||||
@@ -34,13 +34,13 @@ exports.newFoundationsBotModulesTradingSimulation = function (processIndex) {
|
||||
'[INFO] runSimulation -> finalDatetime = ' + sessionParameters.timeRange.config.finalDatetime)
|
||||
|
||||
/* These are the Modules we will need to run the Simulation */
|
||||
let tradingRecordsModuleObject = TS.projects.foundations.botModules.tradingRecords.newFoundationsBotModulesTradingRecords(processIndex)
|
||||
let tradingRecordsModuleObject = TS.projects.algorithmicTrading.botModules.tradingRecords.newAlgorithmicTradingBotModulesTradingRecords(processIndex)
|
||||
tradingRecordsModuleObject.initialize(outputDatasetsMap)
|
||||
|
||||
let tradingSystemModuleObject = TS.projects.foundations.botModules.tradingSystem.newFoundationsBotModulesTradingSystem(processIndex)
|
||||
let tradingSystemModuleObject = TS.projects.algorithmicTrading.botModules.tradingSystem.newAlgorithmicTradingBotModulesTradingSystem(processIndex)
|
||||
tradingSystemModuleObject.initialize()
|
||||
|
||||
let tradingEpisodeModuleObject = TS.projects.foundations.botModules.tradingEpisode.newFoundationsBotModulesTradingEpisode(processIndex)
|
||||
let tradingEpisodeModuleObject = TS.projects.algorithmicTrading.botModules.tradingEpisode.newAlgorithmicTradingBotModulesTradingEpisode(processIndex)
|
||||
tradingEpisodeModuleObject.initialize()
|
||||
|
||||
/* Setting up the candles array: The whole simulation is based on the array of candles at the time-frame defined at the session parameters. */
|
||||
+6
-6
@@ -1,4 +1,4 @@
|
||||
exports.newFoundationsBotModulesTradingStages = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesTradingStages = function (processIndex) {
|
||||
/*
|
||||
This module packages all functions related to Stages.
|
||||
*/
|
||||
@@ -21,12 +21,12 @@ exports.newFoundationsBotModulesTradingStages = function (processIndex) {
|
||||
finalize: finalize
|
||||
}
|
||||
|
||||
let tradingStrategyModuleObject = TS.projects.foundations.botModules.tradingStrategy.newFoundationsBotModulesTradingStrategy(processIndex)
|
||||
let tradingPositionModuleObject = TS.projects.foundations.botModules.tradingPosition.newFoundationsBotModulesTradingPosition(processIndex)
|
||||
let tradingExecutionModuleObject = TS.projects.foundations.botModules.tradingExecution.newFoundationsBotModulesTradingExecution(processIndex)
|
||||
let tradingStrategyModuleObject = TS.projects.algorithmicTrading.botModules.tradingStrategy.newAlgorithmicTradingBotModulesTradingStrategy(processIndex)
|
||||
let tradingPositionModuleObject = TS.projects.algorithmicTrading.botModules.tradingPosition.newAlgorithmicTradingBotModulesTradingPosition(processIndex)
|
||||
let tradingExecutionModuleObject = TS.projects.algorithmicTrading.botModules.tradingExecution.newAlgorithmicTradingBotModulesTradingExecution(processIndex)
|
||||
let announcementsModuleObject = TS.projects.foundations.botModules.announcements.newFoundationsBotModulesAnnouncements(processIndex)
|
||||
let snapshotsModuleObject = TS.projects.foundations.botModules.snapshots.newFoundationsBotModulesSnapshots(processIndex)
|
||||
let tradingEpisodeModuleObject = TS.projects.foundations.botModules.tradingEpisode.newFoundationsBotModulesTradingEpisode(processIndex)
|
||||
let snapshotsModuleObject = TS.projects.algorithmicTrading.botModules.snapshots.newAlgorithmicTradingBotModulesSnapshots(processIndex)
|
||||
let tradingEpisodeModuleObject = TS.projects.algorithmicTrading.botModules.tradingEpisode.newAlgorithmicTradingBotModulesTradingEpisode(processIndex)
|
||||
|
||||
let tradingEngine
|
||||
let tradingSystem
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
exports.newFoundationsBotModulesTradingStrategy = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesTradingStrategy = function (processIndex) {
|
||||
/*
|
||||
This module packages all functions related to Strategies.
|
||||
*/
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
exports.newFoundationsBotModulesTradingSystem = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesTradingSystem = function (processIndex) {
|
||||
/*
|
||||
The Trading System is the user defined set of rules compliant with the Trading Protocol that
|
||||
defines the trading logic to be applied during each cycle of the Simulation.
|
||||
@@ -26,7 +26,7 @@ exports.newFoundationsBotModulesTradingSystem = function (processIndex) {
|
||||
let sessionParameters
|
||||
let dynamicIndicators
|
||||
|
||||
let tradingStagesModuleObject = TS.projects.foundations.botModules.tradingStages.newFoundationsBotModulesTradingStages(processIndex)
|
||||
let tradingStagesModuleObject = TS.projects.algorithmicTrading.botModules.tradingStages.newAlgorithmicTradingBotModulesTradingStages(processIndex)
|
||||
|
||||
let taskParameters = {
|
||||
market: TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.baseAsset.referenceParent.config.codeName +
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
exports.newFoundationsBotModulesSingleMarketTradingBot = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesSingleMarketTradingBot = function (processIndex) {
|
||||
|
||||
const MODULE_NAME = "Single Market Trading Bot";
|
||||
|
||||
let session = TS.projects.foundations.botModules.tradingSession.newFoundationsBotModulesTradingSession(processIndex)
|
||||
let session = TS.projects.algorithmicTrading.botModules.tradingSession.newAlgorithmicTradingBotModulesTradingSession(processIndex)
|
||||
let nextLoopTimeoutHandle;
|
||||
|
||||
let thisObject = {
|
||||
@@ -282,7 +282,7 @@
|
||||
"[INFO] run -> loop -> initializeDataDependencies -> onInizialized -> Execution finished well.")
|
||||
switch (TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.config.framework.name) {
|
||||
case 'Low-Frequency-Trading-Process': {
|
||||
processFramework = TS.projects.foundations.botModules.tradingProcess.newFoundationsBotModulesTradingProcess(processIndex);
|
||||
processFramework = TS.projects.algorithmicTrading.botModules.tradingProcess.newAlgorithmicTradingBotModulesTradingProcess(processIndex);
|
||||
startProcessFramework();
|
||||
break;
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
exports.newFoundationsBotModulesTradingSession = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesTradingSession = function (processIndex) {
|
||||
|
||||
const MODULE_NAME = "Trading Session"
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
function newAlgorithmicTradingActionSwitch() {
|
||||
|
||||
let thisObject = {
|
||||
executeAction: executeAction,
|
||||
initialize: initialize,
|
||||
finalize: finalize
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
function finalize() {
|
||||
|
||||
}
|
||||
|
||||
function initialize() {
|
||||
/* Nothing to initialize since a Function Library does not hold any state. */
|
||||
}
|
||||
|
||||
async function executeAction(action) {
|
||||
switch (action.name) {
|
||||
case 'Run Trading Session':
|
||||
{
|
||||
UI.projects.algorithmicTrading.functionLibraries.tradingSessionFunctions.runSession(action.node, false, action.callBackFunction)
|
||||
}
|
||||
break
|
||||
case 'Resume Trading Session':
|
||||
{
|
||||
UI.projects.algorithmicTrading.functionLibraries.tradingSessionFunctions.runSession(action.node, true, action.callBackFunction)
|
||||
}
|
||||
break
|
||||
case 'Stop Trading Session':
|
||||
{
|
||||
UI.projects.algorithmicTrading.functionLibraries.tradingSessionFunctions.stopSession(action.node, action.callBackFunction)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,332 @@
|
||||
function newAlgorithmicTradingFunctionLibraryTradingSessionFunctions() {
|
||||
let thisObject = {
|
||||
syncronizeSessionWithBackEnd: syncronizeSessionWithBackEnd,
|
||||
runSession: runSession,
|
||||
stopSession: stopSession
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
function syncronizeSessionWithBackEnd(node) {
|
||||
let validationsResult = validations(node)
|
||||
if (validationsResult === undefined) {
|
||||
/* If something fails at validations we just quit. */
|
||||
return
|
||||
}
|
||||
let lanNetworkNode = validationsResult.lanNetworkNode
|
||||
if (lanNetworkNode === undefined) {
|
||||
/* Nodes that do not belong to a network can not get ready. */
|
||||
return
|
||||
}
|
||||
|
||||
let eventsServerClient = UI.projects.foundations.spaces.designSpace.workspace.eventsServerClients.get(lanNetworkNode.id)
|
||||
|
||||
/* First we setup everything so as to listen to the response from the Task Server */
|
||||
let eventSubscriptionIdOnStatus
|
||||
let key = node.name + '-' + node.type + '-' + node.id
|
||||
eventsServerClient.listenToEvent(key, 'Status Response', undefined, node.id, onResponse, onStatus)
|
||||
|
||||
function onResponse(message) {
|
||||
eventSubscriptionIdOnStatus = message.eventSubscriptionId
|
||||
}
|
||||
|
||||
function onStatus(message) {
|
||||
eventsServerClient.stopListening(key, eventSubscriptionIdOnStatus, node.id)
|
||||
if (message.event.status === 'Trading Session Runnning') {
|
||||
node.payload.uiObject.menu.internalClick('Run Trading Session')
|
||||
}
|
||||
}
|
||||
|
||||
/* Second we ask the Task Server if this Session is Running. */
|
||||
eventsServerClient.raiseEvent(key, 'Trading Session Status')
|
||||
}
|
||||
|
||||
function runSession(node, resume, callBackFunction) {
|
||||
let validationsResult = validations(node)
|
||||
if (validationsResult === undefined) {
|
||||
/* If something fails at validations we just quit. */
|
||||
return
|
||||
}
|
||||
let lanNetworkNode = validationsResult.lanNetworkNode
|
||||
if (lanNetworkNode === undefined) {
|
||||
/* This means that the validations failed. */
|
||||
callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
|
||||
return
|
||||
}
|
||||
|
||||
let eventsServerClient = UI.projects.foundations.spaces.designSpace.workspace.eventsServerClients.get(lanNetworkNode.id)
|
||||
|
||||
let key = node.name + '-' + node.type + '-' + node.id
|
||||
|
||||
/* Setup Listener to check Parent Task Status of the Session */
|
||||
let eventSubscriptionIdOnStatus
|
||||
let eventHandlerKey = "Task Client - " + node.payload.parentNode.payload.parentNode.payload.parentNode.id
|
||||
|
||||
eventsServerClient.listenToEvent(eventHandlerKey, 'Task Status', undefined, node.id, onResponse, onStatus)
|
||||
|
||||
function onResponse(message) {
|
||||
eventSubscriptionIdOnStatus = message.eventSubscriptionId
|
||||
}
|
||||
|
||||
function onStatus(message) {
|
||||
eventsServerClient.stopListening(eventHandlerKey, eventSubscriptionIdOnStatus, node.id)
|
||||
|
||||
/* If Task is Not Running Display Error */
|
||||
if (message.event.status === 'Task Process Not Running') {
|
||||
node.payload.uiObject.setErrorMessage('Parent Task Not Running.')
|
||||
callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
|
||||
} else {
|
||||
node.payload.uiObject.run(eventsServerClient, callBackFunction)
|
||||
}
|
||||
}
|
||||
|
||||
/* Raise Event to Check Task Status */
|
||||
let eventKey = {}
|
||||
eventKey.taskId = node.payload.parentNode.payload.parentNode.payload.parentNode.id
|
||||
|
||||
eventsServerClient.raiseEvent("Task Manager", 'Task Status', eventKey)
|
||||
|
||||
let lightingPath = '' +
|
||||
'Trading System->' +
|
||||
'Dynamic Indicators->Indicator Function->Formula->' +
|
||||
'Trading Strategy->' +
|
||||
'Trigger Stage->Trigger On Event->Trigger Off Event->Take Position Event->' +
|
||||
'Open Stage->' +
|
||||
'Manage Stage->' +
|
||||
'Managed Stop Loss->Managed Take Profit->' +
|
||||
'Phase->Formula->Next Phase Event->Move To Phase Event->Phase->' +
|
||||
'Situation->Condition->Javascript Code->' +
|
||||
'Close Stage->' +
|
||||
'Initial Targets->Target Size In Base Asset->Target Size In Quoted Asset->Target Rate->Formula->' +
|
||||
'Open Execution->Close Execution->' +
|
||||
'Execution Algorithm->Market Buy Order->Market Sell Order->Limit Buy Order->Limit Sell Order->' +
|
||||
'Order Rate->Formula->' +
|
||||
'Create Order Event->Cancel Order Event->' +
|
||||
'Close Stage Event->' +
|
||||
'Announcement->Announcement Formula->Announcement Condition->' +
|
||||
'Size In Base Asset->Size In Quoted Asset->Position Rate->Formula->' +
|
||||
'Situation->Condition->Javascript Code->' +
|
||||
'Market Order->Limit Order->' +
|
||||
'Simulated Exchange Events->Simulated Partial Fill->Simulated Actual Rate->Simulated Fees Paid->Formula->' +
|
||||
'User Defined Code->Javascript Code->'
|
||||
|
||||
let tradingSystem = UI.projects.foundations.functionLibraries.protocolNode.getProtocolNode(node.tradingSystemReference.payload.referenceParent, false, true, true, false, false, lightingPath)
|
||||
|
||||
lightingPath = '' +
|
||||
'Trading Engine->' +
|
||||
'Dynamic Indicators->Indicator Function->' +
|
||||
'Trading Current->Trading Last->Previous->' +
|
||||
'Trading Episode->' +
|
||||
'Episode Base Asset->Episode Quoted Asset->Trading Episode Counters->Trading Episode Statistics->' +
|
||||
'Strategies->Positions->Orders->Hits->Fails->User Defined Counter->' +
|
||||
'Profit Loss->Hit Ratio->Hit Fail->Days->ROI->Annualized Rate Of Return->User Defined Statistic->' +
|
||||
'Candle->Cycle->' +
|
||||
'Begin->End->Last Begin->Last End->Open->Close->Min->Max->Index->' +
|
||||
'Distance To Trading Event->' +
|
||||
'Head Of The Market->Process Date->' +
|
||||
'Trigger On->Trigger Off->Take Position->Close Position->Next Phase->Move To Phase->Create Order->Cancel Order->Close Order->' +
|
||||
'Strategy->' +
|
||||
'Strategy Counters->' +
|
||||
'Position->' +
|
||||
'Entry Target Rate->Exit Target Rate->' +
|
||||
'Stop Loss->Stop Loss Phase->Stop Loss Position->Begin->End->Initial Value->Final Value->' +
|
||||
'Take Profit->Take Profit Phase->Take Profit Position->Begin->End->Initial Value->Final Value->' +
|
||||
'Position Counters->' +
|
||||
'Position Statistics->Days->User Defined Statistic->' +
|
||||
'Position Base Asset->Position Quoted Asset->Entry Target Size->Exit Target Size->' +
|
||||
'Profit Loss->ROI->Hit Fail->' +
|
||||
'Exchange Orders->Market Buy Orders->Market Sell Orders->Limit Buy Orders->Limit Sell Orders->' +
|
||||
'Market Order->Limit Order->' +
|
||||
'Exchange Id->Rate->Order Name->Algorithm Name->Lock->' +
|
||||
'Order Counters->' +
|
||||
'Order Base Asset->Order Quoted Asset->' +
|
||||
'Actual Size->Size->Size Filled->Amount Received->Fees Paid->Fees To Be Paid->' +
|
||||
'Order Statistics->Percentage Filled->Actual Rate->Days->User Defined Statistic->' +
|
||||
'Strategy Trigger Stage->Strategy Open Stage->Strategy Manage Stage->Strategy Close Stage->' +
|
||||
'Begin->End->Exit Type->Status->Begin Rate->End Rate->Stage Base Asset->Stage Quoted Asset->Size Placed->Target Size->Size Filled->Fees Paid->Stage Defined In->' +
|
||||
'Serial Number->Identifier->Begin->End->Begin Rate->End Rate->Strategy Name->Status->Exit Type->' +
|
||||
'Balance->Begin Balance->End Balance->' +
|
||||
'Index->Situation Name->Formula->Periods->' +
|
||||
'User Defined Variables->User Defined Variable->'
|
||||
|
||||
let tradingEngine = UI.projects.foundations.functionLibraries.protocolNode.getProtocolNode(node.tradingEngineReference.payload.referenceParent, false, true, true, false, false, lightingPath)
|
||||
|
||||
lightingPath = '' +
|
||||
'Backtesting Session->Paper Trading Session->Forward Testing Session->Live Trading Session->' +
|
||||
'Trading Parameters->' +
|
||||
'Session Base Asset->Session Quoted Asset->Time Range->Time Frame->Slippage->Fee Structure->Snapshots->Heartbeats->User Defined Parameters->' +
|
||||
'Social Bots->Telegram Bot->Discord Bot->Slack Bot->Twitter Bot->' +
|
||||
'Social Bot Command->Formula->' +
|
||||
'Exchange Account Asset->Asset->'
|
||||
|
||||
let session = UI.projects.foundations.functionLibraries.protocolNode.getProtocolNode(node, false, true, true, false, false, lightingPath)
|
||||
|
||||
let defaultExchange = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(validationsResult.exchange.payload, 'codeName')
|
||||
let defaultMarket =
|
||||
UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(validationsResult.market.baseAsset.payload.referenceParent.payload, 'codeName')
|
||||
+ '-' +
|
||||
UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(validationsResult.market.quotedAsset.payload.referenceParent.payload, 'codeName')
|
||||
|
||||
let dependencyFilter = UI.projects.foundations.functionLibraries.dependenciesFilter.createDependencyFilter(
|
||||
defaultExchange,
|
||||
defaultMarket,
|
||||
node.tradingSystemReference.payload.referenceParent
|
||||
)
|
||||
|
||||
/* Raise event to run the session */
|
||||
let event = {
|
||||
session: JSON.stringify(session),
|
||||
tradingSystem: JSON.stringify(tradingSystem),
|
||||
tradingEngine: JSON.stringify(tradingEngine),
|
||||
dependencyFilter: JSON.stringify(dependencyFilter),
|
||||
resume: resume
|
||||
}
|
||||
|
||||
if (resume !== true) {
|
||||
eventsServerClient.raiseEvent(key, 'Run Trading Session', event)
|
||||
} else {
|
||||
eventsServerClient.raiseEvent(key, 'Resume Trading Session', event)
|
||||
}
|
||||
|
||||
if (node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) {
|
||||
callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
function stopSession(node, callBackFunction) {
|
||||
let validationsResult = validations(node)
|
||||
if (validationsResult === undefined) {
|
||||
/* If something fails at validations we just quit. */
|
||||
return
|
||||
}
|
||||
let lanNetworkNode = validationsResult.lanNetworkNode
|
||||
if (lanNetworkNode === undefined) {
|
||||
/* This means that the validations failed. */
|
||||
callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
|
||||
return
|
||||
}
|
||||
|
||||
let eventsServerClient = UI.projects.foundations.spaces.designSpace.workspace.eventsServerClients.get(lanNetworkNode.id)
|
||||
|
||||
let key = node.name + '-' + node.type + '-' + node.id
|
||||
eventsServerClient.raiseEvent(key, 'Stop Trading Session')
|
||||
|
||||
node.payload.uiObject.stop(callBackFunction, undefined, true)
|
||||
}
|
||||
|
||||
function validations(node) {
|
||||
|
||||
let result = {}
|
||||
|
||||
if (node.payload.parentNode === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Session needs a Process Instance parent to be able to run.')
|
||||
return
|
||||
}
|
||||
|
||||
if (node.payload.parentNode.payload.parentNode === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Session needs to be inside a Process Instance node.')
|
||||
return
|
||||
}
|
||||
|
||||
if (node.payload.parentNode.payload.parentNode.payload.parentNode === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Session needs to be inside a Task.')
|
||||
return
|
||||
}
|
||||
|
||||
if (node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Session needs to be inside a Task Manager.')
|
||||
return
|
||||
}
|
||||
|
||||
result.taskManager = node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode
|
||||
|
||||
if (result.taskManager.payload.parentNode === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Session needs to be inside Mine Tasks.')
|
||||
return
|
||||
}
|
||||
|
||||
if (result.taskManager.payload.parentNode.payload.parentNode === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Session needs to be inside Market Tasks.')
|
||||
return
|
||||
}
|
||||
|
||||
if (result.taskManager.payload.parentNode.payload.parentNode.payload.parentNode === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Session needs to be inside Exchange Tasks.')
|
||||
return
|
||||
}
|
||||
|
||||
if (result.taskManager.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Session needs to be inside a Testing or Production Trading Tasks.')
|
||||
return
|
||||
}
|
||||
|
||||
if (result.taskManager.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Session needs to be inside a Network Node.')
|
||||
return
|
||||
}
|
||||
|
||||
result.lanNetworkNode = UI.projects.foundations.utilities.meshes.findNodeInNodeMesh(result.taskManager, 'LAN Network Node', undefined, true, false, true, false)
|
||||
|
||||
if (node.tradingSystemReference === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Session needs a child Trading System Reference.')
|
||||
return
|
||||
}
|
||||
|
||||
if (node.tradingEngineReference === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Session needs a child Trading Engine Reference.')
|
||||
return
|
||||
}
|
||||
|
||||
if (node.tradingSystemReference.payload.referenceParent === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Trading System Reference needs to reference a Trading System.')
|
||||
return
|
||||
}
|
||||
|
||||
if (node.tradingEngineReference.payload.referenceParent === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Trading Engine Reference needs to reference a Trading Engine.')
|
||||
return
|
||||
}
|
||||
|
||||
if (result.taskManager.payload.parentNode.payload.parentNode.payload.referenceParent === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Session needs to have a Default Market.')
|
||||
return
|
||||
}
|
||||
|
||||
result.market = result.taskManager.payload.parentNode.payload.parentNode.payload.referenceParent
|
||||
|
||||
if (result.market.payload.parentNode === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Default Market needs to be a child of Exchange Markets.')
|
||||
return
|
||||
}
|
||||
|
||||
if (result.market.payload.parentNode.payload.parentNode === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Exchange Markets neeed to be a child of Crypto Exchange.')
|
||||
return
|
||||
}
|
||||
|
||||
if (result.market.baseAsset === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Default Market needs to have a Base Asset.')
|
||||
return
|
||||
}
|
||||
|
||||
if (result.market.quotedAsset === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Default Market needs to have a Quoted Asset.')
|
||||
return
|
||||
}
|
||||
|
||||
if (result.market.baseAsset.payload.referenceParent === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Market Base Asset needs to reference an Asset.')
|
||||
return
|
||||
}
|
||||
|
||||
if (result.market.quotedAsset.payload.referenceParent === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Market Quoted Asset needs to reference an Asset.')
|
||||
return
|
||||
}
|
||||
|
||||
result.exchange = result.market.payload.parentNode.payload.parentNode
|
||||
|
||||
return result
|
||||
}
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
|
After Width: | Height: | Size: 9.5 KiB |
+2
-2
@@ -1,4 +1,4 @@
|
||||
exports.newFoundationsUtilitiesPlugins = function () {
|
||||
exports.newPluginsUtilitiesPlugins = function () {
|
||||
|
||||
let thisObject = {
|
||||
getPluginFileNames: getPluginFileNames,
|
||||
@@ -14,7 +14,7 @@ exports.newFoundationsUtilitiesPlugins = function () {
|
||||
|
||||
SA.nodeModules.fs.readdir(path, (err, files) => {
|
||||
if (err) {
|
||||
reject()
|
||||
reject(err)
|
||||
return
|
||||
}
|
||||
if (files === undefined) {
|
||||
+4
-2
@@ -8,7 +8,8 @@
|
||||
"confirmationLabel": "Confirm to Proceed",
|
||||
"workDoneLabel": "Done",
|
||||
"relatedUiObject": "API Map",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Community-Plugins"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
@@ -17,7 +18,8 @@
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
}
|
||||
],
|
||||
"addLeftIcons": true,
|
||||
+9
-4
@@ -7,8 +7,11 @@
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Proceed",
|
||||
"workDoneLabel": "Done",
|
||||
"relatedUiObject": "Data Mine",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"iconPathOn": "data-mine",
|
||||
"iconPathOff": "data-mine",
|
||||
"iconProject": "Data-Mining",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Community-Plugins"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
@@ -17,7 +20,8 @@
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
}
|
||||
],
|
||||
"addLeftIcons": true,
|
||||
@@ -31,7 +35,8 @@
|
||||
"name": "pluginFiles",
|
||||
"type": "array",
|
||||
"childType": "Plugin File",
|
||||
"autoAdd": false
|
||||
"autoAdd": false,
|
||||
"project": "Foundations"
|
||||
}
|
||||
]
|
||||
}
|
||||
+2
-1
@@ -8,7 +8,8 @@
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
}
|
||||
],
|
||||
"title": [
|
||||
+12
-6
@@ -6,7 +6,8 @@
|
||||
"label": "Configure",
|
||||
"iconPathOn": "configuration",
|
||||
"iconPathOff": "configuration",
|
||||
"actionFunction": "uiObject.configEditor.activate"
|
||||
"actionFunction": "uiObject.configEditor.activate",
|
||||
"actionProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
@@ -14,25 +15,29 @@
|
||||
"propertyToCheckFor": "pluginFilePosition",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"label": "Add Plugin File Position",
|
||||
"relatedUiObject": "Plugin File Position"
|
||||
"relatedUiObject": "Plugin File Position",
|
||||
"actionProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Enable Saving With Workspace",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"label": "Enable Saving With Workspace",
|
||||
"relatedUiObject": "Plugin File"
|
||||
"relatedUiObject": "Plugin File",
|
||||
"actionProject": "Community-Plugins"
|
||||
},
|
||||
{
|
||||
"action": "Disable Saving With Workspace",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"label": "Disable Saving With Workspace",
|
||||
"relatedUiObject": "Plugin File"
|
||||
"relatedUiObject": "Plugin File",
|
||||
"actionProject": "Community-Plugins"
|
||||
},
|
||||
{
|
||||
"action": "Save Plugin",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"label": "Save Plugin",
|
||||
"relatedUiObject": "Plugin File"
|
||||
"relatedUiObject": "Plugin File",
|
||||
"actionProject": "Community-Plugins"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
@@ -41,7 +46,8 @@
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
}
|
||||
],
|
||||
"editors": {
|
||||
+7
-3
@@ -7,8 +7,11 @@
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Proceed",
|
||||
"workDoneLabel": "Done",
|
||||
"relatedUiObject": "Learning Engine",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"iconPathOn": "learning-engine",
|
||||
"iconPathOff": "learning-engine",
|
||||
"iconProject": "Machine-Learning",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Community-Plugins"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
@@ -17,7 +20,8 @@
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
}
|
||||
],
|
||||
"addLeftIcons": true,
|
||||
+7
-3
@@ -7,8 +7,11 @@
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Proceed",
|
||||
"workDoneLabel": "Done",
|
||||
"relatedUiObject": "Learning Mine",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"iconPathOn": "learning-mine",
|
||||
"iconPathOff": "learning-mine",
|
||||
"iconProject": "Machine-Learning",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Community-Plugins"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
@@ -17,7 +20,8 @@
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
}
|
||||
],
|
||||
"addLeftIcons": true,
|
||||
+7
-3
@@ -7,8 +7,11 @@
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Proceed",
|
||||
"workDoneLabel": "Done",
|
||||
"relatedUiObject": "Learning System",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"iconPathOn": "learning-system",
|
||||
"iconPathOff": "learning-system",
|
||||
"iconProject": "Machine-Learning",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Community-Plugins"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
@@ -17,7 +20,8 @@
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
}
|
||||
],
|
||||
"addLeftIcons": true,
|
||||
+6
-3
@@ -6,13 +6,15 @@
|
||||
"actionFunction": "uiObject.configEditor.activate",
|
||||
"label": "Configure",
|
||||
"iconPathOn": "configuration",
|
||||
"iconPathOff": "configuration"
|
||||
"iconPathOff": "configuration",
|
||||
"actionProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Add Missing Plugin Types",
|
||||
"label": "Add Missing Plugin Types",
|
||||
"relatedUiObject": "Plugins",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Community-Plugins"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
@@ -21,7 +23,8 @@
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
}
|
||||
],
|
||||
"initialValues": {
|
||||
+7
-3
@@ -7,8 +7,11 @@
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Proceed",
|
||||
"workDoneLabel": "Done",
|
||||
"relatedUiObject": "Trading Engine",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"iconPathOn": "trading-engine",
|
||||
"iconPathOff": "trading-engine",
|
||||
"iconProject": "Algorithmic-Trading",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Community-Plugins"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
@@ -17,7 +20,8 @@
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
}
|
||||
],
|
||||
"addLeftIcons": true,
|
||||
+7
-3
@@ -7,8 +7,11 @@
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Proceed",
|
||||
"workDoneLabel": "Done",
|
||||
"relatedUiObject": "Trading Mine",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"iconPathOn": "trading-mine",
|
||||
"iconPathOff": "trading-mine",
|
||||
"iconProject": "Algorithmic-Trading",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Community-Plugins"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
@@ -17,7 +20,8 @@
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
}
|
||||
],
|
||||
"addLeftIcons": true,
|
||||
+7
-3
@@ -7,8 +7,11 @@
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Proceed",
|
||||
"workDoneLabel": "Done",
|
||||
"relatedUiObject": "Trading System",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"iconPathOn": "trading-system",
|
||||
"iconPathOff": "trading-system",
|
||||
"iconProject": "Algorithmic-Trading",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Community-Plugins"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
@@ -17,7 +20,8 @@
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
}
|
||||
],
|
||||
"addLeftIcons": true,
|
||||
+4
-2
@@ -9,7 +9,8 @@
|
||||
"confirmationLabel": "Confirm to Proceed",
|
||||
"workDoneLabel": "Done",
|
||||
"relatedUiObject": "Tutorial",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Community-Plugins"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
@@ -18,7 +19,8 @@
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
}
|
||||
],
|
||||
"addLeftIcons": true,
|
||||
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"type": "Plugins Project",
|
||||
"menuItems": [
|
||||
{
|
||||
"action": "Add Missing Children",
|
||||
"label": "Add Missing Children",
|
||||
"relatedUiObject": "Foundations Project",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Plugins",
|
||||
"relatedUiObject": "Plugins",
|
||||
"relatedUiObjectProject": "Community-Plugins",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Delete",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionProject": "Foundations"
|
||||
}
|
||||
],
|
||||
"isProjectHead": true,
|
||||
"isTitleAllwaysVisible": false,
|
||||
"addLeftIcons": true,
|
||||
"isPinned": true,
|
||||
"positionLocked": true,
|
||||
"icon": "plugins-project",
|
||||
"childrenNodesProperties": [
|
||||
{
|
||||
"name": "projectDefinition",
|
||||
"type": "node",
|
||||
"childType": "Project Definition",
|
||||
"project": "Foundations",
|
||||
"autoAdd": true
|
||||
}
|
||||
]
|
||||
}
|
||||
+4
-2
@@ -8,7 +8,8 @@
|
||||
"confirmationLabel": "Confirm to Proceed",
|
||||
"workDoneLabel": "Done",
|
||||
"relatedUiObject": "Plugin Project",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Community-Plugins"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
@@ -17,7 +18,8 @@
|
||||
"actionFunction": "payload.executeAction",
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity"
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionProject": "Foundations"
|
||||
}
|
||||
],
|
||||
"isHierarchyHead": true,
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,98 @@
|
||||
function newCommunityPluginsActionSwitch() {
|
||||
|
||||
let thisObject = {
|
||||
executeAction: executeAction,
|
||||
initialize: initialize,
|
||||
finalize: finalize
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
function finalize() {
|
||||
|
||||
}
|
||||
|
||||
function initialize() {
|
||||
/* Nothing to initialize since a Function Library does not hold any state. */
|
||||
}
|
||||
|
||||
async function executeAction(action) {
|
||||
switch (action.name) {
|
||||
case 'Install as Plugin':
|
||||
{
|
||||
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.installAsPlugin(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
case 'Add Missing Plugin Projects':
|
||||
{
|
||||
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.addMissingPluginProjects(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
case 'Add Missing Plugin Types':
|
||||
{
|
||||
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.addMissingPluginTypes(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
case 'Add Missing Plugin Data Mines':
|
||||
{
|
||||
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.addMissingPluginDataMines(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
case 'Add Missing Plugin Trading Mines':
|
||||
{
|
||||
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.addMissingPluginTradingMines(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
case 'Add Missing Plugin Trading Systems':
|
||||
{
|
||||
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.addMissingPluginTradingSystems(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
case 'Add Missing Plugin Trading Engines':
|
||||
{
|
||||
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.addMissingPluginTradingEngines(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
case 'Add Missing Plugin Learning Mines':
|
||||
{
|
||||
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.addMissingPluginLearningMines(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
case 'Add Missing Plugin Learning Systems':
|
||||
{
|
||||
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.addMissingPluginLearningSystems(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
case 'Add Missing Plugin Learning Engines':
|
||||
{
|
||||
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.addMissingPluginLearningEngines(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
case 'Add Missing Plugin Tutorials':
|
||||
{
|
||||
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.addMissingPluginTutorials(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
case 'Add Missing Plugin API Maps':
|
||||
{
|
||||
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.addMissingPluginApiMaps(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
case 'Enable Saving With Workspace':
|
||||
{
|
||||
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.enableSavingWithWorkspace(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
case 'Disable Saving With Workspace':
|
||||
{
|
||||
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.disableSavingWithWorkspace(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
case 'Save Plugin':
|
||||
{
|
||||
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.savePlugin(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
+33
-33
@@ -1,4 +1,4 @@
|
||||
function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
function newPluginsFunctionLibraryPluginsFunctions() {
|
||||
let thisObject = {
|
||||
addMissingPluginProjects: addMissingPluginProjects,
|
||||
addMissingPluginTypes: addMissingPluginTypes,
|
||||
@@ -43,14 +43,14 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
let pluginType = "Plugin" + " " + projectDefinition.plugins[i]
|
||||
|
||||
if (UI.projects.foundations.utilities.nodeChildren.isMissingChildrenByType(node, pluginType) === true) {
|
||||
UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(node, pluginType, undefined, project)
|
||||
UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(node, pluginType, undefined, 'Community-Plugins')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginDataMines(node, rootNodes) {
|
||||
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
|
||||
let projectName = UI.projects.communityPlugins.utilities.plugins.getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
@@ -58,15 +58,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Data-Mines', onNamesArrived)
|
||||
UI.projects.communityPlugins.utilities.plugins.getPluginFileNames(projectName, 'Data-Mines', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
UI.projects.foundations.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Data-Mines', 'Data Mine')
|
||||
UI.projects.communityPlugins.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Data-Mines', 'Data Mine', 'Data-Mining')
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginTradingMines(node, rootNodes) {
|
||||
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
|
||||
let projectName = UI.projects.communityPlugins.utilities.plugins.getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
@@ -74,15 +74,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Trading-Mines', onNamesArrived)
|
||||
UI.projects.communityPlugins.utilities.plugins.getPluginFileNames(projectName, 'Trading-Mines', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
UI.projects.foundations.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Trading-Mines', 'Trading Mine')
|
||||
UI.projects.communityPlugins.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Trading-Mines', 'Trading Mine', 'Algorithmic-Trading')
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginTradingSystems(node, rootNodes) {
|
||||
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
|
||||
let projectName = UI.projects.communityPlugins.utilities.plugins.getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
@@ -90,15 +90,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Trading-Systems', onNamesArrived)
|
||||
UI.projects.communityPlugins.utilities.plugins.getPluginFileNames(projectName, 'Trading-Systems', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
UI.projects.foundations.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Trading-Systems', 'Trading System')
|
||||
UI.projects.communityPlugins.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Trading-Systems', 'Trading System', 'Algorithmic-Trading')
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginTradingEngines(node, rootNodes) {
|
||||
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
|
||||
let projectName = UI.projects.communityPlugins.utilities.plugins.getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
@@ -106,15 +106,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Trading-Engines', onNamesArrived)
|
||||
UI.projects.communityPlugins.utilities.plugins.getPluginFileNames(projectName, 'Trading-Engines', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
UI.projects.foundations.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Trading-Engines', 'Trading Engine')
|
||||
UI.projects.communityPlugins.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Trading-Engines', 'Trading Engine', 'Algorithmic-Trading')
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginLearningMines(node, rootNodes) {
|
||||
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
|
||||
let projectName = UI.projects.communityPlugins.utilities.plugins.getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
@@ -122,15 +122,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Learning-Mines', onNamesArrived)
|
||||
UI.projects.communityPlugins.utilities.plugins.getPluginFileNames(projectName, 'Learning-Mines', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
UI.projects.foundations.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Learning-Mines', 'Learning Mine')
|
||||
UI.projects.communityPlugins.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Learning-Mines', 'Learning Mine', 'Machine-Learning')
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginLearningSystems(node, rootNodes) {
|
||||
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
|
||||
let projectName = UI.projects.communityPlugins.utilities.plugins.getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
@@ -138,15 +138,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Learning-Systems', onNamesArrived)
|
||||
UI.projects.communityPlugins.utilities.plugins.getPluginFileNames(projectName, 'Learning-Systems', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
UI.projects.foundations.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Learning-Systems', 'Learning System')
|
||||
UI.projects.communityPlugins.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Learning-Systems', 'Learning System', 'Machine-Learning')
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginLearningEngines(node, rootNodes) {
|
||||
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
|
||||
let projectName = UI.projects.communityPlugins.utilities.plugins.getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
@@ -154,15 +154,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Learning-Engines', onNamesArrived)
|
||||
UI.projects.communityPlugins.utilities.plugins.getPluginFileNames(projectName, 'Learning-Engines', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
UI.projects.foundations.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Learning-Engines', 'Learning Engine')
|
||||
UI.projects.communityPlugins.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Learning-Engines', 'Learning Engine', 'Machine-Learning')
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginTutorials(node, rootNodes) {
|
||||
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
|
||||
let projectName = UI.projects.communityPlugins.utilities.plugins.getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
@@ -170,15 +170,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Tutorials', onNamesArrived)
|
||||
UI.projects.communityPlugins.utilities.plugins.getPluginFileNames(projectName, 'Tutorials', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
UI.projects.foundations.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Tutorials', 'Tutorial')
|
||||
UI.projects.communityPlugins.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Tutorials', 'Tutorial', 'Education')
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginApiMaps(node, rootNodes) {
|
||||
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
|
||||
let projectName = UI.projects.communityPlugins.utilities.plugins.getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
@@ -186,10 +186,10 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'API-Maps', onNamesArrived)
|
||||
UI.projects.communityPlugins.utilities.plugins.getPluginFileNames(projectName, 'API-Maps', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
UI.projects.foundations.utilities.plugins.addMissingPluginFiles(node, fileNames, 'API-Maps', 'API Map')
|
||||
UI.projects.communityPlugins.utilities.plugins.addMissingPluginFiles(node, fileNames, 'API-Maps', 'API Map', 'Foundations')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,16 +204,16 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
}
|
||||
|
||||
function savePlugin(node, rootNodes) {
|
||||
UI.projects.foundations.utilities.plugins.savePluginFile(node)
|
||||
UI.projects.communityPlugins.utilities.plugins.savePluginFile(node)
|
||||
}
|
||||
|
||||
function installAsPlugin(node, rootNodes) {
|
||||
let plugins = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadByNodeType('Plugins')
|
||||
let pluginProject = UI.projects.foundations.utilities.nodeChildren.findChildByCodeName(plugins, node.project)
|
||||
let pluginFolderName = UI.projects.foundations.utilities.plugins.getPluginFolderNamesByNodeType(node.type)
|
||||
let pluginFolderName = UI.projects.communityPlugins.utilities.plugins.getPluginFolderNamesByNodeType(node.type)
|
||||
let pluginForlderNodeType = 'Plugin ' + pluginFolderName.replaceAll('-', ' ')
|
||||
let pluginFolderNode = UI.projects.foundations.utilities.nodeChildren.findChildByType(pluginProject, pluginForlderNodeType)
|
||||
let pluginFile = UI.projects.foundations.utilities.plugins.addMissingPluginFile(pluginFolderNode, node.name, pluginFolderName, node.type, true)
|
||||
let pluginFile = UI.projects.communityPlugins.utilities.plugins.addMissingPluginFile(pluginFolderNode, node.name, pluginFolderName, node.type, node.project, true)
|
||||
node.isPlugin = true
|
||||
|
||||
if (pluginFile === undefined) {
|
||||
@@ -221,6 +221,6 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
return
|
||||
}
|
||||
|
||||
UI.projects.foundations.utilities.plugins.savePluginFile(pluginFile)
|
||||
UI.projects.communityPlugins.utilities.plugins.savePluginFile(pluginFile)
|
||||
}
|
||||
}
|
||||
+6
-6
@@ -1,4 +1,4 @@
|
||||
function newFoundationsUtilitiesPlugins() {
|
||||
function newPluginsUtilitiesPlugins() {
|
||||
let thisObject = {
|
||||
getPluginFileNames: getPluginFileNames,
|
||||
getPluginFolderNamesByNodeType: getPluginFolderNamesByNodeType,
|
||||
@@ -24,20 +24,20 @@ function newFoundationsUtilitiesPlugins() {
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginFiles(node, fileNames, pluginFolder, nodeType) {
|
||||
function addMissingPluginFiles(node, fileNames, pluginFolder, nodeType, project) {
|
||||
for (let i = 0; i < fileNames.length; i++) {
|
||||
let fileName = fileNames[i]
|
||||
fileName = fileName.replace('.json', '')
|
||||
addMissingPluginFile(node, fileName, pluginFolder, nodeType, false)
|
||||
addMissingPluginFile(node, fileName, pluginFolder, nodeType, project, false)
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginFile(node, fileName, pluginFolder, nodeType, saveWithWorkspace) {
|
||||
function addMissingPluginFile(node, fileName, pluginFolder, nodeType, project, saveWithWorkspace) {
|
||||
if (UI.projects.foundations.utilities.nodeChildren.isMissingChildrenByName(node, fileName) === true) {
|
||||
let child = UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(node, 'Plugin File', undefined, 'Foundations')
|
||||
let child = UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(node, 'Plugin File', undefined, 'Community-Plugins')
|
||||
child.name = fileName
|
||||
child.config = JSON.stringify({
|
||||
project: node.project,
|
||||
project: project,
|
||||
fileName: fileName,
|
||||
folderName: pluginFolder,
|
||||
nodeType: nodeType,
|
||||
File renamed without changes.
File renamed without changes.
Binary file not shown.
|
After Width: | Height: | Size: 9.0 KiB |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 203 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user