diff --git a/CockpitSpace/RestartSimulation.js b/CockpitSpace/RestartSimulation.js index 4d5787271..0b584dff5 100644 --- a/CockpitSpace/RestartSimulation.js +++ b/CockpitSpace/RestartSimulation.js @@ -1,6 +1,8 @@ function newRestartSimulation () { const MODULE_NAME = 'Restart Simulation' + const logger = newWebDebugLog() + logger.fileName = MODULE_NAME let thisObject = { visible: true, @@ -113,12 +115,21 @@ function newRestartSimulation () { thisObject.status = 'Saving' let result = await canvas.strategySpace.strategizerGateway.saveToStrategyzer(simulationParams) if (result === true) { - if (window.canvasApp.executingAt !== 'Local') { + if (window.canvasApp.executingAt === 'Local') { + callServer('', 'RestartCloneExecutor', onSaved) + function onSaved (err) { + if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result) { + logger.write('[INFO] Restart Simulation -> Clone Executor Restarted') + } else { + logger.write('[ERROR] Restart Simulation -> Can not restart Clone Executor. err = ' + err.messsage) + } + } + } else { thisObject.status = 'Restarting' await graphQlRestartSimulation(simulationParams) } thisObject.status = 'Calculating' - counterTillNextState = 50 + counterTillNextState = 500 } else { thisObject.status = 'Error' counterTillNextState = 500 @@ -170,7 +181,7 @@ function newRestartSimulation () { break case 'Calculating': thisObject.status = 'Refreshing' - counterTillNextState = 15 + counterTillNextState = 150 break case 'Refreshing': thisObject.status = 'Reviewing' @@ -180,7 +191,7 @@ function newRestartSimulation () { break case 'Reviewing': thisObject.status = '2nd Refresh' - counterTillNextState = 25 + counterTillNextState = 250 break case '2nd Refresh': thisObject.status = 'Ready' @@ -278,7 +289,7 @@ function newRestartSimulation () { switch (thisObject.status) { case 'Ready': - label = 'RUN SIMULATION' + label = 'RESTART BOTS' break case 'Saving': label = 'SAVING STRATEGIES CHANGES...' diff --git a/FloatingSpace/StrategyPartConstructor.js b/FloatingSpace/StrategyPartConstructor.js index 92288655f..6c13dd5ce 100644 --- a/FloatingSpace/StrategyPartConstructor.js +++ b/FloatingSpace/StrategyPartConstructor.js @@ -108,8 +108,8 @@ function newStrategyPartConstructor () { currentStatus: true, label: undefined, visible: false, - iconPathOn: 'compass', - iconPathOff: 'compass-bw', + iconPathOn: 'menu-tensor-fixed-angles', + iconPathOff: 'menu-tensor-free-angles', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -202,8 +202,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Share', visible: false, - iconPathOn: 'share', - iconPathOff: 'share', + iconPathOn: 'menu-share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -222,7 +222,7 @@ function newStrategyPartConstructor () { label: 'Run', visible: false, iconPathOn: 'paper-plane', - iconPathOff: 'share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -294,8 +294,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Share', visible: false, - iconPathOn: 'share', - iconPathOff: 'share', + iconPathOn: 'menu-share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -493,8 +493,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Share', visible: false, - iconPathOn: 'share', - iconPathOff: 'share', + iconPathOn: 'menu-share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -540,8 +540,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Share', visible: false, - iconPathOn: 'share', - iconPathOff: 'share', + iconPathOn: 'menu-share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -587,8 +587,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Share', visible: false, - iconPathOn: 'share', - iconPathOff: 'share', + iconPathOn: 'menu-share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -634,8 +634,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Share', visible: false, - iconPathOn: 'share', - iconPathOff: 'share', + iconPathOn: 'menu-share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -681,8 +681,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Share', visible: false, - iconPathOn: 'share', - iconPathOff: 'share', + iconPathOn: 'menu-share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -741,8 +741,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Share', visible: false, - iconPathOn: 'share', - iconPathOff: 'share', + iconPathOn: 'menu-share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -788,8 +788,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Share', visible: false, - iconPathOn: 'share', - iconPathOff: 'share', + iconPathOn: 'menu-share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -835,8 +835,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Share', visible: false, - iconPathOn: 'share', - iconPathOff: 'share', + iconPathOn: 'menu-share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -882,8 +882,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Share', visible: false, - iconPathOn: 'share', - iconPathOff: 'share', + iconPathOn: 'menu-share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -929,8 +929,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Share', visible: false, - iconPathOn: 'share', - iconPathOff: 'share', + iconPathOn: 'menu-share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -976,8 +976,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Share', visible: false, - iconPathOn: 'share', - iconPathOff: 'share', + iconPathOn: 'menu-share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -1023,8 +1023,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Share', visible: false, - iconPathOn: 'share', - iconPathOff: 'share', + iconPathOn: 'menu-share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -1070,8 +1070,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Share', visible: false, - iconPathOn: 'share', - iconPathOff: 'share', + iconPathOn: 'menu-share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -1117,8 +1117,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Share', visible: false, - iconPathOn: 'share', - iconPathOff: 'share', + iconPathOn: 'menu-share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -1151,8 +1151,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Share', visible: false, - iconPathOn: 'share', - iconPathOff: 'share', + iconPathOn: 'menu-share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -1185,8 +1185,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Share', visible: false, - iconPathOn: 'share', - iconPathOff: 'share', + iconPathOn: 'menu-share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -1232,8 +1232,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Share', visible: false, - iconPathOn: 'share', - iconPathOff: 'share', + iconPathOn: 'menu-share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -1279,8 +1279,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Share', visible: false, - iconPathOn: 'share', - iconPathOff: 'share', + iconPathOn: 'menu-share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -1339,8 +1339,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Share', visible: false, - iconPathOn: 'share', - iconPathOff: 'share', + iconPathOn: 'menu-share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -1393,8 +1393,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Share', visible: false, - iconPathOn: 'share', - iconPathOff: 'share', + iconPathOn: 'menu-share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -1440,8 +1440,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Share', visible: false, - iconPathOn: 'share', - iconPathOff: 'share', + iconPathOn: 'menu-share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -1487,8 +1487,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Share', visible: false, - iconPathOn: 'share', - iconPathOff: 'share', + iconPathOn: 'menu-share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -1534,8 +1534,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Share', visible: false, - iconPathOn: 'share', - iconPathOff: 'share', + iconPathOn: 'menu-share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, @@ -1588,8 +1588,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Share', visible: false, - iconPathOn: 'share', - iconPathOff: 'share', + iconPathOn: 'menu-share', + iconPathOff: 'menu-share', rawRadius: 8, targetRadius: 0, currentRadius: 0, diff --git a/FloatingSpace/StrategyPartTitle.js b/FloatingSpace/StrategyPartTitle.js index a47ec5402..7a79eaf73 100644 --- a/FloatingSpace/StrategyPartTitle.js +++ b/FloatingSpace/StrategyPartTitle.js @@ -153,7 +153,7 @@ function newStrategyPartTitle () { } function getContainer (point) { - if (CURRENT_TOP_MARGIN === 0) { return } // Fullscreen mode does not allow INPUT elements + if (AT_FULL_SCREEN_MODE === true) { return } // Fullscreen mode does not allow INPUT elements let container diff --git a/Spaces/StrategySpace.js b/Spaces/StrategySpace.js index c7650827d..b5c0fbfde 100644 --- a/Spaces/StrategySpace.js +++ b/Spaces/StrategySpace.js @@ -49,20 +49,20 @@ function newStrategySpace () { ['Parameters', 'settings'], ['Base Asset', 'sitemap'], ['Strategy', 'quality'], - ['Trigger Stage', 'chronometer'], + ['Trigger Stage', 'stage-trigger'], ['Open Stage', 'stage-open'], ['Manage Stage', 'video-player'], ['Close Stage', 'stage-close'], - ['Position Size', 'responsive'], - ['Position Rate', 'promotion'], - ['Trigger On Event', 'startup'], - ['Trigger Off Event', 'support'], - ['Take Position Event', 'compass'], + ['Position Size', 'stage-open-position-size'], + ['Position Rate', 'stage-open-postion-rate'], + ['Trigger On Event', 'stage-trigger-trigger-on'], + ['Trigger Off Event', 'stage-trigger-trigger-off'], + ['Take Position Event', 'stage-trigger-take-position'], ['Initial Definition', 'task'], ['Open Execution', 'piggy-bank'], ['Close Execution', 'piggy-bank'], ['Stop', 'stop'], - ['Take Profit', 'competition'], + ['Take Profit', 'stage-open-take-profit'], ['Phase', 'placeholder'], ['Formula', 'pipette'], ['Next Phase Event', 'schedule'], @@ -91,7 +91,6 @@ function newStrategySpace () { 'chat', 'chronometer', 'compass', - 'compass-bw', 'competition', 'content', 'design-tool', @@ -139,10 +138,19 @@ function newStrategySpace () { 'menu-tree-minus', 'menu-tree-plus', 'menu-backup', - 'share', + 'menu-share', 'stop', 'stage-open', - 'stage-close' + 'stage-close', + 'stage-trigger', + 'stage-trigger-trigger-on', + 'stage-trigger-trigger-off', + 'stage-trigger-take-position', + 'menu-tensor-fixed-angles', + 'menu-tensor-free-angles', + 'stage-open-position-size', + 'stage-open-take-profit', + 'stage-open-postion-rate' ] for (let i = 0; i < iconsNames.length; i++) { diff --git a/StrategySpace/StrategizerGateway.js b/StrategySpace/StrategizerGateway.js index 431129be8..1fb458ec8 100644 --- a/StrategySpace/StrategizerGateway.js +++ b/StrategySpace/StrategizerGateway.js @@ -114,12 +114,6 @@ function newStrategizerGateway () { return } - let idAtStrategizer = window.localStorage.getItem(CANVAS_APP_NAME + '.' + MODULE_NAME + '.' + user.alias) - if (idAtStrategizer === undefined || idAtStrategizer === null) { - logger.write('[ERROR] saveToStrategyzer -> Can not save when idAtStrategizer is null or undefined.') - return - } - if (window.canvasApp.executingAt === 'Local') { tradingSystem.simulationParams = simulationParams callServer(JSON.stringify(tradingSystem), 'SaveDefinition', onSaved) diff --git a/StrategySpace/Workspace/FunctionLibraries/PartsFromNodes.js b/StrategySpace/Workspace/FunctionLibraries/PartsFromNodes.js index b37cdf60a..5aa38b5ff 100644 --- a/StrategySpace/Workspace/FunctionLibraries/PartsFromNodes.js +++ b/StrategySpace/Workspace/FunctionLibraries/PartsFromNodes.js @@ -356,7 +356,7 @@ function newPartsFromNodes () { let exchangeAccount = parentNode let key = { name: 'New Key', - code: 'Paste your exchange API secret key here. Secret keys are filtered out and NOT exported when using the SHARE menu option on any object at your workspace. Secret keys ARE downloaded when using the download button.' + code: 'Paste your exchange API secret key here and the put the key name as this key object title. Secret keys are filtered out and NOT exported when using the SHARE menu option on any object at your workspace. Secret keys ARE downloaded when using the download button.' } exchangeAccount.keys.push(key) createPart('Exchange Account Key', key.name, key, exchangeAccount, exchangeAccount, 'Account Key')