Merge branch 'Superalgos:develop' into develop

This commit is contained in:
quantum8 authored and GitHub committed 2021-10-08 08:20:33 +10:00
commit 7c44fc3761
236 files changed
+9232 -5506

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
# name of your github action
name: CI
# this will help you specify where to run
on:
push:
branches:
# this will run on the electron branch
- develop
# this is where the magic happens, each job happens in parallel btw
jobs:
build_on_mac:
runs-on: macOS-latest
steps:
- uses: actions/checkout@master
with:
ref: develop
- uses: actions/setup-node@master
with:
node-version: 16
- name: see directory
run: ls
build_on_win:
runs-on: windows-2016
steps:
- uses: actions/checkout@master
with:
ref: develop
- uses: actions/setup-node@master
with:
node-version: 16
- name: see directory
run: ls
+3
View File
@@ -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
@@ -17,3 +19,4 @@ node_modules
launch.json
package-lock.json
.idea
build
+1 -1
View File
@@ -12,5 +12,5 @@ RUN apk add --no-cache --virtual .build-deps make g++ \
USER superalgos
EXPOSE 34248
EXPOSE 18041
VOLUME ["/app/Data-Storage", "/app/Log-Files", "/app/My-Workspaces"]
VOLUME ["/app/Platform/My-Data-Storage", "/app/Platform/My-Log-Files", "/app/Platform/My-Workspaces"]
ENTRYPOINT ["node", "platform", "noBrowser"]
+3 -3
View File
@@ -11,7 +11,7 @@ services:
- '34248:34248'
- '18041:18041'
volumes:
- ../Data-Storage:/app/Data-Storage
- ../Log-Files:/app/Log-Files
- ../My-Workspaces:/app/My-Workspaces
- ../Platform/My-Data-Storage:/app/Platform/My-Data-Storage
- ../Platform/My-Log-Files:/app/Platform/My-Log-Files
- ../Platform/My-Workspaces:/app/Platform/My-Workspaces
restart: on-failure
+11 -9
View File
@@ -1,18 +1,20 @@
const path = require("path")
exports.newEnvironment = function () {
let thisObject = {
WEB_SERVER_URL: 'localhost',
CLIENT_WEB_SOCKETS_INTERFACE_PORT: 18041,
CLIENT_HTTP_INTERFACE_PORT: 34248,
PATH_TO_DATA_STORAGE: './Data-Storage',
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_FONTS: './Platform/WebServer/Fonts'
PATH_TO_DATA_STORAGE: path.join(__dirname, './Platform/My-Data-Storage'),
PATH_TO_PROJECTS: path.join(__dirname, './Projects'),
PATH_TO_LOG_FILES: path.join(__dirname, './Platform/My-Log-Files'),
PATH_TO_PROJECTS_REQUIRED: path.join(__dirname, './Projects'),
PATH_TO_PROJECT_SCHEMA: path.join(__dirname, './Projects/ProjectsSchema.json'),
PATH_TO_CLIENT: path.join(__dirname, './Platform'),
PATH_TO_DEFAULT_WORKSPACE: path.join(__dirname, './Projects/Foundations/Plugins/Workspaces'),
PATH_TO_MY_WORKSPACES: path.join(__dirname, './Platform/My-Workspaces'),
PATH_TO_FONTS: path.join(__dirname, './Platform/WebServer/Fonts')
}
return thisObject
+3 -3
View File
@@ -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'
}
+7 -7
View File
@@ -79,7 +79,7 @@ exports.newGithubServer = function newGithubServer() {
const octokit = new Octokit({
auth: token,
userAgent: 'Superalgos Beta 11'
userAgent: 'Superalgos Beta 12'
})
await getList()
@@ -207,7 +207,7 @@ exports.newGithubServer = function newGithubServer() {
const { Octokit } = SA.nodeModules.octokit
const octokit = new Octokit({
auth: token,
userAgent: 'Superalgos Beta 11'
userAgent: 'Superalgos Beta 12'
})
await getPrList()
await mergePrs()
@@ -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
+15 -9
View File
@@ -725,7 +725,7 @@ exports.newHttpInterface = function newHttpInterface() {
const octokit = new Octokit({
auth: token,
userAgent: 'Superalgos Beta 11'
userAgent: 'Superalgos Beta 12'
})
const repo = 'Superalgos'
@@ -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)
+1 -1
View File
@@ -143,7 +143,7 @@ exports.newPlatformApp = function newPlatformApp() {
console.log('Http Interface .............................................. Listening at port ' + global.env.CLIENT_HTTP_INTERFACE_PORT)
console.log('')
console.log("You are running Superalgos Beta 11")
console.log("You are running Superalgos Beta 12")
console.log('')
console.log("What's new? These are the main new features in this version:")
console.log('')
Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

@@ -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
}
]
}
@@ -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"
@@ -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"
}
]
}
@@ -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"
}
]
}
@@ -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"
}
]
}
@@ -1,4 +1,4 @@
exports.newFoundationsBotModulesExchangeAPI = function (processIndex) {
exports.newAlgorithmicTradingBotModulesExchangeAPI = function (processIndex) {
let MODULE_NAME = "Exchange API";
@@ -1,8 +1,7 @@
exports.newFoundationsBotModulesOrdersCalculations = function (processIndex) {
exports.newAlgorithmicTradingBotModulesOrdersCalculations = function (processIndex) {
/*
When we are live trading, we need to syncronize with the exchange.
*/
const MODULE_NAME = 'Orders Calculations'
let thisObject = {
actualSizeCalculation: actualSizeCalculation,
@@ -1,8 +1,7 @@
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.
*/
const MODULE_NAME = 'Orders Simulations'
let thisObject = {
actualSizeSimulation: actualSizeSimulation,
@@ -1,4 +1,4 @@
exports.newFoundationsBotModulesSnapshots = function(processIndex) {
exports.newAlgorithmicTradingBotModulesSnapshots = function(processIndex) {
/*
This module encapsulates the snapshots functionality.
*/
@@ -1,9 +1,9 @@
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.
*/
const MODULE_NAME = 'Trading Engine'
let thisObject = {
mantain: mantain,
reset: reset,
@@ -1,8 +1,7 @@
exports.newFoundationsBotModulesTradingEpisode = function (processIndex) {
exports.newAlgorithmicTradingBotModulesTradingEpisode = function (processIndex) {
/*
This module packages all functions related to Episodes.
*/
const MODULE_NAME = 'Trading Episode'
let thisObject = {
mantain: mantain,
reset: reset,
@@ -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
@@ -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)
@@ -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,4 +1,4 @@
exports.newFoundationsBotModulesTradingPosition = function (processIndex) {
exports.newAlgorithmicTradingBotModulesTradingPosition = function (processIndex) {
/*
This module packages all functions related to Positions.
*/
@@ -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,4 +1,4 @@
exports.newFoundationsBotModulesTradingRecords = function (processIndex) {
exports.newAlgorithmicTradingBotModulesTradingRecords = function (processIndex) {
/*
This module facilitates the appending of records to the output of the process.
*/
@@ -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. */
@@ -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,8 +1,8 @@
exports.newFoundationsBotModulesTradingStrategy = function (processIndex) {
exports.newAlgorithmicTradingBotModulesTradingStrategy = function (processIndex) {
/*
This module packages all functions related to Strategies.
*/
const MODULE_NAME = 'Trading Strategy'
let thisObject = {
mantain: mantain,
reset: reset,
@@ -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 +
@@ -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,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
}
}
}
@@ -1,4 +1,4 @@
function newFoundationsFunctionLibraryTradingSessionFunctions() {
function newAlgorithmicTradingFunctionLibraryTradingSessionFunctions() {
let thisObject = {
syncronizeSessionWithBackEnd: syncronizeSessionWithBackEnd,
runSession: runSession,
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

@@ -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) {
@@ -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,
@@ -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"
}
]
}
@@ -8,7 +8,8 @@
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
}
],
"title": [
@@ -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,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,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,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,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,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,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,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,
@@ -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
}
]
}
@@ -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,
@@ -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
}
}
}
@@ -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)
}
}
@@ -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,
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Loaded 100 of 236 files, more files were not shown because too many files have changed in this diff. Show more