37 files changed
+449
-159
No files matched your search
@@ -13,6 +13,9 @@ TASK_SERVER_PATH=./TaskServer
|
||||
INTER_PROCESS_FILES_PATH=./Inter-Process-Files
|
||||
STORAGE_PATH=./Data-Storage
|
||||
PLOTTERS_PATH=./Legacy-Code
|
||||
DATA_MINES_PATH=./Data-Mines
|
||||
TRADING_SYSTEMS_PATH=./Trading-Systems
|
||||
SUPER_SCRIPTS_PATH=./Super-Scripts
|
||||
|
||||
USE_KEYVAULT=false
|
||||
WRITE_LOGS_TO_FILES=true
|
||||
|
||||
+47
-41
@@ -129,6 +129,7 @@
|
||||
"docURL": "https://docs.superalgos.org/suite-data-mine-hierarchy.html#plotter-panel",
|
||||
"icon": "plotter-panel",
|
||||
"level": 4,
|
||||
"isTitleAllwaysVisible": true,
|
||||
"propertyNameAtParent": "panels",
|
||||
"chainAttachesTo": {
|
||||
"compatibleTypes": "->Plotter Module->"
|
||||
@@ -713,6 +714,13 @@
|
||||
"actionFunction": "payload.onMenuItemClick",
|
||||
"ring": 1
|
||||
},
|
||||
{
|
||||
"action": "Configure Workspace",
|
||||
"actionFunction": "uiObject.configEditor.activate",
|
||||
"label": "Configure Workspace",
|
||||
"iconPathOn": "html",
|
||||
"iconPathOff": "html"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Trading System",
|
||||
@@ -731,18 +739,6 @@
|
||||
"relatedUiObject": "Data Mine",
|
||||
"actionFunction": "payload.onMenuItemClick"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Crypto Ecosystem",
|
||||
"relatedUiObject": "Crypto Ecosystem",
|
||||
"actionFunction": "payload.onMenuItemClick"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Charting Space",
|
||||
"relatedUiObject": "Charting Space",
|
||||
"actionFunction": "payload.onMenuItemClick"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Super Scripts",
|
||||
@@ -761,7 +757,10 @@
|
||||
"addLeftIcons": false,
|
||||
"isPinned": true,
|
||||
"positionLocked": true,
|
||||
"icon": "design-tool"
|
||||
"icon": "design-tool",
|
||||
"editors": {
|
||||
"config": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Situation",
|
||||
@@ -843,6 +842,13 @@
|
||||
{
|
||||
"type": "Super Scripts",
|
||||
"menuItems": [
|
||||
{
|
||||
"action": "Configure Super Scripts",
|
||||
"actionFunction": "uiObject.configEditor.activate",
|
||||
"label": "Configure Super Scripts",
|
||||
"iconPathOn": "html",
|
||||
"iconPathOff": "html"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Scripts Library",
|
||||
@@ -861,11 +867,17 @@
|
||||
"actionFunction": "payload.onMenuItemClick"
|
||||
}
|
||||
],
|
||||
"isTitleAllwaysVisible": false,
|
||||
"isTitleAllwaysVisible": true,
|
||||
"isHierarchyHead": true,
|
||||
"addLeftIcons": true,
|
||||
"level": 1,
|
||||
"icon": "super-scripts",
|
||||
"editors": {
|
||||
"config": true
|
||||
},
|
||||
"initialValues": {
|
||||
"code": "{ \n\"codeName\": \"\"\n}"
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"name": "scriptsLibrary",
|
||||
@@ -3084,6 +3096,11 @@
|
||||
"actionFunction": "payload.onMenuItemClick"
|
||||
}
|
||||
],
|
||||
"isTitleAllwaysVisible": true,
|
||||
"title": [
|
||||
"Use Reference Parent",
|
||||
"Use Reference Parent Parent",
|
||||
],
|
||||
"addLeftIcons": true,
|
||||
"level": 3,
|
||||
"referenceAttachesTo": {
|
||||
@@ -3191,6 +3208,9 @@
|
||||
"actionFunction": "payload.onMenuItemClick"
|
||||
}
|
||||
],
|
||||
"initialValues": {
|
||||
"code": "{ \n\"codeName\": \"\",\n\"isString\": false,\n\"isCalculated\": false\n}"
|
||||
},
|
||||
"isTitleAllwaysVisible": true,
|
||||
"addLeftIcons": true,
|
||||
"editors": {
|
||||
@@ -3537,6 +3557,13 @@
|
||||
"type": "Trading System",
|
||||
"docURL": "https://docs.superalgos.org/suite-trading-system-hierarchy.html#trading-system",
|
||||
"menuItems": [
|
||||
{
|
||||
"action": "Configure Trading System",
|
||||
"actionFunction": "uiObject.configEditor.activate",
|
||||
"label": "Configure Trading System",
|
||||
"iconPathOn": "html",
|
||||
"iconPathOff": "html"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Strategy",
|
||||
@@ -3566,6 +3593,12 @@
|
||||
"addLeftIcons": true,
|
||||
"level": 0,
|
||||
"icon": "analysis",
|
||||
"editors": {
|
||||
"config": true
|
||||
},
|
||||
"initialValues": {
|
||||
"code": "{ \n\"codeName\": \"\"\n}"
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"name": "strategies",
|
||||
@@ -4524,15 +4557,6 @@
|
||||
"label": "Add Super Actions",
|
||||
"relatedUiObject": "Super Actions",
|
||||
"actionFunction": "payload.onMenuItemClick"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Delete",
|
||||
"label": "Delete Crypto Ecosystem",
|
||||
"iconPathOn": "delete",
|
||||
"iconPathOff": "delete",
|
||||
"actionFunction": "payload.onMenuItemClick"
|
||||
}
|
||||
],
|
||||
"isHierarchyHead": true,
|
||||
@@ -5300,15 +5324,6 @@
|
||||
"label": "Add Dashboard",
|
||||
"relatedUiObject": "Dashboard",
|
||||
"actionFunction": "payload.onMenuItemClick"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Delete",
|
||||
"label": "Delete Charting Space",
|
||||
"iconPathOn": "delete",
|
||||
"iconPathOff": "delete",
|
||||
"actionFunction": "payload.onMenuItemClick"
|
||||
}
|
||||
],
|
||||
"isHierarchyHead": true,
|
||||
@@ -5469,15 +5484,6 @@
|
||||
"iconPathOff": "html",
|
||||
"dontShowAtFullscreen": true,
|
||||
"actionFunction": "uiObject.configEditor.activate"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Delete",
|
||||
"label": "Delete Viewport",
|
||||
"iconPathOn": "delete",
|
||||
"iconPathOff": "delete",
|
||||
"actionFunction": "payload.onMenuItemClick"
|
||||
}
|
||||
],
|
||||
"initialValues": {
|
||||
|
||||
@@ -111,6 +111,10 @@ function newAnimation () {
|
||||
}
|
||||
}
|
||||
|
||||
/* Frame per Seconds */
|
||||
|
||||
ANIMATION_FRAME_PER_SECONDS = Math.trunc(1000 / totalTimeConsumed)
|
||||
|
||||
/* Performance Check */
|
||||
if (SHOW_ANIMATION_PERFORMACE === true) {
|
||||
row = 0
|
||||
@@ -132,6 +136,8 @@ function newAnimation () {
|
||||
printLabel(DEBUG.variable3, 300, 100 + row * 30, 1, 20, UI_COLOR.RED)
|
||||
row++
|
||||
printLabel(DEBUG.variable4, 300, 100 + row * 30, 1, 20, UI_COLOR.RED)
|
||||
row++
|
||||
printLabel('Animation Frame Per Seconds: ' + ANIMATION_FRAME_PER_SECONDS, 300, 100 + row * 30, 1, 20, UI_COLOR.TITANIUM_YELLOW)
|
||||
}
|
||||
} else {
|
||||
browserCanvas.width = 1
|
||||
|
||||
@@ -40,6 +40,7 @@ function newCanvas () {
|
||||
designSpace: undefined,
|
||||
animation: undefined,
|
||||
mouse: undefined,
|
||||
shorcutNumbers: new Map(),
|
||||
initialize: initialize,
|
||||
finalize: finalize
|
||||
}
|
||||
@@ -57,12 +58,14 @@ function newCanvas () {
|
||||
},
|
||||
action: ''
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
function finalize () {
|
||||
try {
|
||||
thisObject.chartingSpace.finalize()
|
||||
thisObject.floatingSpace.finalize()
|
||||
thisObject.shorcutNumbers = undefined
|
||||
|
||||
browserCanvas.removeEventListener('mousedown', onMouseDown, false)
|
||||
browserCanvas.removeEventListener('mouseup', onMouseUp, false)
|
||||
@@ -252,6 +255,24 @@ function newCanvas () {
|
||||
checkMediaRecording(event)
|
||||
canvas.chartingSpace.onKeyPressed(event)
|
||||
|
||||
/* Shourcuts to Menu Items */
|
||||
if ((event.keyCode >= 48 && event.keyCode <= 57)) {
|
||||
let number = event.key
|
||||
if (MENU_ITEM_ON_FOCUS !== undefined) {
|
||||
let menuItem = thisObject.shorcutNumbers.get(number)
|
||||
if (menuItem !== undefined) {
|
||||
menuItem.shorcutNumber = undefined
|
||||
}
|
||||
thisObject.shorcutNumbers.set(number, MENU_ITEM_ON_FOCUS)
|
||||
MENU_ITEM_ON_FOCUS.shorcutNumber = number
|
||||
} else {
|
||||
let menuItem = thisObject.shorcutNumbers.get(number)
|
||||
if (menuItem !== undefined) {
|
||||
menuItem.internalClick()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.key === 'Escape' && canvas.floatingSpace.inMapMode === true) {
|
||||
canvas.floatingSpace.exitMapMode()
|
||||
}
|
||||
@@ -409,6 +430,7 @@ function newCanvas () {
|
||||
}
|
||||
|
||||
if ((event.ctrlKey === true || event.metaKey === true) && event.altKey === true) {
|
||||
/* Shortcuts to nodes */
|
||||
if ((event.keyCode >= 48 && event.keyCode <= 57) || (event.keyCode >= 65 && event.keyCode <= 90)) {
|
||||
/* From here we prevent the default behaviour. Putting it earlier prevents imput box and text area to receive keystrokes */
|
||||
event.preventDefault()
|
||||
|
||||
@@ -109,7 +109,7 @@ function newEdgeEditor () {
|
||||
/* Resize the Time Machine to match the current screen aspect ration */
|
||||
|
||||
thisObject.container.parentContainer.frame.width = browserCanvas.width / TIME_MACHINE_WIDTH
|
||||
thisObject.container.parentContainer.frame.height = (browserCanvas.height - TOP_SPACE_HEIGHT - COCKPIT_SPACE_HEIGHT) / TIME_MACHINE_HEIGHT
|
||||
thisObject.container.parentContainer.frame.height = (COCKPIT_SPACE_POSITION - TOP_SPACE_HEIGHT) / TIME_MACHINE_HEIGHT
|
||||
coordinateSystem.maxHeight = thisObject.container.parentContainer.frame.height
|
||||
coordinateSystem.maxWidth = thisObject.container.parentContainer.frame.width
|
||||
coordinateSystem.recalculateScale()
|
||||
@@ -185,25 +185,25 @@ function newEdgeEditor () {
|
||||
function onKeyPressed (event) {
|
||||
const STEP = 10
|
||||
|
||||
if (event.shiftKey === false && event.code === 'ArrowLeft') {
|
||||
if (event.shiftKey === false && event.ctrlKey === false && event.code === 'ArrowLeft') {
|
||||
thisObject.container.frame.position.x = thisObject.container.frame.position.x + STEP
|
||||
whatHappened = 'left or right arrow key pressed'
|
||||
return
|
||||
}
|
||||
|
||||
if (event.shiftKey === false && event.code === 'ArrowRight') {
|
||||
if (event.shiftKey === false && event.ctrlKey === false && event.code === 'ArrowRight') {
|
||||
thisObject.container.frame.position.x = thisObject.container.frame.position.x - STEP
|
||||
whatHappened = 'left or right arrow key pressed'
|
||||
return
|
||||
}
|
||||
|
||||
if (event.shiftKey === false && event.code === 'ArrowUp') {
|
||||
if (event.shiftKey === false && event.ctrlKey === false && event.code === 'ArrowUp') {
|
||||
thisObject.container.frame.position.y = thisObject.container.frame.position.y + STEP
|
||||
whatHappened = 'up or down arrow key pressed'
|
||||
return
|
||||
}
|
||||
|
||||
if (event.shiftKey === false && event.code === 'ArrowDown') {
|
||||
if (event.shiftKey === false && event.ctrlKey === false && event.code === 'ArrowDown') {
|
||||
thisObject.container.frame.position.y = thisObject.container.frame.position.y - STEP
|
||||
whatHappened = 'up or down arrow key pressed'
|
||||
return
|
||||
|
||||
@@ -140,7 +140,7 @@ function newViewport () {
|
||||
y: -container.frame.position.y - container.frame.height / 2
|
||||
}
|
||||
position.x = targetPoint.x + browserCanvas.width / 2
|
||||
position.y = targetPoint.y + (browserCanvas.height - COCKPIT_SPACE_HEIGHT - TOP_SPACE_HEIGHT) / 2 + TOP_SPACE_HEIGHT
|
||||
position.y = targetPoint.y + (COCKPIT_SPACE_POSITION - TOP_SPACE_HEIGHT) / 2 + TOP_SPACE_HEIGHT
|
||||
}
|
||||
|
||||
function zoomAtCenter (level) {
|
||||
@@ -152,7 +152,7 @@ function newViewport () {
|
||||
function mousePositionPhysics () {
|
||||
if (overrideMousePositionCounter > 0) {
|
||||
thisObject.mousePosition.x = browserCanvas.width / 2
|
||||
thisObject.mousePosition.y = (browserCanvas.height - TOP_SPACE_HEIGHT - COCKPIT_SPACE_HEIGHT) / 2 + TOP_SPACE_HEIGHT
|
||||
thisObject.mousePosition.y = (COCKPIT_SPACE_POSITION - TOP_SPACE_HEIGHT) / 2 + TOP_SPACE_HEIGHT
|
||||
|
||||
overrideMousePositionCounter--
|
||||
if (overrideMousePositionCounter < 0) {
|
||||
@@ -200,12 +200,13 @@ function newViewport () {
|
||||
if (thisObject.visible === false) { return }
|
||||
if ((event.ctrlKey === true || event.metaKey === true)) { return }
|
||||
let morePower = 1
|
||||
let amount = event.delta
|
||||
|
||||
if (IS_MAC) {
|
||||
event.delta = event.delta * MAC_AMOUNT_FACTOR
|
||||
}
|
||||
|
||||
let amount = event.delta
|
||||
|
||||
if (event.buttons === 4) { morePower = 2 } // Mouse wheel pressed.
|
||||
/* We adjust the sensitivity for Mac Users */
|
||||
|
||||
|
||||
@@ -19,26 +19,132 @@ function newUiObjectsFromNodes () {
|
||||
tasksToRun = []
|
||||
sessionsToRun = []
|
||||
|
||||
/* Create the workspace UI OBject and then continue with the root nodes. */
|
||||
createUiObject(false, 'Workspace', node.name, node, undefined, undefined, 'Workspace')
|
||||
if (node.rootNodes !== undefined) {
|
||||
for (let i = 0; i < node.rootNodes.length; i++) {
|
||||
let rootNode = node.rootNodes[i]
|
||||
createUiObjectFromNode(rootNode, undefined, undefined)
|
||||
addIncludedNodes()
|
||||
|
||||
function addIncludedNodes () {
|
||||
blobService = newFileStorage()
|
||||
|
||||
if (node.code === undefined) {
|
||||
node.code = '{ \n"includeDataMines": ["Masters", "Sparta", "TradingEngines"],\n"includeTradingSystems": ["WHB-BTC-USDT", "WHB-ETH-USDT", "BRR-BTC-USDT"],\n"includeSuperScripts": ["Superalgos"]\n }'
|
||||
}
|
||||
|
||||
let code = JSON.parse(node.code)
|
||||
let includeDataMines = code.includeDataMines
|
||||
let includeTradingSystems = code.includeTradingSystems
|
||||
let includeSuperScripts = code.includeSuperScripts
|
||||
|
||||
let totalIncluded = 0
|
||||
|
||||
for (let i = 0; i < includeDataMines.length; i++) {
|
||||
let name = includeDataMines[i]
|
||||
blobService.getBlobToText('DataMines' + '/' + name, undefined, onFileReceived, true)
|
||||
function onFileReceived (err, text, response) {
|
||||
if (err && err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
|
||||
console.log('Cannot load included Data Mine ' + name + '. The workspace can not be loaded.')
|
||||
return
|
||||
}
|
||||
let receivedNode = JSON.parse(text)
|
||||
for (let i = 0; i < node.rootNodes.length; i++) {
|
||||
let rootNode = node.rootNodes[i]
|
||||
if (rootNode.type === 'Data Mine') {
|
||||
if (rootNode.code !== undefined) {
|
||||
let code = JSON.parse(rootNode.code)
|
||||
if (code.name === name) {
|
||||
rootNodes.splice(i, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
receivedNode.isIncluded = true
|
||||
node.rootNodes.push(receivedNode)
|
||||
totalIncluded++
|
||||
if (totalIncluded === includeDataMines.length + includeTradingSystems.length + includeSuperScripts.length) {
|
||||
addUserDefinedNodes()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < includeTradingSystems.length; i++) {
|
||||
let name = includeTradingSystems[i]
|
||||
blobService.getBlobToText('TradingSystems' + '/' + name, undefined, onFileReceived, true)
|
||||
function onFileReceived (err, text, response) {
|
||||
if (err && err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
|
||||
console.log('Cannot load included Data Mine ' + name + '. The workspace can not be loaded.')
|
||||
return
|
||||
}
|
||||
let receivedNode = JSON.parse(text)
|
||||
for (let i = 0; i < node.rootNodes.length; i++) {
|
||||
let rootNode = node.rootNodes[i]
|
||||
if (rootNode.type === 'Trading System') {
|
||||
if (rootNode.code !== undefined) {
|
||||
let code = JSON.parse(rootNode.code)
|
||||
if (code.name === name) {
|
||||
rootNodes.splice(i, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
receivedNode.isIncluded = true
|
||||
node.rootNodes.push(receivedNode)
|
||||
totalIncluded++
|
||||
if (totalIncluded === includeDataMines.length + includeTradingSystems.length + includeSuperScripts.length) {
|
||||
addUserDefinedNodes()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < includeSuperScripts.length; i++) {
|
||||
let name = includeSuperScripts[i]
|
||||
blobService.getBlobToText('SuperScripts' + '/' + name, undefined, onFileReceived, true)
|
||||
function onFileReceived (err, text, response) {
|
||||
if (err && err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
|
||||
console.log('Cannot load included Data Mine ' + name + '. The workspace can not be loaded.')
|
||||
return
|
||||
}
|
||||
let receivedNode = JSON.parse(text)
|
||||
for (let i = 0; i < node.rootNodes.length; i++) {
|
||||
let rootNode = node.rootNodes[i]
|
||||
if (rootNode.type === 'Super Scripts') {
|
||||
if (rootNode.code !== undefined) {
|
||||
let code = JSON.parse(rootNode.code)
|
||||
if (code.name === name) {
|
||||
rootNodes.splice(i, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
receivedNode.isIncluded = true
|
||||
node.rootNodes.push(receivedNode)
|
||||
totalIncluded++
|
||||
if (totalIncluded === includeDataMines.length + includeTradingSystems.length + includeSuperScripts.length) {
|
||||
addUserDefinedNodes()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tryToConnectChildrenWithReferenceParents()
|
||||
function addUserDefinedNodes () {
|
||||
/* Create the workspace UI OBject and then continue with the root nodes. */
|
||||
createUiObject(false, 'Workspace', node.name, node, undefined, undefined, 'Workspace')
|
||||
if (node.rootNodes !== undefined) {
|
||||
for (let i = 0; i < node.rootNodes.length; i++) {
|
||||
let rootNode = node.rootNodes[i]
|
||||
createUiObjectFromNode(rootNode, undefined, undefined)
|
||||
}
|
||||
}
|
||||
|
||||
if (replacingCurrentWorkspace === true) {
|
||||
// We need to wait all tasks that were potentially running to stop
|
||||
setTimeout(runTasks, 70000)
|
||||
// We give a few seconds for the tasks to start
|
||||
setTimeout(runSessions, 80000)
|
||||
} else {
|
||||
runTasks()
|
||||
// We give a few seconds for the tasks to start
|
||||
setTimeout(runSessions, 10000)
|
||||
tryToConnectChildrenWithReferenceParents()
|
||||
|
||||
if (replacingCurrentWorkspace === true) {
|
||||
// We need to wait all tasks that were potentially running to stop
|
||||
setTimeout(runTasks, 70000)
|
||||
// We give a few seconds for the tasks to start
|
||||
setTimeout(runSessions, 80000)
|
||||
} else {
|
||||
runTasks()
|
||||
// We give a few seconds for the tasks to start
|
||||
setTimeout(runSessions, 10000)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,6 @@ function newWorkspace () {
|
||||
let droppedNode
|
||||
let sessionTimestamp = (new Date()).valueOf()
|
||||
window.localStorage.setItem('Session Timestamp', sessionTimestamp)
|
||||
console.log(sessionTimestamp)
|
||||
|
||||
return thisObject
|
||||
|
||||
@@ -173,8 +172,9 @@ function newWorkspace () {
|
||||
let stringifyReadyNodes = []
|
||||
for (let i = 0; i < thisObject.workspaceNode.rootNodes.length; i++) {
|
||||
let rootNode = thisObject.workspaceNode.rootNodes[i]
|
||||
let node = functionLibraryProtocolNode.getProtocolNode(rootNode, removePersonalData, false, true, true, true)
|
||||
if (node) {
|
||||
|
||||
if (rootNode.isIncluded !== true) {
|
||||
let node = functionLibraryProtocolNode.getProtocolNode(rootNode, removePersonalData, false, true, true, true)
|
||||
stringifyReadyNodes.push(node)
|
||||
}
|
||||
}
|
||||
@@ -194,15 +194,15 @@ function newWorkspace () {
|
||||
if (rootNode.networkNodes !== undefined) {
|
||||
for (let j = 0; j < rootNode.networkNodes.length; j++) {
|
||||
let networkNode = rootNode.networkNodes[j]
|
||||
if (networkNode.dataMining !== undefined) {
|
||||
if (networkNode.dataMining !== undefined && networkNode.dataMining.payload !== undefined) {
|
||||
networkNode.dataMining.payload.uiObject.menu.internalClick('Stop All Exchange Tasks')
|
||||
networkNode.dataMining.payload.uiObject.menu.internalClick('Stop All Exchange Tasks')
|
||||
}
|
||||
if (networkNode.testingEnvironment !== undefined) {
|
||||
if (networkNode.testingEnvironment !== undefined && networkNode.testingEnvironment.payload !== undefined) {
|
||||
networkNode.testingEnvironment.payload.uiObject.menu.internalClick('Stop All Exchange Tasks')
|
||||
networkNode.testingEnvironment.payload.uiObject.menu.internalClick('Stop All Exchange Tasks')
|
||||
}
|
||||
if (networkNode.productionEnvironment !== undefined) {
|
||||
if (networkNode.productionEnvironment !== undefined && networkNode.productionEnvironment.payload !== undefined) {
|
||||
networkNode.productionEnvironment.payload.uiObject.menu.internalClick('Stop All Exchange Tasks')
|
||||
networkNode.productionEnvironment.payload.uiObject.menu.internalClick('Stop All Exchange Tasks')
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ function newCircularMenu () {
|
||||
isDeployed: undefined,
|
||||
internalClick: internalClick,
|
||||
physics: physics,
|
||||
invisiblePhysics: invisiblePhysics,
|
||||
drawBackground: drawBackground,
|
||||
drawForeground: drawForeground,
|
||||
getContainer: getContainer,
|
||||
@@ -171,6 +172,13 @@ function newCircularMenu () {
|
||||
}
|
||||
}
|
||||
|
||||
function invisiblePhysics () {
|
||||
for (let i = 0; i < menuItems.length; i++) {
|
||||
let menuItem = menuItems[i]
|
||||
menuItem.invisiblePhysics()
|
||||
}
|
||||
}
|
||||
|
||||
function physics () {
|
||||
for (let i = 0; i < menuItems.length; i++) {
|
||||
let menuItem = menuItems[i]
|
||||
@@ -190,7 +198,7 @@ function newCircularMenu () {
|
||||
function onNotFocus () {
|
||||
for (let i = 0; i < menuItems.length; i++) {
|
||||
let menuItem = menuItems[i]
|
||||
menuItem.targetRadius = menuItem.rawRadius * 0 - i * 4
|
||||
menuItem.targetRadius = menuItem.rawRadius * 0 - i * 1.5
|
||||
menuItem.isDeployed = false
|
||||
}
|
||||
thisObject.isDeployed = false
|
||||
|
||||
@@ -39,8 +39,10 @@ function newCircularMenuItem () {
|
||||
relatedUiObject: undefined,
|
||||
dontShowAtFullscreen: undefined,
|
||||
isEnabled: true,
|
||||
shorcutNumber: undefined,
|
||||
internalClick: internalClick,
|
||||
physics: physics,
|
||||
invisiblePhysics: invisiblePhysics,
|
||||
drawBackground: drawBackground,
|
||||
drawForeground: drawForeground,
|
||||
getContainer: getContainer,
|
||||
@@ -133,10 +135,29 @@ function newCircularMenuItem () {
|
||||
}
|
||||
}
|
||||
|
||||
function invisiblePhysics () {
|
||||
temporaryStatusPhysics()
|
||||
}
|
||||
|
||||
function temporaryStatusPhysics () {
|
||||
/* Temporary Status impacts on the label to use and the background of that label */
|
||||
if (temporaryStatusCounter > 0) {
|
||||
temporaryStatusCounter--
|
||||
}
|
||||
|
||||
if (temporaryStatusCounter === 0) {
|
||||
temporaryStatus = STATUS_NO_ACTION_TAKEN_YET
|
||||
labelToPrint = thisObject.label
|
||||
backgroundColorToUse = defaultBackgroudColor
|
||||
thisObject.nextAction = thisObject.action
|
||||
}
|
||||
}
|
||||
|
||||
function physics () {
|
||||
if (thisObject.dontShowAtFullscreen === true && AT_FULL_SCREEN_MODE === true) { return }
|
||||
|
||||
const INCREASE_STEP = 2
|
||||
let INCREASE_STEP = 2 // (thisObject.targetRadius - thisObject.rawRadius) / 4
|
||||
// if (INCREASE_STEP === 0) { INCREASE_STEP = 2 }
|
||||
|
||||
if (Math.abs(thisObject.currentRadius - thisObject.targetRadius) >= INCREASE_STEP) {
|
||||
if (thisObject.currentRadius < thisObject.targetRadius) {
|
||||
@@ -150,19 +171,19 @@ function newCircularMenuItem () {
|
||||
if (thisObject.type === 'Icon Only') {
|
||||
switch (thisObject.ring) {
|
||||
case 1: {
|
||||
radiusGrowthFactor = 6.5
|
||||
radiusGrowthFactor = 5.5
|
||||
break
|
||||
}
|
||||
case 2: {
|
||||
radiusGrowthFactor = 5.0
|
||||
radiusGrowthFactor = 4.0
|
||||
break
|
||||
}
|
||||
case 3: {
|
||||
radiusGrowthFactor = 3.5
|
||||
radiusGrowthFactor = 3.0
|
||||
break
|
||||
}
|
||||
case 4: {
|
||||
radiusGrowthFactor = 2.5
|
||||
radiusGrowthFactor = 2.0
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -170,20 +191,10 @@ function newCircularMenuItem () {
|
||||
radiusGrowthFactor = 4
|
||||
}
|
||||
|
||||
thisObject.container.frame.position.x = thisObject.container.frame.radius * radiusGrowthFactor / 7 * Math.cos(toRadians(thisObject.angle)) - thisObject.currentRadius * 1.5
|
||||
thisObject.container.frame.position.y = thisObject.container.frame.radius * radiusGrowthFactor / 7 * Math.sin(toRadians(thisObject.angle)) - thisObject.container.frame.height / 2
|
||||
thisObject.container.frame.position.x = thisObject.payload.floatingObject.targetRadius * radiusGrowthFactor / 7 * Math.cos(toRadians(thisObject.angle)) - thisObject.currentRadius * 1.5
|
||||
thisObject.container.frame.position.y = thisObject.payload.floatingObject.targetRadius * radiusGrowthFactor / 7 * Math.sin(toRadians(thisObject.angle)) - thisObject.container.frame.height / 2
|
||||
|
||||
/* Temporary Status impacts on the label to use and the background of that label */
|
||||
if (temporaryStatusCounter > 0) {
|
||||
temporaryStatusCounter--
|
||||
}
|
||||
|
||||
if (temporaryStatusCounter === 0) {
|
||||
temporaryStatus = STATUS_NO_ACTION_TAKEN_YET
|
||||
labelToPrint = thisObject.label
|
||||
backgroundColorToUse = defaultBackgroudColor
|
||||
thisObject.nextAction = thisObject.action
|
||||
}
|
||||
temporaryStatusPhysics()
|
||||
|
||||
/* Here we will check if we need to monitor a property that influences the status of the Menu Item. */
|
||||
if (thisObject.disableIfPropertyIsDefined === true) {
|
||||
@@ -245,13 +256,20 @@ function newCircularMenuItem () {
|
||||
} else {
|
||||
isMouseOver = false
|
||||
}
|
||||
MENU_ITEM_ON_FOCUS = thisObject
|
||||
}
|
||||
|
||||
function onMouseNotOver (point) {
|
||||
isMouseOver = false
|
||||
MENU_ITEM_ON_FOCUS = undefined
|
||||
}
|
||||
|
||||
function internalClick () {
|
||||
if (thisObject.shorcutNumber !== undefined) {
|
||||
let label = thisObject.payload.node.name + ' ' + labelToPrint
|
||||
canvas.cockpitSpace.setStatus(label, 50, canvas.cockpitSpace.statusTypes.ALL_GOOD)
|
||||
}
|
||||
|
||||
onMouseClick()
|
||||
}
|
||||
|
||||
@@ -425,6 +443,11 @@ function newCircularMenuItem () {
|
||||
/* Menu Label */
|
||||
|
||||
if (thisObject.type === 'Icon & Text') {
|
||||
label = labelToPrint
|
||||
if (thisObject.shorcutNumber !== undefined) {
|
||||
label = '' + thisObject.shorcutNumber + '- ' + labelToPrint
|
||||
}
|
||||
|
||||
let labelPoint
|
||||
let fontSize = 15
|
||||
|
||||
@@ -438,7 +461,7 @@ function newCircularMenuItem () {
|
||||
|
||||
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
|
||||
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
|
||||
browserCanvasContext.fillText(labelToPrint, labelPoint.x, labelPoint.y)
|
||||
browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ function newCodeEditor () {
|
||||
thisObject.container.frame.position.y = 0
|
||||
|
||||
let isMouseOver = false
|
||||
let SIZE_FACTOR = 1.4
|
||||
|
||||
return thisObject
|
||||
|
||||
@@ -129,8 +130,8 @@ function newCodeEditor () {
|
||||
thisObject.container.frame.position.x = 0
|
||||
thisObject.container.frame.position.y = 0
|
||||
|
||||
thisObject.container.frame.width = thisObject.container.frame.radius * 1.8 * 1.5
|
||||
thisObject.container.frame.height = thisObject.container.frame.radius * 1 * 1.4
|
||||
thisObject.container.frame.width = thisObject.container.frame.radius * 1.8 * SIZE_FACTOR
|
||||
thisObject.container.frame.height = thisObject.container.frame.radius * 1 * SIZE_FACTOR
|
||||
|
||||
let textAreaPosition = {
|
||||
x: 0 - thisObject.container.frame.width / 2,
|
||||
@@ -162,7 +163,7 @@ function newCodeEditor () {
|
||||
|
||||
position = thisObject.container.frame.frameThisPoint(position)
|
||||
|
||||
let radius = thisObject.container.frame.radius * 1.5
|
||||
let radius = thisObject.container.frame.radius * SIZE_FACTOR
|
||||
|
||||
if (radius > 0.5) {
|
||||
browserCanvasContext.beginPath()
|
||||
|
||||
@@ -108,6 +108,7 @@ function newFloatingObject () {
|
||||
}
|
||||
|
||||
function getContainer (point) {
|
||||
if (thisObject.payload === undefined) { return }
|
||||
if ((thisObject.isCollapsed === true && thisObject.collapsedManually === false) || thisObject.isParentCollapsed === true) { return }
|
||||
if (canvas.floatingSpace.inMapMode === true) { return }
|
||||
let container
|
||||
@@ -345,41 +346,45 @@ function newFloatingObject () {
|
||||
|
||||
function thisObjectPhysics () {
|
||||
// The radius also have a target.
|
||||
let ANIMATION_STEP = Math.abs(thisObject.targetRadius - thisObject.rawRadius) / 5
|
||||
|
||||
if (Math.abs(thisObject.container.frame.radius - thisObject.targetRadius) >= 10) {
|
||||
if (ANIMATION_STEP === 0) { ANIMATION_STEP = 10 }
|
||||
|
||||
if (Math.abs(thisObject.container.frame.radius - thisObject.targetRadius) >= ANIMATION_STEP) {
|
||||
if (thisObject.container.frame.radius < thisObject.targetRadius) {
|
||||
thisObject.container.frame.radius = thisObject.container.frame.radius + 10
|
||||
thisObject.container.frame.radius = thisObject.container.frame.radius + ANIMATION_STEP
|
||||
} else {
|
||||
thisObject.container.frame.radius = thisObject.container.frame.radius - 10
|
||||
thisObject.container.frame.radius = thisObject.container.frame.radius - ANIMATION_STEP
|
||||
}
|
||||
|
||||
thisObject.container.eventHandler.raiseEvent('Dimmensions Changed', event)
|
||||
}
|
||||
|
||||
// The imageSize also have a target.
|
||||
|
||||
if (Math.abs(thisObject.currentImageSize - thisObject.targetImageSize) >= 10) {
|
||||
if (Math.abs(thisObject.currentImageSize - thisObject.targetImageSize) >= ANIMATION_STEP) {
|
||||
if (thisObject.currentImageSize < thisObject.targetImageSize) {
|
||||
thisObject.currentImageSize = thisObject.currentImageSize + 10
|
||||
thisObject.currentImageSize = thisObject.currentImageSize + ANIMATION_STEP
|
||||
} else {
|
||||
thisObject.currentImageSize = thisObject.currentImageSize - 10
|
||||
thisObject.currentImageSize = thisObject.currentImageSize - ANIMATION_STEP
|
||||
}
|
||||
}
|
||||
|
||||
// The fontSize also have a target.
|
||||
|
||||
if (Math.abs(thisObject.currentFontSize - thisObject.targetFontSize) >= 1) {
|
||||
if (Math.abs(thisObject.currentFontSize - thisObject.targetFontSize) >= ANIMATION_STEP / 10) {
|
||||
if (thisObject.currentFontSize < thisObject.targetFontSize) {
|
||||
thisObject.currentFontSize = thisObject.currentFontSize + 1
|
||||
thisObject.currentFontSize = thisObject.currentFontSize + ANIMATION_STEP / 10
|
||||
} else {
|
||||
thisObject.currentFontSize = thisObject.currentFontSize - 1
|
||||
thisObject.currentFontSize = thisObject.currentFontSize - ANIMATION_STEP / 10
|
||||
}
|
||||
}
|
||||
|
||||
if (Math.abs(thisObject.currentHierarchyRing - thisObject.targetHierarchyRing) >= 10) {
|
||||
if (Math.abs(thisObject.currentHierarchyRing - thisObject.targetHierarchyRing) >= ANIMATION_STEP) {
|
||||
if (thisObject.currentHierarchyRing < thisObject.targetHierarchyRing) {
|
||||
thisObject.currentHierarchyRing = thisObject.currentHierarchyRing + 10
|
||||
thisObject.currentHierarchyRing = thisObject.currentHierarchyRing + ANIMATION_STEP
|
||||
} else {
|
||||
thisObject.currentHierarchyRing = thisObject.currentHierarchyRing - 10
|
||||
thisObject.currentHierarchyRing = thisObject.currentHierarchyRing - ANIMATION_STEP
|
||||
}
|
||||
}
|
||||
|
||||
@@ -400,7 +405,7 @@ function newFloatingObject () {
|
||||
|
||||
thisObject.positionLocked = true
|
||||
|
||||
canvas.floatingSpace.container.eventHandler.raiseEvent('onFocusAquired', thisObject.container)
|
||||
canvas.floatingSpace.container.eventHandler.raiseEvent('onFocusAquired', thisObject)
|
||||
thisObject.isOnFocus = true
|
||||
}
|
||||
}
|
||||
@@ -409,14 +414,14 @@ function newFloatingObject () {
|
||||
removeFocus()
|
||||
}
|
||||
|
||||
function someoneAquiredFocus (container) {
|
||||
if (container === undefined) {
|
||||
function someoneAquiredFocus (floatingObject) {
|
||||
if (floatingObject === undefined || floatingObject.container === undefined) {
|
||||
return
|
||||
}
|
||||
if (thisObject.container === undefined) {
|
||||
return
|
||||
}
|
||||
if (container.id !== thisObject.container.id) {
|
||||
if (floatingObject.container.id !== thisObject.container.id) {
|
||||
removeFocus()
|
||||
}
|
||||
}
|
||||
@@ -429,7 +434,7 @@ function newFloatingObject () {
|
||||
thisObject.targetFontSize = thisObject.rawFontSize * 1
|
||||
thisObject.targetHierarchyRing = thisObject.rawHierarchyRing * 1
|
||||
|
||||
thisObject.payload.uiObject.container.eventHandler.raiseEvent('onNotFocus')
|
||||
thisObject.payload.uiObject.container.eventHandler.raiseEvent('onNotFocus', thisObject.container)
|
||||
|
||||
if (thisObject.isPinned !== true) {
|
||||
thisObject.positionLocked = false
|
||||
|
||||
@@ -34,6 +34,7 @@ function newFormulaEditor () {
|
||||
thisObject.container.frame.position.y = 0
|
||||
|
||||
let isMouseOver = false
|
||||
let SIZE_FACTOR = 1.2
|
||||
|
||||
return thisObject
|
||||
|
||||
@@ -129,8 +130,8 @@ function newFormulaEditor () {
|
||||
thisObject.container.frame.position.x = 0
|
||||
thisObject.container.frame.position.y = 0
|
||||
|
||||
thisObject.container.frame.width = thisObject.container.frame.radius * 1.8 * 2
|
||||
thisObject.container.frame.height = thisObject.container.frame.radius * 1 * 2
|
||||
thisObject.container.frame.width = thisObject.container.frame.radius * 1.8 * SIZE_FACTOR
|
||||
thisObject.container.frame.height = thisObject.container.frame.radius * 1 * SIZE_FACTOR
|
||||
|
||||
let textAreaPosition = {
|
||||
x: 0 - thisObject.container.frame.width / 2,
|
||||
@@ -162,7 +163,7 @@ function newFormulaEditor () {
|
||||
|
||||
position = thisObject.container.frame.frameThisPoint(position)
|
||||
|
||||
let radius = thisObject.container.frame.radius * 2
|
||||
let radius = thisObject.container.frame.radius * SIZE_FACTOR
|
||||
|
||||
if (radius > 0.5) {
|
||||
browserCanvasContext.beginPath()
|
||||
|
||||
@@ -263,6 +263,7 @@ function newUiObject () {
|
||||
}
|
||||
|
||||
function invisiblePhysics () {
|
||||
thisObject.menu.invisiblePhysics()
|
||||
childrenRunningPhysics()
|
||||
}
|
||||
|
||||
@@ -1536,7 +1537,11 @@ function newUiObject () {
|
||||
browserCanvasContext.closePath()
|
||||
browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.LIGHT_GREY + ', ' + OPACITY + ')'
|
||||
browserCanvasContext.lineWidth = 1
|
||||
browserCanvasContext.setLineDash([20, 20])
|
||||
if (thisObject.payload.node.isIncluded === true) {
|
||||
browserCanvasContext.setLineDash([0, 0])
|
||||
} else {
|
||||
browserCanvasContext.setLineDash([20, 20])
|
||||
}
|
||||
browserCanvasContext.stroke()
|
||||
}
|
||||
}
|
||||
@@ -1723,4 +1728,3 @@ function newUiObject () {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ const ZOOM_OUT_THRESHOLD_FOR_DISPLAYING_TIME_MACHINES_ICONIZED = 5
|
||||
const ZOOM_OUT_THRESHOLD_FOR_DISPLAYING_SCALES = 3
|
||||
|
||||
let FONT_ASPECT_RATIO = 0.32;
|
||||
|
||||
let ANIMATION_FRAME_PER_SECONDS
|
||||
|
||||
const GET_CONTAINER_PURPOSE = {
|
||||
MOUSE_OVER: 1,
|
||||
@@ -121,6 +121,7 @@ let dailyFilePeriods =
|
||||
dailyFilePeriods = JSON.parse(dailyFilePeriods);
|
||||
|
||||
let SHOW_ANIMATION_PERFORMACE = false;
|
||||
let MENU_ITEM_ON_FOCUS
|
||||
|
||||
let testUser = window.localStorage.getItem("test_user")
|
||||
let LOGGED_IN_USER_LOCAL_STORAGE_KEY
|
||||
|
||||
@@ -227,7 +227,7 @@ function newLayersPanel () {
|
||||
}
|
||||
|
||||
function panelSizePhysics () {
|
||||
if (isInitialized === false || thisObject.visible === false || thisObject.isHidden === true) { return }
|
||||
if (isInitialized === false || thisObject.isHidden === true) { return }
|
||||
|
||||
let viewPortHeight = canvas.chartingSpace.viewport.visibleArea.bottomLeft.y - canvas.chartingSpace.viewport.visibleArea.topLeft.y
|
||||
|
||||
@@ -237,6 +237,8 @@ function newLayersPanel () {
|
||||
thisObject.visible = true
|
||||
}
|
||||
|
||||
if (thisObject.visible === false) { return }
|
||||
|
||||
if (desiredPanelHeight > viewPortHeight) {
|
||||
posibleVisibleLayers = Math.trunc((viewPortHeight - headerHeight - footerHeight) / (layerHeight + LAYER_SEPARATION))
|
||||
} else {
|
||||
|
||||
@@ -96,7 +96,8 @@ function newPlotterPanel () {
|
||||
|
||||
const X_AXIS = thisObject.container.frame.width / 2
|
||||
const Y_AXIS = frameTitleHeight + frameBodyHeight / 2
|
||||
const PANEL_HEIGHT = frameTitleHeight + frameBodyHeight
|
||||
|
||||
const PANEL_HEIGHT = UI_PANEL.HEIGHT.NORMAL
|
||||
|
||||
if (currentRecord === undefined) { return }
|
||||
if (currentRecord.data === undefined) { return }
|
||||
@@ -113,7 +114,7 @@ function newPlotterPanel () {
|
||||
}
|
||||
}
|
||||
|
||||
printLabel('Indicator Properties', X_AXIS, PANEL_HEIGHT * 17 / 100 / 1.25, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction)
|
||||
printLabel('Indicator Properties', X_AXIS, UI_PANEL.HEIGHT.NORMAL * 17 / 100, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction)
|
||||
|
||||
/* Second we go through the panel data. */
|
||||
if (panelNode.panelData === undefined) { return }
|
||||
@@ -126,8 +127,19 @@ function newPlotterPanel () {
|
||||
let value = 'No value defined.'
|
||||
|
||||
if (valuePosition > 100) {
|
||||
heightFactor = 1.25
|
||||
thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL * heightFactor
|
||||
thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL * 1.25
|
||||
}
|
||||
|
||||
if (valuePosition > 125) {
|
||||
thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL * 1.50
|
||||
}
|
||||
|
||||
if (valuePosition > 150) {
|
||||
thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL * 1.75
|
||||
}
|
||||
|
||||
if (valuePosition > 175) {
|
||||
thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL * 2.00
|
||||
}
|
||||
|
||||
if (panelData.dataFormula !== undefined) {
|
||||
@@ -140,7 +152,11 @@ function newPlotterPanel () {
|
||||
}
|
||||
|
||||
if (panelData.code.valueDecimals !== undefined) {
|
||||
value = value.toFixed(panelData.code.valueDecimals)
|
||||
if (value !== undefined) {
|
||||
if (isNaN(value) === false) {
|
||||
value = value.toFixed(panelData.code.valueDecimals)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (panelData.code.labelText !== undefined) {
|
||||
@@ -155,8 +171,8 @@ function newPlotterPanel () {
|
||||
valuePosition = panelData.code.valuePosition
|
||||
}
|
||||
|
||||
printLabel(labelText, X_AXIS, PANEL_HEIGHT * labelPosition / 100 / heightFactor, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction)
|
||||
printLabel(value, X_AXIS, PANEL_HEIGHT * valuePosition / 100 / heightFactor, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction)
|
||||
printLabel(labelText, X_AXIS, UI_PANEL.HEIGHT.NORMAL * labelPosition / 100 / heightFactor, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction)
|
||||
printLabel(value, X_AXIS, UI_PANEL.HEIGHT.NORMAL * valuePosition / 100 / heightFactor, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,11 +41,15 @@ function newChartingSpace () {
|
||||
const PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT = 25
|
||||
|
||||
initialSetup()
|
||||
|
||||
let isInitialized = false
|
||||
|
||||
return thisObject
|
||||
|
||||
function reset () {
|
||||
finalize()
|
||||
initialSetup()
|
||||
isInitialized = false
|
||||
initialize()
|
||||
}
|
||||
|
||||
@@ -87,6 +91,8 @@ function newChartingSpace () {
|
||||
}
|
||||
|
||||
function initialize () {
|
||||
if (isInitialized === true) { return }
|
||||
|
||||
let rootNodes = canvas.designSpace.workspace.workspaceNode.rootNodes
|
||||
for (let i = 0; i < rootNodes.length; i++) {
|
||||
let rootNode = rootNodes[i]
|
||||
@@ -96,7 +102,7 @@ function newChartingSpace () {
|
||||
}
|
||||
|
||||
if (thisObject.payload === undefined) {
|
||||
if (ERROR_LOG === true) { logger.write('[WARN] initialize -> There must exist a Charting Space at the Design Space in order to enable Charts. PLease create one and refreash your browser. ') }
|
||||
// if (ERROR_LOG === true) { logger.write('[WARN] initialize -> There must exist a Charting Space at the Design Space in order to enable Charts. PLease create one and refreash your browser. ') }
|
||||
return
|
||||
}
|
||||
|
||||
@@ -111,6 +117,8 @@ function newChartingSpace () {
|
||||
thisObject.viewport.initialize()
|
||||
|
||||
canvasBrowserResizedEventSubscriptionId = canvas.eventHandler.listenToEvent('Browser Resized', resize)
|
||||
|
||||
isInitialized = true
|
||||
}
|
||||
|
||||
function getContainer (point, purpose) {
|
||||
@@ -263,6 +271,7 @@ function newChartingSpace () {
|
||||
}
|
||||
|
||||
function physics () {
|
||||
initialize()
|
||||
thisObjectPhysics()
|
||||
if (thisObject.visible !== true) { return }
|
||||
if (thisObject.viewport !== undefined) {
|
||||
|
||||
@@ -57,14 +57,17 @@ function newFloatingSpace () {
|
||||
thisObject.container.frame.position.y = browserCanvas.height / 2 - thisObject.container.frame.height / 2
|
||||
|
||||
let visible = false
|
||||
let floatingObjetOnFocus
|
||||
|
||||
const PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT = 25
|
||||
let onDragStartedEventSubscriptionId
|
||||
let spaceFocusAquiredEventSubscriptionId
|
||||
|
||||
return thisObject
|
||||
|
||||
function finalize () {
|
||||
thisObject.container.eventHandler.stopListening(onDragStartedEventSubscriptionId)
|
||||
canvas.floatingSpace.container.eventHandler.stopListening(spaceFocusAquiredEventSubscriptionId)
|
||||
|
||||
thisObject.floatingLayer.finalize()
|
||||
thisObject.uiObjectConstructor.finalize()
|
||||
@@ -73,6 +76,8 @@ function newFloatingSpace () {
|
||||
thisObject.floatingLayer = undefined
|
||||
thisObject.uiObjectConstructor = undefined
|
||||
thisObject.container = undefined
|
||||
|
||||
floatingObjetOnFocus = undefined
|
||||
}
|
||||
|
||||
function initialize (callBackFunction) {
|
||||
@@ -83,6 +88,14 @@ function newFloatingSpace () {
|
||||
thisObject.uiObjectConstructor.initialize(thisObject.floatingLayer)
|
||||
|
||||
onDragStartedEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onDragStarted', onDragStarted)
|
||||
spaceFocusAquiredEventSubscriptionId = canvas.floatingSpace.container.eventHandler.listenToEvent('onFocusAquired', someoneAquiredFocus)
|
||||
}
|
||||
|
||||
function someoneAquiredFocus (floatingObject) {
|
||||
if (floatingObject === undefined || floatingObject.container === undefined) {
|
||||
return
|
||||
}
|
||||
floatingObjetOnFocus = floatingObject
|
||||
}
|
||||
|
||||
function toggleDrawReferenceLines () {
|
||||
@@ -347,8 +360,17 @@ function newFloatingSpace () {
|
||||
|
||||
function getContainer (point) {
|
||||
if (visible === false) { return }
|
||||
|
||||
let container
|
||||
|
||||
if (floatingObjetOnFocus !== undefined) {
|
||||
container = floatingObjetOnFocus.getContainer(point)
|
||||
if (container !== undefined) {
|
||||
container.space = 'Floating Space'
|
||||
return container
|
||||
}
|
||||
}
|
||||
|
||||
container = thisObject.floatingLayer.getContainer(point)
|
||||
if (container !== undefined) {
|
||||
container.space = 'Floating Space'
|
||||
|
||||
@@ -121,7 +121,7 @@ function newSystemEventHandler () {
|
||||
}
|
||||
|
||||
if (thisObject.isConnected() !== true) {
|
||||
canvas.cockpitSpace.setStatus('Lost connection with the local backend. Please check that all localhost servers are running.', 100, canvas.cockpitSpace.statusTypes.WARNING)
|
||||
canvas.cockpitSpace.setStatus('Connection with the local backend lost. Please check that all localhost servers are running.', 100, canvas.cockpitSpace.statusTypes.WARNING)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -245,6 +245,7 @@ function removeTime (datetime) {
|
||||
}
|
||||
|
||||
function printLabel (labelToPrint, x, y, opacity, fontSize, color, center, container, fitFunction, noDecimals) {
|
||||
if (labelToPrint === undefined) { return }
|
||||
let labelPoint
|
||||
if (color === undefined) { color = UI_COLOR.DARK }
|
||||
if (fontSize === undefined) { fontSize = 10 };
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"type":"Data Mine","name":"Masters","code":"{\n\"codeName\": \"Masters\"\n}","sensorBots":[{"type":"Sensor Bot","name":"Exchange Raw Data","code":"{\n\"codeName\": \"Exchange-Raw-Data\",\n\"repo\": \"Exchange-Raw-Data-Sensor-Bot\"\n}","processes":[{"type":"Process Definition","name":"Historic-Trades","code":"{\n \"codeName\": \"Historic-Trades\",\n \"description\": \"Retrieves and saves the historical trades in batches going backwards from the current time until reaching the begining of the market.\",\n \"startMode\": {\n \"noTime\": {\n \"run\": \"true\"\n },\n \"fixedInterval\": {\n \"run\": \"false\",\n \"interval\": 0\n }\n },\n \"deadWaitTime\": 0,\n \"normalWaitTime\": 60000,\n \"retryWaitTime\": 10000\n}","processOutput":{"type":"Process Output","name":"New Process Output","outputDatasets":[],"id":"e3008f15-43ae-4452-9c28-bfbb6c1a5e84","savedPayload":{"position":{"x":13889.892304785908,"y":17976.7326423862},"targetPosition":{"x":13788.99537092664,"y":18353.285125876908},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":4,"distanceToParent":3},"uiObject":{"isRunning":false}}},"processDependencies":{"type":"Process Dependencies","name":"New Process Dependencies","statusDependencies":[{"type":"Status Dependency","name":"Self Reference","code":"{\n \"mainUtility\": \"Self Reference\"\n}","id":"f796022a-7871-4bde-bcc7-bcf2818f1eaf","savedPayload":{"position":{"x":14299.325525762739,"y":17993.12379366583},"targetPosition":{"x":13938.17907937083,"y":17993.12379366583},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Status Report","name":"New Status Report","id":"116834de-6646-4387-9f4b-4f711cea9235"}}}],"dataDependencies":[],"id":"1332b41e-7cd2-4e69-a40a-39ea47df67b5","savedPayload":{"position":{"x":13938.17907937083,"y":17993.12379366583},"targetPosition":{"x":13788.99537092664,"y":18353.285125876908},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":4,"distanceToParent":3},"uiObject":{"isRunning":false}}},"statusReport":{"type":"Status Report","name":"New Status Report","id":"116834de-6646-4387-9f4b-4f711cea9235","savedPayload":{"position":{"x":13983.913279342734,"y":18015.677405195172},"targetPosition":{"x":13788.99537092664,"y":18353.285125876908},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":4,"distanceToParent":3},"uiObject":{}}},"executionStartedEvent":{"type":"Execution Started Event","name":"New Execution Started Event","id":"a9ea7169-fcd8-48c3-b0a9-b4e8941aa170","savedPayload":{"position":{"x":14026.312379860185,"y":18044.00757842793},"targetPosition":{"x":13788.99537092664,"y":18353.285125876908},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":4,"distanceToParent":3},"uiObject":{}}},"executionFinishedEvent":{"type":"Execution Finished Event","name":"New Execution Finished Event","id":"51908884-c7a2-46ca-8a55-209070ae5fa6","savedPayload":{"position":{"x":14064.650920558077,"y":18077.62957624547},"targetPosition":{"x":13788.99537092664,"y":18353.285125876908},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":4,"distanceToParent":3},"uiObject":{}}},"id":"7a6a9399-474f-4a93-bcbd-28a594ef1943","savedPayload":{"position":{"x":13805.692768649584,"y":18323.43910884833},"targetPosition":{"x":13594.077462510544,"y":18690.892846558643},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":2},"uiObject":{"isRunning":false}}},{"type":"Process Definition","name":"Historic-OHLCVs","code":"{\n \"codeName\": \"Historic-OHLCVs\",\n \"description\": \"Retrieves and saves the historical trades in batches going backwards from the current time until reaching the begining of the market.\",\n \"startMode\": {\n \"noTime\": {\n \"run\": \"true\"\n },\n \"fixedInterval\": {\n \"run\": \"false\",\n \"interval\": 0\n }\n },\n \"deadWaitTime\": 0,\n \"normalWaitTime\": 60000,\n \"retryWaitTime\": 10000\n}","processOutput":{"type":"Process Output","name":"New Process Output","outputDatasets":[],"id":"dfe2556e-a765-4e38-9d30-7f91090c0069","savedPayload":{"position":{"x":13961.614739055709,"y":18088.899427882196},"targetPosition":{"x":13961.513941453737,"y":18479.227066995223},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false}}},"processDependencies":{"type":"Process Dependencies","name":"New Process Dependencies","statusDependencies":[{"type":"Status Dependency","name":"Self Reference","code":"{\n \"mainUtility\": \"Self Reference\"\n}","id":"ea39c98b-18e2-44ce-9f7f-86a8a76a688a","savedPayload":{"position":{"x":14352.05Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"type":"Data Mine","name":"Sparta","code":"{\n\"codeName\": \"Sparta\"\n}","sensorBots":[],"indicatorBots":[{"type":"Indicator Bot","name":"SMA","code":"{\n\"codeName\": \"SMA\",\n\"repo\": \"SMA-Indicator-Bot\"\n}","processes":[{"type":"Process Definition","name":"Multi-Period-Market","code":"{\n \"codeName\": \"Multi-Period-Market\",\n \"description\": \"Calculates SMAs for Time Frames of 01-hs and above.\",\n \"startMode\": {\n \"allMonths\": {\n \"run\": \"false\",\n \"minYear\": \"\",\n \"maxYear\": \"\"\n },\n \"oneMonth\": {\n \"run\": \"false\",\n \"year\": \"\",\n \"month\": \"\"\n },\n \"noTime\": {\n \"run\": \"true\"\n },\n \"fixedInterval\": {\n \"run\": \"false\",\n \"interval\": 0\n }\n },\n \"deadWaitTime\": 0,\n \"normalWaitTime\": 0,\n \"retryWaitTime\": 10000,\n \"sleepWaitTime\": 3600000,\n \"comaWaitTime\": 86400000,\n \"framework\": {\n \"name\": \"Multi-Period-Market\",\n \"startDate\": {\n },\n \"endDate\": {\n }\n }\n}","processOutput":{"type":"Process Output","name":"New Process Output","outputDatasets":[{"type":"Output Dataset","name":"Multi-Period-Market Popular SMAs","id":"5302effb-1f09-4a30-9f71-6956b8b9ca88","savedPayload":{"position":{"x":25224.612195682526,"y":17637.258863308474},"targetPosition":{"x":25551.770032741155,"y":17736.30836346064},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"3b21f9d7-2cbc-4c23-80c8-cc5e5b06a22c"}}},{"type":"Output Dataset","name":"Multi-Period-Market Base11 SMAs","id":"8221593c-6298-4b4c-bfc2-cffbc9e5cd0f","savedPayload":{"position":{"x":25262.141129586627,"y":17552.00360556611},"targetPosition":{"x":25551.770032741155,"y":17736.30836346064},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"af9b9cef-2a74-486f-b79e-047d68669a1f"}}},{"type":"Output Dataset","name":"Multi-Period-Market Base7 SMAs","id":"aabd0857-b4fc-404a-8967-967475ed3993","savedPayload":{"position":{"x":25316.405999626135,"y":17484.324590757144},"targetPosition":{"x":25551.770032741155,"y":17736.30836346064},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"78a6ef37-4df8-4ac8-83a0-c9a732467c59"}}},{"type":"Output Dataset","name":"Multi-Period-Market Base6 SMAs","id":"dd00a77a-761e-404b-9e44-627335668112","savedPayload":{"position":{"x":25387.265564907873,"y":17430.333983048524},"targetPosition":{"x":25551.770032741155,"y":17736.30836346064},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"c0862b3d-d35a-4d3e-8d80-258b8a01c37c"}}},{"type":"Output Dataset","name":"Muti-Period-Market Base5 SMAs","id":"b6426833-d2c7-4300-b610-801e12a7edfd","savedPayload":{"position":{"x":25505.340917270547,"y":17395.898346529495},"targetPosition":{"x":25551.770032741155,"y":17736.30836346064},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Muti-Period-Market","id":"a5d28568-fb58-469a-9820-b9f0e8eab705"}}}],"id":"85a56739-9351-444b-95e9-a57470dca38a","savedPayload":{"position":{"x":25551.770032741155,"y":17736.30836346064},"targetPosition":{"x":25835.490765584105,"y":18051.59276535898},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2},"uiObject":{"isRunning":false}}},"processDependencies":{"type":"Process Dependencies","name":"New Process Dependencies","statusDependencies":[{"type":"Status Dependency","name":"SMA Multi-Period-Market","code":"{\"mainUtility\": \"Self Reference\"}","id":"d49d1e94-1960-4121-8e40-be8af52947ee","savedPayload":{"position":{"x":25501.272085602934,"y":17104.301251575565},"targetPosition":{"x":25694.522455665036,"y":17385.299824512178},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2},"uiObject":{},"referenceParent":{"type":"Status Report","name":"New Status Report","id":"81346f2f-13f2-46f4-85f5-a04b4d80f455"}}},{"type":"Status Dependency","name":"Candles Volumes Multi-Period-Market","code":"{\"mainUtility\": \"Market Ending Point\"}","id":"f7cf0949-06fc-4c98-a399-61fac1671c6e","savedPayload":{"position":{"x":25623.856655356725,"y":17051.612041326982},"targetPosition":{"x":25694.522455665036,"y":17385.299824512178},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2},Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"type":"Data Mine","name":"Trading Engines","code":"{ \n\"codeName\": \"TradingEngines\"\n}","sensorBots":[],"tradingBots":[{"type":"Trading Bot","name":"Protocol Engine","code":"{\n\"codeName\": \"Protocol-Engine\",\n\"repo\": \"Protocol-Engine-Trading-Bot\"\n}","processes":[{"type":"Process Definition","name":"Multi-Period","code":"{\n \"codeName\": \"Multi-Period\",\n \"startMode\": {\n \"userDefined\": {\n \"run\": \"true\"\n }\n },\n \"deadWaitTime\": 0,\n \"liveWaitTime\": 60000,\n \"normalWaitTime\": 5000,\n \"retryWaitTime\": 10000,\n \"sleepWaitTime\": 3600000,\n \"comaWaitTime\": 86400000,\n \"framework\": {\n \"name\": \"Multi-Period\",\n \"validPeriods\": [\n \"45-min\",\n \"40-min\",\n \"30-min\",\n \"20-min\",\n \"15-min\",\n \"10-min\",\n \"05-min\",\n \"04-min\",\n \"03-min\",\n \"02-min\",\n \"01-min\"\n ],\n \"startDate\": {},\n \"endDate\": {}\n }\n}","processOutput":{"type":"Process Output","name":"New Process Output","outputDatasets":[{"type":"Output Dataset","name":"New Output Dataset","id":"2448e10f-8851-4f99-bbc3-4114045de8c0","savedPayload":{"position":{"x":12616.197483671245,"y":20140.853579740375},"targetPosition":{"x":11869.94158089557,"y":20140.853579740375},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"d7335089-1f50-4d48-bcbe-115136a88e6a"}}},{"type":"Output Dataset","name":"New Output Dataset","id":"d1b73084-294b-46f5-a2c4-da08b994b770","savedPayload":{"position":{"x":12449.156688273564,"y":20626.87276271356},"targetPosition":{"x":11869.94158089557,"y":20140.853579740375},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"274082a4-1695-4e9b-a0ff-9464fa2d986f"}}},{"type":"Output Dataset","name":"New Output Dataset","id":"156aa7e6-0514-465e-9734-3983a51ab69c","savedPayload":{"position":{"x":11997.878022585815,"y":20866.417195564853},"targetPosition":{"x":11869.94158089557,"y":20140.853579740375},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"52f26c43-552c-4557-af7a-878b951f5731"}}},{"type":"Output Dataset","name":"New Output Dataset","id":"8067fbac-fbc3-4712-9c24-4b4b9a24d78d","savedPayload":{"position":{"x":11497.788898746769,"y":20785.44093339513},"targetPosition":{"x":11869.94158089557,"y":20140.853579740375},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"afb38dc6-0437-4215-8a7d-3091cd3c74fb"}}},{"type":"Output Dataset","name":"New Output Dataset","id":"72529350-c20e-4f28-a308-2611df7a6468","savedPayload":{"position":{"x":11151.505147800972,"y":20402.34305659919},"targetPosition":{"x":11869.94158089557,"y":20140.853579740375},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"cb317eb0-047c-4076-bd46-7add2423aa87"}}},{"type":"Output Dataset","name":"New Output Dataset","id":"1b491b01-465a-4f98-831d-a587fc428b58","savedPayload":{"position":{"x":11191.18832670422,"y":19893.807598803403},"targetPosition":{"x":11869.94158089557,"y":20140.853579740375},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"41498979-9228-4151-8b94-0d8acdf257e8"}}},{"type":"Output Dataset","name":"New Output Dataset","id":"5711ecc2-5192-4d97-a13d-5269264ea825","savedPayload":{"position":{"x":11500.627966186497,"y":19501.183635137346},"targetPosition":{"x":11869.94158089557,"y":20140.853579740375},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"823a30de-093f-4c39-9181-5727c81bbad3"}}},{"type":"Output Dataset","name":"New Output Dataset","id":"3be12bcb-4634-4933-9ae1-bad5089b8062","savedPayload":{"position":{"x":12002.767486869507,"y":19387.560434016126},"targetPosition":{"x":11869.94158089557,"y":20140.853579740375},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-PerLine truncated
|
||||
@@ -29,11 +29,15 @@ function newFileStorage () {
|
||||
|
||||
return thisObject
|
||||
|
||||
async function getBlobToText (filePath, host, callBackFunction) {
|
||||
async function getBlobToText (filePath, host, callBackFunction, pathComplete) {
|
||||
try {
|
||||
if (INFO_LOG === true) { logger.write('[INFO] getBlobToText -> Entering function.') }
|
||||
|
||||
callServer(undefined, 'Storage/' + filePath, (response, fileContent) => {
|
||||
let folder = ''
|
||||
if (pathComplete === false || pathComplete === undefined) {
|
||||
folder = 'Storage/'
|
||||
}
|
||||
callServer(undefined, folder + filePath, (response, fileContent) => {
|
||||
if (response.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
|
||||
callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE, fileContent)
|
||||
} else {
|
||||
|
||||
@@ -331,6 +331,7 @@
|
||||
let currentDate = new Date(farLeftDate.valueOf());
|
||||
|
||||
bands = [];
|
||||
let lastBand
|
||||
|
||||
while (currentDate.valueOf() <= farRightDate.valueOf() + ONE_DAY_IN_MILISECONDS) {
|
||||
|
||||
@@ -356,6 +357,14 @@
|
||||
band.standardDeviation = dailyFile[i][3];
|
||||
band.deviation = dailyFile[i][4];
|
||||
|
||||
if (lastBand !== undefined) {
|
||||
if (lastBand.movingAverage > band.movingAverage) { band.direction = "Down" }
|
||||
if (lastBand.movingAverage < band.movingAverage) { band.direction = "Up" }
|
||||
if (lastBand.movingAverage === band.movingAverage) { band.direction = "Side" }
|
||||
}
|
||||
|
||||
lastBand = band
|
||||
|
||||
if (
|
||||
(band.begin >= farLeftDate.valueOf() && band.end <= farRightDate.valueOf()) &&
|
||||
(band.begin >= coordinateSystem.min.x && band.end <= coordinateSystem.max.x)
|
||||
@@ -386,13 +395,9 @@
|
||||
if (bands[0].begin > lowerEnd || bands[bands.length - 1].end < upperEnd) {
|
||||
|
||||
setTimeout(recalculate, 2000);
|
||||
|
||||
//console.log("File missing while calculating bands, scheduling a recalculation in 2 seconds.");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//console.log("Olivia > recalculateUsingDailyFiles > total bands generated : " + bands.length);
|
||||
|
||||
} catch (err) {
|
||||
|
||||
@@ -417,6 +422,7 @@
|
||||
rightDate = new Date(rightDate.valueOf() + dateDiff * 1.5);
|
||||
|
||||
bands = [];
|
||||
let lastBand
|
||||
|
||||
for (let i = 0; i < marketFile.length; i++) {
|
||||
|
||||
@@ -434,6 +440,14 @@
|
||||
band.standardDeviation = marketFile[i][3];
|
||||
band.deviation = marketFile[i][4];
|
||||
|
||||
if (lastBand !== undefined) {
|
||||
if (lastBand.movingAverage > band.movingAverage) { band.direction = "Down" }
|
||||
if (lastBand.movingAverage < band.movingAverage) { band.direction = "Up" }
|
||||
if (lastBand.movingAverage === band.movingAverage) { band.direction = "Side" }
|
||||
}
|
||||
|
||||
lastBand = band
|
||||
|
||||
if (
|
||||
(band.begin >= leftDate.valueOf() && band.end <= rightDate.valueOf()) &&
|
||||
(band.begin >= coordinateSystem.min.x && band.end <= coordinateSystem.max.x)
|
||||
|
||||
@@ -120,8 +120,8 @@ function newMastersPlottersBollingerBandsBollingerBandsBollingerBandsPanel () {
|
||||
|
||||
/* Extra bounderies due to constrained space */
|
||||
|
||||
const upperLimit = frameTitleHeight + frameBodyHeight * 0.15;
|
||||
const downLimit = frameTitleHeight + frameBodyHeight * 0.85;
|
||||
const upperLimit = frameTitleHeight + frameBodyHeight * 0.25;
|
||||
const downLimit = frameTitleHeight + frameBodyHeight * 0.75;
|
||||
|
||||
if (bandPoint1.y > downLimit) { bandPoint1.y = downLimit; }
|
||||
if (bandPoint4.y > downLimit) { bandPoint4.y = downLimit; }
|
||||
@@ -201,11 +201,20 @@ function newMastersPlottersBollingerBandsBollingerBandsBollingerBandsPanel () {
|
||||
|
||||
let y;
|
||||
|
||||
printLabel('Moving Average', X_AXIS, frameTitleHeight + frameBodyHeight * 0.05, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(currentBand.innerBand.movingAverage, X_AXIS, frameTitleHeight + frameBodyHeight * 0.10, '1.00', 15, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
printLabel('Deviation', X_AXIS, frameTitleHeight + frameBodyHeight * 0.95, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(currentBand.innerBand.deviation, X_AXIS, frameTitleHeight + frameBodyHeight * 0.90, '1.00', 15, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
if (currentBand.innerBand.direction !== undefined) {
|
||||
printLabel('Direction', X_AXIS, frameTitleHeight + frameBodyHeight * 0.05, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(currentBand.innerBand.direction, X_AXIS, frameTitleHeight + frameBodyHeight * 0.10, '1.00', 15, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
}
|
||||
|
||||
printLabel('Moving Average', X_AXIS, frameTitleHeight + frameBodyHeight * 0.15, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(currentBand.innerBand.movingAverage, X_AXIS, frameTitleHeight + frameBodyHeight * 0.20, '1.00', 15, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
printLabel('Deviation', X_AXIS, frameTitleHeight + frameBodyHeight * 0.85, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(currentBand.innerBand.deviation, X_AXIS, frameTitleHeight + frameBodyHeight * 0.80, '1.00', 15, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
printLabel('Standard Deviation', X_AXIS, frameTitleHeight + frameBodyHeight * 0.95, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(currentBand.innerBand.standardDeviation, X_AXIS, frameTitleHeight + frameBodyHeight * 0.90, '1.00', 15, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"type":"Super Scripts","name":"Superalgos","code":"{ \n\"codeName\": \"Superalgos\"\n}","scriptsLibrary":{"type":"Scripts Library","name":"New Scripts Library","masterScripts":[{"type":"Master Script","name":"Setup Market","templateScripts":[{"type":"Template Script","name":"Install Single Market Data","templateStructure":{"type":"Template Structure","name":"New Template Structure","singleMarketData":{"type":"Single Market Data","name":"","dataProducts":[{"type":"Data Product","name":"Candles","id":"24c5f795-acf3-43c3-99ee-ddb521b082f4","savedPayload":{"position":{"x":39921.72808500414,"y":29011.239540561746},"targetPosition":{"x":40538.570141254444,"y":28824.318034921434},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Candles","id":"fe6065ec-4d2d-47a0-bae0-8647f0e195d7"}}},{"type":"Data Product","name":"Volumes","id":"204ec959-0861-486a-aa2a-276dbf48f775","savedPayload":{"position":{"x":39899.18996162789,"y":28906.437038861084},"targetPosition":{"x":40538.570141254444,"y":28824.318034921434},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Volumes","id":"1a366aef-efef-470e-88e0-2a6fbe4dd91f"}}},{"type":"Data Product","name":"Candle-Stairs","id":"90ee9733-ab7e-41a0-ac78-4a7661a27017","savedPayload":{"position":{"x":39894.34302782561,"y":28800.15900804723},"targetPosition":{"x":40538.570141254444,"y":28824.318034921434},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Candle-Stairs","id":"642474e9-da61-4168-97dc-7f7869bebc02"}}},{"type":"Data Product","name":"Volume-Stairs","id":"9ade8e93-9071-422b-8cce-7a50d6dad739","savedPayload":{"position":{"x":39907.122112782716,"y":28694.36575210638},"targetPosition":{"x":40538.570141254444,"y":28824.318034921434},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Volume-Stairs","id":"846e9572-c4d6-4c7e-942e-c82402c5ecea"}}},{"type":"Data Product","name":"Bollinger Bands","id":"b5ef2cf7-3d35-45ec-848c-31970b59c04e","savedPayload":{"position":{"x":39937.14551746402,"y":28592.151020182675},"targetPosition":{"x":40538.570141254444,"y":28824.318034921434},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Bollinger Bands","id":"29088877-8d63-4217-8d34-8742afc262f4"}}},{"type":"Data Product","name":"Percentage Bandwidth","id":"1c3881ca-24b3-4cc9-b16b-9db7aa2b4c24","savedPayload":{"position":{"x":39983.58525246108,"y":28496.28744561276},"targetPosition":{"x":40538.570141254444,"y":28824.318034921434},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Percentage Bandwidth","id":"3b7885a0-cd72-4a3f-a38b-3dc8c47bd068"}}},{"type":"Data Product","name":"Bollinger Channels Objects","id":"92eec33b-86be-4b73-899f-e9550f7b0df3","savedPayload":{"position":{"x":40045.170879966965,"y":28409.383052281606},"targetPosition":{"x":40538.570141254444,"y":28824.318034921434},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Bollinger Channels Objects","id":"1f111f72-624f-4166-9f99-ab8d785d5267"}}},{"type":"Data Product","name":"Bollinger Sub-Channels Objects","id":"4b69df71-9091-4d22-9b0d-571304297033","savedPayload":{"position":{"x":40120.220836442306,"y":28333.805138252766},"targetPosition":{"x":40538.570141254444,"y":28824.318034921434},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Bollinger Sub-Channels Objects","id":"080c87fc-4546-4482-ab11-180a33f6d9ab"}}},{"type":"Data Product","name":"Popular SMAs","id":"8a5f7e27-9ca5-4d6e-b6b9-2d6cbdda8040","savedPayload":{"position":{"x":40206.68717504581,"y":28271.61367628522},"targetPosition":{"x":40538.570141254444,"y":28824.318034921434},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Popular SMAs","id":"4029d5bf-a8ad-4d80-b874-2af506e0ab34"}}},{"type":"Data Product","name":"Base7 SMAs","id":"ccd9c3fd-3382-4fea-8798-a29b04efc09e","savedPaLine truncated
|
||||
@@ -332,9 +332,13 @@
|
||||
if (LOG_FILE_CONTENT === true) { logger.write(MODULE_NAME, "[INFO] start -> processTimeFramesMarketFiles -> periodsLoopBody -> dependencyLoopBody -> getFile -> onFileReceived -> text = " + text); }
|
||||
|
||||
if (err.result !== global.DEFAULT_OK_RESPONSE.result) {
|
||||
|
||||
logger.write(MODULE_NAME, "[ERROR] start -> processTimeFramesMarketFiles -> periodsLoopBody -> dependencyLoopBody -> getFile -> onFileReceived -> err = " + err.message);
|
||||
callBackFunction(err);
|
||||
if (err.message === 'File does not exist.') {
|
||||
logger.write(MODULE_NAME, "[ERROR] The file " + filePath + '/' + fileName + ' does not exist and it is required to continue. This process will retry to read it in a while. In the meantime make yourself sure that the process that generates it has ran properly.');
|
||||
callBackFunction(global.DEFAULT_RETRY_RESPONSE);
|
||||
} else {
|
||||
logger.write(MODULE_NAME, "[ERROR] start -> processTimeFramesMarketFiles -> periodsLoopBody -> dependencyLoopBody -> getFile -> onFileReceived -> err = " + err.message);
|
||||
callBackFunction(err);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -660,7 +664,7 @@
|
||||
|
||||
if ((err.result === "Fail Because" && err.message === "File does not exist.") || err.code === 'The specified key does not exist.') {
|
||||
|
||||
logger.write(MODULE_NAME, "[ERROR] start -> processTimeFramesDailyFiles -> periodsLoopBody -> dependencyLoopBody -> getCurrentFile -> onFileReceived -> err = " + err.stack);
|
||||
logger.write(MODULE_NAME, "[ERROR] The file " + filePath + '/' + fileName + ' does not exist and it is required to continue. This process will retry to read it in a while. In the meantime make yourself sure that the process that generates it has ran properly.');
|
||||
callBackFunction(global.DEFAULT_RETRY_RESPONSE);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -14,21 +14,9 @@
|
||||
|
||||
let utilities = UTILITIES.newCloudUtilities(bot, logger);
|
||||
|
||||
let percentageBandwidthAt = {}
|
||||
let bollingerBandsAt = {}
|
||||
let bollingerChannelsAt = {}
|
||||
let bollingerSubChannelsAt = {}
|
||||
let candlesAt = {}
|
||||
|
||||
|
||||
return thisObject;
|
||||
|
||||
function finalize() {
|
||||
percentageBandwidthAt = undefined
|
||||
bollingerBandsAt = undefined
|
||||
bollingerChannelsAt = undefined
|
||||
bollingerSubChannelsAt = undefined
|
||||
candlesAt = undefined
|
||||
thisObject = undefined
|
||||
}
|
||||
|
||||
@@ -1514,6 +1502,7 @@
|
||||
|
||||
if (parentNode !== undefined) {
|
||||
let phase = parentNode.takeProfit.phases[p];
|
||||
if (phase === undefined) {return} // trying to jump to a phase that does not exists.
|
||||
|
||||
let nextPhaseEvent = phase.nextPhaseEvent;
|
||||
if (nextPhaseEvent !== undefined) {
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"type":"Trading System","name":"Bull Run Rider for BTC/USDT","code":"{ \n\"codeName\": \"BRR-BTC-USDT\"\n}","strategies":[{"type":"Strategy","name":"My Strategy","triggerStage":{"type":"Trigger Stage","triggerOn":{"type":"Trigger On Event","situations":[{"type":"Situation","name":"New Situation","conditions":[{"type":"Condition","name":"New Condition","javascriptCode":{"type":"Javascript Code","code":"chart.at01hs.candle.max > chart.at01hs.bollingerBand.movingAverage + chart.at01hs.bollingerBand.deviation","id":"1e07e38a-c469-4f3f-b7e8-dccd9f94c546","savedPayload":{"position":{"x":39365.82836640363,"y":18024.168218963674},"targetPosition":{"x":39580.43309418583,"y":18013.241510980984},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3},"uiObject":{}}},"id":"a1c434c4-5787-4906-8157-1e355999bba8","savedPayload":{"position":{"x":39580.43309418583,"y":18013.241510980984},"targetPosition":{"x":39795.82183026887,"y":18002.339607729755},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false}}},{"type":"Condition","name":"New Condition","javascriptCode":{"type":"Javascript Code","code":"chart.at01hs.candle.previous.max > chart.at01hs.bollingerBand.previous.movingAverage + chart.at01hs.bollingerBand.previous.deviation\n","id":"3fb95a71-efe8-45cf-be43-8b0d94d2f420","savedPayload":{"position":{"x":39560.74976017509,"y":17641.37546255235},"targetPosition":{"x":39677.97500609048,"y":17821.555824077757},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3},"uiObject":{}}},"id":"f69f2608-49bd-4b04-b8f8-497675f819fe","savedPayload":{"position":{"x":39677.97500609048,"y":17821.555824077757},"targetPosition":{"x":39795.82183026887,"y":18002.339607729755},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false}}}],"id":"1dfb0689-df0c-4184-9c09-683d012c9dfe","savedPayload":{"position":{"x":39795.82183026887,"y":18002.339607729755},"targetPosition":{"x":39987.61800165299,"y":18099.825253218787},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2},"uiObject":{"isRunning":false}}}],"announcements":[],"id":"32d2ee8c-71bd-4e4c-8671-04bbc4a16734","savedPayload":{"position":{"x":39987.61800165299,"y":18099.825253218787},"targetPosition":{"x":40369.80868599963,"y":18293.946872397046},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false}}},"triggerOff":{"type":"Trigger Off Event","situations":[{"type":"Situation","name":"New Situation","conditions":[{"type":"Condition","name":"New Condition","javascriptCode":{"type":"Javascript Code","code":"chart.at01hs.candle.close < chart.at01hs.bollingerBand.movingAverage","id":"a1dd4467-b96b-4084-bd9b-056c6495de95","savedPayload":{"position":{"x":40036.90604970189,"y":17272.087105877887},"targetPosition":{"x":40103.63478212326,"y":17476.753747464914},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3},"uiObject":{}}},"id":"b527026c-4be3-4baf-bbde-83ebfd17e567","savedPayload":{"position":{"x":40103.63478212326,"y":17476.753747464914},"targetPosition":{"x":40170.46021986034,"y":17681.58479868604},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3},"uiObject":{"isRunning":false}}}],"id":"41cbb7ba-020c-4e96-a6a7-c3ef8c25b6fd","savedPayload":{"position":{"x":40170.46021986034,"y":17681.58479868604},"targetPosition":{"x":40237.14613497818,"y":17886.475906641663},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2},"uiObject":{"isRunning":false}}}],"announcements":[],"id":"1af9fdb8-7316-4374-84f2-1b946741b5c6","savedPayload":{"position":{"x":40237.14613497818,"y":17886.475906641663},"targetPosition":{"x":40369.80868599963,"y":18293.946872397046},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3},"uiObject":{"isRunning":false}}},"takePosition":{"type":"Take Position Event","situations":[{"type":"Situation","name":"New Situation","conditions":[{"type":"Condition","name":"New Condition","javascriptCode":{"type":"Javascript Code","code":"chart.at01hs.candle.previous.max > chart.at01hs.bollingerBand.previous.movingAverage + chart.at01hs.bollingerBand.previous.deviation\n","id":"0c15bd8b-b59c-4a2c-b65a-b063aec45216","savedPayload":{"position":{"x":40373.57878568003,"y":17396.87030065395},"targetPosition":{"x":40513.12406224243,"y":17561.3315710958},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3},"uiObject":{}}},"id":"e022ab25-c7d3-439b-bfd7-1217c6abfbfe","savedPayload":{"positionLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"type":"Trading System","name":"Weak-Hands Buster for BTC/USDT","code":"{ \n\"codeName\": \"WHB-BTC-USDT\"\n}","strategies":[{"type":"Strategy","name":"My Strategy","triggerStage":{"type":"Trigger Stage","triggerOn":{"type":"Trigger On Event","situations":[{"type":"Situation","name":"New Situation","conditions":[{"type":"Condition","name":"New Condition","javascriptCode":{"type":"Javascript Code","code":"chart.at01hs.candle.close < chart.at01hs.bollingerBand.movingAverage && chart.at01hs.candle.previous.close < chart.at01hs.bollingerBand.previous.movingAverage && chart.at01hs.candle.previous.previous.close < chart.at01hs.bollingerBand.previous.previous.movingAverage","id":"91f3043a-8e9e-43e0-aca3-d740f527e043","savedPayload":{"position":{"x":39597.92942855126,"y":24554.088670978486},"targetPosition":{"x":39786.58941857112,"y":24516.57192438514},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3},"uiObject":{}}},"id":"d61ab29a-c3c4-4e3b-8825-245a322c431a","savedPayload":{"position":{"x":39786.58941857112,"y":24516.57192438514},"targetPosition":{"x":39969.88930493039,"y":24423.284801888592},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false}}},{"type":"Condition","name":"New Condition","javascriptCode":{"type":"Javascript Code","code":"chart.at01hs.bollingerBand.deviation > 200","id":"03a5e03d-c910-4e6c-b63f-0d018e413b02","savedPayload":{"position":{"x":39563.008506906895,"y":24358.950413184437},"targetPosition":{"x":39766.351470443115,"y":24391.24870019805},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3},"uiObject":{}}},"id":"16fc43c1-d0c3-42e3-9ba8-cba5c21bafd5","savedPayload":{"position":{"x":39766.351470443115,"y":24391.24870019805},"targetPosition":{"x":39969.88930493039,"y":24423.284801888592},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false}}},{"type":"Condition","name":"New Condition","javascriptCode":{"type":"Javascript Code","code":"chart.at01hs.candle.close < chart.at01hs.bollingerBand.movingAverage - chart.at01hs.bollingerBand.deviation","id":"09012cab-d69d-4763-b014-7f984c1784dc","savedPayload":{"position":{"x":39678.73814631131,"y":24132.366155041607},"targetPosition":{"x":39824.08204102481,"y":24277.79016750777},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3},"uiObject":{}}},"id":"89b8b2f6-b215-4e21-a2c8-4aebb11c2e92","savedPayload":{"position":{"x":39824.08204102481,"y":24277.79016750777},"targetPosition":{"x":39969.88930493039,"y":24423.284801888592},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false}}},{"type":"Condition","name":"New Condition","javascriptCode":{"type":"Javascript Code","code":"chart.at02hs.percentageBandwidth.movingAverage >= 30 || chart.at03hs.percentageBandwidth.movingAverage >= 30 || chart.at04hs.percentageBandwidth.movingAverage >= 30 || chart.at06hs.percentageBandwidth.movingAverage >= 30 || chart.at08hs.percentageBandwidth.movingAverage >= 30","id":"5c98aae6-6601-405b-bc15-e8242092ccd1","savedPayload":{"position":{"x":39905.42554533588,"y":24017.0057265508},"targetPosition":{"x":39937.81355501978,"y":24219.74131907366},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3},"uiObject":{}}},"id":"895c4234-e3a8-477d-a5a9-582d81feecc0","savedPayload":{"position":{"x":39937.81355501978,"y":24219.74131907366},"targetPosition":{"x":39969.88930493039,"y":24423.284801888592},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false}}}],"id":"aac48055-7ba2-43af-9b39-7bf71195a3e2","savedPayload":{"position":{"x":39969.88930493039,"y":24423.284801888592},"targetPosition":{"x":40152.595853713865,"y":24516.31337287249},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3},"uiObject":{"isRunning":false}}}],"announcements":[],"id":"42e0cd22-e34e-4d51-9252-10bc615949b5","savedPayload":{"position":{"x":40152.595853713865,"y":24516.31337287249},"targetPosition":{"x":40335.22551029057,"y":24608.664056272926},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2},"uiObject":{"isRunning":false}}},"triggerOff":{"type":"Trigger Off Event","situations":[{"type":"Situation","name":"New Situation","conditions":[{"type":"Condition","name":"New Condition","javascriptCode":{"type":"Javascript Code","code":"chart.at01hs.candle.close > chart.at01hs.bollingerBand.movingAverage","id":"33996f6e-f51b-4667-9f26-36fc8b586eca","savedPayload":{"position":{"x":40055.23249664759,"y":23745.636147864487}Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"type":"Trading System","name":"Weak-Hands Buster for ETH/USDT","code":"{ \n\"codeName\": \"WHB-ETH-USDT\"\n}","strategies":[{"type":"Strategy","name":"My Strategy","triggerStage":{"type":"Trigger Stage","triggerOn":{"type":"Trigger On Event","situations":[{"type":"Situation","name":"Low to High Volatility ","conditions":[{"type":"Condition","name":"New Condition","javascriptCode":{"type":"Javascript Code","name":"New Javascript Code","code":"chart.at01hs.bollingerBand.deviation < 5","id":"5a49ab6a-189f-4c1f-a8b3-2101ae43f72d","savedPayload":{"position":{"x":38973.884405419594,"y":17672.242613905844},"targetPosition":{"x":39489.239691532166,"y":17712.588830313456},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3},"uiObject":{}}},"id":"41587e0d-688c-4997-bc92-83e98155a488","savedPayload":{"position":{"x":39489.239691532166,"y":17712.588830313456},"targetPosition":{"x":40006.94651270844,"y":17736.62534608519},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":4,"distanceToParent":3},"uiObject":{"isRunning":false}}},{"type":"Condition","name":"New Condition","javascriptCode":{"type":"Javascript Code","name":"New Javascript Code","code":"chart.at01hs.bollingerBand.direction === \"Down\"","id":"f9a99136-d66e-41c1-9efc-0584a6561258","savedPayload":{"position":{"x":38990.228565316975,"y":17528.926098377695},"targetPosition":{"x":39495.89786256637,"y":17636.33146888593},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3},"uiObject":{}}},"id":"d6f27cd5-46bc-4792-ade4-266187765dc8","savedPayload":{"position":{"x":39495.89786256637,"y":17636.33146888593},"targetPosition":{"x":40006.94651270844,"y":17736.62534608519},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":4,"distanceToParent":3},"uiObject":{"isRunning":false}}},{"type":"Condition","name":"New Condition","javascriptCode":{"type":"Javascript Code","name":"Channel 12 down","code":"chart.at12hs.bollingerChannel.direction === \"Down\"","id":"e003b583-9aa6-4100-978c-bc4a3133458f","savedPayload":{"position":{"x":39027.19485460709,"y":17393.857682556056},"targetPosition":{"x":39514.50233114945,"y":17566.40866837508},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3},"uiObject":{}}},"id":"ab16d1c7-3fa5-4881-b5f6-f1229473b238","savedPayload":{"position":{"x":39514.50233114945,"y":17566.40866837508},"targetPosition":{"x":40006.94651270844,"y":17736.62534608519},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":4,"distanceToParent":3},"uiObject":{"isRunning":false}}},{"type":"Condition","name":"New Condition","javascriptCode":{"type":"Javascript Code","name":"New Javascript Code","code":"chart.at01hs.popularSMA.sma200 - chart.at01hs.popularSMA.sma100 < 10","id":"4a8339d2-ed94-4525-80bd-127fe56a6f23","savedPayload":{"position":{"x":39080.97537597909,"y":17266.69235764694},"targetPosition":{"x":39541.53188563737,"y":17501.46562616559},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3},"uiObject":{}}},"id":"bced045d-d591-4ac5-86fe-b4af0fc0fb7b","savedPayload":{"position":{"x":39541.53188563737,"y":17501.46562616559},"targetPosition":{"x":40006.94651270844,"y":17736.62534608519},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":4,"distanceToParent":3},"uiObject":{"isRunning":false}}},{"type":"Condition","name":"New Condition","javascriptCode":{"type":"Javascript Code","name":"sma350 and 280 converging","code":"let currentDiff = chart.at01hs.base7SMA.sma350- chart.at01hs.base7SMA.sma280\nlet previousDiff = chart.at01hs.base7SMA.previous.sma350- chart.at01hs.base7SMA.previous.sma280\nif ( currentDiff > 4) { \n if ( previousDiff > currentDiff ) { true} else {false}\n} else {true}\n","id":"e22d3699-1620-42fa-84c8-d330a382d15c","savedPayload":{"position":{"x":39172.321899066046,"y":17124.800536576502},"targetPosition":{"x":39598.24137387814,"y":17417.721925141603},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3},"uiObject":{}}},"id":"f5163621-b29d-4dc5-a9c8-676813e98247","savedPayload":{"position":{"x":39598.24137387814,"y":17417.721925141603},"targetPosition":{"x":40006.94651270844,"y":17736.62534608519},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":4,"distanceToParent":3},"uiObject":{"isRunning":false}}}],"id":"72d8836f-8c14-4877-96ec-d68ef4ab361a","savedPayload":{"position":{"x":40006.858493571315,"y":17736.87071799475},"targetPosition":{"x":40494.52003098766,"y":17909.151610522003},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":4,"distanceToParent":4},"uiObject":{"isRunning":false}}},{"type":"Situation","name":"Extreme Up tp Down","coLine truncated
|
||||
@@ -17,6 +17,9 @@ GATEWAY_ENDPOINT=https://demo-api-dev.superalgos.org/graphql
|
||||
INTER_PROCESS_FILES_PATH=../Inter-Process-Files
|
||||
STORAGE_PATH=../Data-Storage
|
||||
PLOTTERS_PATH=../Legacy-Code
|
||||
DATA_MINES_PATH=../Data-Mines
|
||||
TRADING_SYSTEMS_PATH=../Trading-Systems
|
||||
SUPER_SCRIPTS_PATH=../Super-Scripts
|
||||
PATH_TO_WEB_SERVER =./
|
||||
APP_SCHEMA_PATH=../
|
||||
WORKSPACE_PATH=../
|
||||
|
||||
@@ -44,9 +44,14 @@
|
||||
}
|
||||
|
||||
function onResize() {
|
||||
if (canvas === undefined) { return }
|
||||
if (canvas.eventHandler === undefined) { return }
|
||||
canvas.eventHandler.raiseEvent('Browser Resized')
|
||||
try {
|
||||
if (canvas === undefined) { return }
|
||||
if (canvas.eventHandler === undefined) { return }
|
||||
canvas.eventHandler.raiseEvent('Browser Resized')
|
||||
} catch (err) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
@@ -464,6 +464,24 @@ function onBrowserRequest (request, response) {
|
||||
}
|
||||
break
|
||||
|
||||
case 'DataMines':
|
||||
{
|
||||
respondWithFile(process.env.DATA_MINES_PATH + '/' + requestParameters[2] + '.json', response)
|
||||
}
|
||||
break
|
||||
|
||||
case 'TradingSystems':
|
||||
{
|
||||
respondWithFile(process.env.TRADING_SYSTEMS_PATH + '/' + requestParameters[2] + '.json', response)
|
||||
}
|
||||
break
|
||||
|
||||
case 'SuperScripts':
|
||||
{
|
||||
respondWithFile(process.env.SUPER_SCRIPTS_PATH + '/' + requestParameters[2] + '.json', response)
|
||||
}
|
||||
break
|
||||
|
||||
case 'Storage':
|
||||
{
|
||||
respondWithFile(process.env.STORAGE_PATH + '/' + request.url.substring(9), response)
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"type":"Workspace","name":"My Workspace","rootNodes":[{"type":"Network","name":"Superalgos","networkNodes":[{"type":"Network Node","name":"My Computer","dataStorage":{"type":"Data Storage","name":"New Data Storage","sessionIndependentData":{"type":"Session Independent Data","name":"New Session Independent Data","exchangeDataProducts":[{"type":"Exchange Data Products","name":"Binance","singleMarketData":[{"type":"Single Market Data","name":"Binance BTC/USDT","dataProducts":[{"type":"Data Product","name":"Candles","id":"884a5d08-b607-4b2b-8e7a-8adeb7e8dd4a","savedPayload":{"position":{"x":40547.50864374642,"y":29458.159568577485},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Candles","id":"fe6065ec-4d2d-47a0-bae0-8647f0e195d7"}}},{"type":"Data Product","name":"Volumes","id":"4ec71a01-3d83-4e8e-9780-bcb700dcf66a","savedPayload":{"position":{"x":40421.73265277628,"y":29446.388474093364},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Volumes","id":"1a366aef-efef-470e-88e0-2a6fbe4dd91f"}}},{"type":"Data Product","name":"Candle-Stairs","id":"5979844b-35e7-4c04-938f-18e6156352a0","savedPayload":{"position":{"x":40301.14133183628,"y":29408.85317326678},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Candle-Stairs","id":"642474e9-da61-4168-97dc-7f7869bebc02"}}},{"type":"Data Product","name":"Volume-Stairs","id":"dd1f89bc-3c2f-4fc4-a5f1-de7a34e0997e","savedPayload":{"position":{"x":40187.396275814746,"y":29353.016112581576},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Volume-Stairs","id":"846e9572-c4d6-4c7e-942e-c82402c5ecea"}}},{"type":"Data Product","name":"Bollinger Bands","id":"68df01d8-d9a8-400c-aa76-8da44c5dc040","savedPayload":{"position":{"x":40096.481080845784,"y":29265.09743042856},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Bollinger Bands","id":"29088877-8d63-4217-8d34-8742afc262f4"}}},{"type":"Data Product","name":"Percentage Bandwidth","id":"9b5b1b81-c68c-45a5-8123-1a114a24b744","savedPayload":{"position":{"x":40012.72356856686,"y":29171.40183064097},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Percentage Bandwidth","id":"3b7885a0-cd72-4a3f-a38b-3dc8c47bd068"}}},{"type":"Data Product","name":"Bollinger Channels Objects","id":"632f0f98-eb2c-4820-9943-662a4903be81","savedPayload":{"position":{"x":39948.363007140084,"y":29062.244116046924},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Bollinger Channels Objects","id":"1f111f72-624f-4166-9f99-ab8d785d5267"}}},{"type":"Data Product","name":"Bollinger Sub-Channels Objects","id":"88a1ca81-b317-4ab2-b651-c8fa566e8e28","savedPayload":{"position":{"x":39912.69159220981,"y":28940.34283010204},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Bollinger Sub-Channels Objects","id":"080c87fc-4546-4482-ab11-180a33f6d9ab"}}},{"type":"Data Product","name":"Popular SMAs","id":"5bce195f-7d08-4281-bb9d-ca1e9417068e","savedPayload":{"position":{"x":39896.003039224,"y":28814.06986752792},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Popular SMAs","id":"4029d5bf-a8ad-4d80-b874-2af506e0ab34"}}},{"type":"Data Product","name":"Base7 SMAs","id":"b9145946-1899-4fac-b531-47ed600873be","savedPaylLine truncated
|
||||
{"type":"Workspace","name":"My Workspace","rootNodes":[{"type":"Network","name":"Superalgos","networkNodes":[{"type":"Network Node","name":"My Computer","dataStorage":{"type":"Data Storage","name":"New Data Storage","sessionIndependentData":{"type":"Session Independent Data","name":"New Session Independent Data","exchangeDataProducts":[{"type":"Exchange Data Products","name":"Binance","singleMarketData":[{"type":"Single Market Data","name":"Binance BTC/USDT","dataProducts":[{"type":"Data Product","name":"Candles","id":"884a5d08-b607-4b2b-8e7a-8adeb7e8dd4a","savedPayload":{"position":{"x":40547.50864374642,"y":29458.159568577485},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Candles","id":"fe6065ec-4d2d-47a0-bae0-8647f0e195d7"}}},{"type":"Data Product","name":"Volumes","id":"4ec71a01-3d83-4e8e-9780-bcb700dcf66a","savedPayload":{"position":{"x":40421.73265277628,"y":29446.388474093364},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Volumes","id":"1a366aef-efef-470e-88e0-2a6fbe4dd91f"}}},{"type":"Data Product","name":"Candle-Stairs","id":"5979844b-35e7-4c04-938f-18e6156352a0","savedPayload":{"position":{"x":40301.14133183628,"y":29408.85317326678},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Candle-Stairs","id":"642474e9-da61-4168-97dc-7f7869bebc02"}}},{"type":"Data Product","name":"Volume-Stairs","id":"dd1f89bc-3c2f-4fc4-a5f1-de7a34e0997e","savedPayload":{"position":{"x":40187.396275814746,"y":29353.016112581576},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Volume-Stairs","id":"846e9572-c4d6-4c7e-942e-c82402c5ecea"}}},{"type":"Data Product","name":"Bollinger Bands","id":"68df01d8-d9a8-400c-aa76-8da44c5dc040","savedPayload":{"position":{"x":40096.481080845784,"y":29265.09743042856},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Bollinger Bands","id":"29088877-8d63-4217-8d34-8742afc262f4"}}},{"type":"Data Product","name":"Percentage Bandwidth","id":"9b5b1b81-c68c-45a5-8123-1a114a24b744","savedPayload":{"position":{"x":40012.72356856686,"y":29171.40183064097},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Percentage Bandwidth","id":"3b7885a0-cd72-4a3f-a38b-3dc8c47bd068"}}},{"type":"Data Product","name":"Bollinger Channels Objects","id":"632f0f98-eb2c-4820-9943-662a4903be81","savedPayload":{"position":{"x":39948.363007140084,"y":29062.244116046924},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Bollinger Channels Objects","id":"1f111f72-624f-4166-9f99-ab8d785d5267"}}},{"type":"Data Product","name":"Bollinger Sub-Channels Objects","id":"88a1ca81-b317-4ab2-b651-c8fa566e8e28","savedPayload":{"position":{"x":39912.69159220981,"y":28940.34283010204},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Bollinger Sub-Channels Objects","id":"080c87fc-4546-4482-ab11-180a33f6d9ab"}}},{"type":"Data Product","name":"Popular SMAs","id":"5bce195f-7d08-4281-bb9d-ca1e9417068e","savedPayload":{"position":{"x":39896.003039224,"y":28814.06986752792},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Popular SMAs","id":"4029d5bf-a8ad-4d80-b874-2af506e0ab34"}}},{"type":"Data Product","name":"Base7 SMAs","id":"b9145946-1899-4fac-b531-47ed600873be","savedPaylLine truncated
|
||||
Reference in new issue
Block a user