From 26af84911fa481c594bd2aaf534a88a7ce7ad5e3 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 6 Jul 2019 11:28:23 +0200 Subject: [PATCH 1/6] Allowing less repulsion force --- FloatingSpace/FloatingLayer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FloatingSpace/FloatingLayer.js b/FloatingSpace/FloatingLayer.js index c23303354..22c78cd52 100644 --- a/FloatingSpace/FloatingLayer.js +++ b/FloatingSpace/FloatingLayer.js @@ -631,8 +631,8 @@ function newFloatingLayer () { maxTargetRepulsionForce = maxTargetRepulsionForce + pDelta / 1000 - if (maxTargetRepulsionForce < 0.0001) { - maxTargetRepulsionForce = 0.0001 + if (maxTargetRepulsionForce < 0.0000000001) { + maxTargetRepulsionForce = 0.0000000001 } } catch (err) { if (ERROR_LOG === true) { logger.write('[ERROR] changeTargetRepulsion -> err= ' + err.stack) } From 43d858e2f082b8c8fb138b4b04bd67a019a89d4b Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 6 Jul 2019 12:01:36 +0200 Subject: [PATCH 2/6] BUG FIXED: some objects attaching where they should not --- FloatingSpace/StrategyPart.js | 42 +++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/FloatingSpace/StrategyPart.js b/FloatingSpace/StrategyPart.js index 8391e6e86..5e6bc1769 100644 --- a/FloatingSpace/StrategyPart.js +++ b/FloatingSpace/StrategyPart.js @@ -197,83 +197,83 @@ function newStrategyPart () { let compatibleSubType switch (thisObject.payload.node.type) { case 'Parameters': - compatibleType = 'Trading System' + compatibleType = '->' + 'Trading System' compatibleSubType = undefined break case 'Base Asset': - compatibleType = 'Parameters' + compatibleType = '->' + 'Parameters' compatibleSubType = undefined break case 'Strategy': - compatibleType = 'Trading System' + compatibleType = '->' + 'Trading System' compatibleSubType = undefined break case 'Trigger Stage': - compatibleType = 'Strategy' + compatibleType = '->' + 'Strategy' compatibleSubType = undefined break case 'Open Stage': - compatibleType = 'Strategy' + compatibleType = '->' + 'Strategy' compatibleSubType = undefined break case 'Manage Stage': - compatibleType = 'Strategy' + compatibleType = '->' + 'Strategy' compatibleSubType = undefined break case 'Close Stage': - compatibleType = 'Strategy' + compatibleType = '->' + 'Strategy' compatibleSubType = undefined break case 'Position Size': - compatibleType = 'Trigger Stage' + compatibleType = '->' + 'Trigger Stage' compatibleSubType = undefined break case 'Take Position Event': - compatibleType = 'Trigger Stage' + compatibleType = '->' + 'Trigger Stage' compatibleSubType = undefined break case 'Trigger Off Event': - compatibleType = 'Trigger Stage' + compatibleType = '->' + 'Trigger Stage' compatibleSubType = undefined break case 'Trigger On Event': - compatibleType = 'Trigger Stage' + compatibleType = '->' + 'Trigger Stage' compatibleSubType = undefined break case 'Initial Definition': - compatibleType = 'Open Stage' + compatibleType = '->' + 'Open Stage' compatibleSubType = undefined break case 'Stop': - compatibleType = 'Manage Stage' + '.' + 'Initial Definition' + compatibleType = '->' + 'Manage Stage' + '->' + 'Initial Definition' compatibleSubType = undefined break case 'Take Profit': - compatibleType = 'Manage Stage' + '.' + 'Initial Definition' + compatibleType = '->' + 'Manage Stage' + '->' + 'Initial Definition' compatibleSubType = undefined break case 'Phase': - compatibleType = 'Stop' + '.' + 'Take Profit' + '.' + 'Phase' + compatibleType = '->' + 'Stop' + '->' + 'Take Profit' + '->' + 'Phase' compatibleSubType = undefined break case 'Formula': - compatibleType = 'Base Asset' + '.' + 'Position Size' + '.' + 'Phase' + compatibleType = '->' + 'Base Asset' + '->' + 'Position Size' + '->' + 'Phase' compatibleSubType = undefined break case 'Next Phase Event': - compatibleType = 'Phase' + compatibleType = '->' + 'Phase' compatibleSubType = undefined break case 'Situation': - compatibleType = 'Take Position Event' + '.' + 'Trigger On Event' + '.' + 'Trigger Off Event' + '.' + 'Next Phase Event' + compatibleType = '->' + 'Take Position Event' + '->' + 'Trigger On Event' + '->' + 'Trigger Off Event' + '->' + 'Next Phase Event' compatibleSubType = undefined break case 'Condition': - compatibleType = 'Situation' + compatibleType = '->' + 'Situation' compatibleSubType = undefined break case 'Code': - compatibleType = 'Condition' + compatibleType = '->' + 'Condition' compatibleSubType = undefined break default: @@ -288,7 +288,7 @@ function newStrategyPart () { let distance = nearby[0] let floatingObject = nearby[1] let nearbyNode = floatingObject.payload.node - if (compatibleType.indexOf(nearbyNode.type) >= 0) { + if (compatibleType.indexOf('->' + nearbyNode.type) >= 0) { /* Discard objects with busy coonection ports */ if (thisObject.payload.node.type === 'Parameters' && nearbyNode.parameters !== undefined) { continue } if (thisObject.payload.node.type === 'Base Asset' && nearbyNode.baseAsset !== undefined) { continue } From 40ab33192f71f07ba62f5848b8c142eb509531bf Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 6 Jul 2019 12:17:34 +0200 Subject: [PATCH 3/6] Improvement: Re Calculate Buttom appears only when Execution Focus is set --- CockpitSpace/RestartSimulation.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/CockpitSpace/RestartSimulation.js b/CockpitSpace/RestartSimulation.js index c32947f52..3c85d0917 100644 --- a/CockpitSpace/RestartSimulation.js +++ b/CockpitSpace/RestartSimulation.js @@ -30,6 +30,8 @@ function newRestartSimulation () { let counterTillNextState = 0 let productCardsToTurnOn = [] + + let executionFocusExists = false return thisObject function finalize () { @@ -53,7 +55,7 @@ function newRestartSimulation () { } function getContainer (point, purpose) { - if (thisObject.visible !== true || thisObject.status !== 'Ready') { return } + if (thisObject.visible !== true || thisObject.status !== 'Ready' || executionFocusExists === false) { return } if (thisObject.container.frame.isThisPointHere(point, true) === true) { return thisObject.container @@ -180,6 +182,15 @@ function newRestartSimulation () { } positionPhysics() + executionFocusPhysics() + } + + function executionFocusPhysics () { + if (canvas.strategySpace.workspace.tradingSystem !== undefined) { + executionFocusExists = true + } else { + executionFocusExists = false + } } function positionPhysics () { @@ -188,7 +199,7 @@ function newRestartSimulation () { } function draw () { - if (thisObject.visible !== true) { return } + if (thisObject.visible !== true || executionFocusExists === false) { return } drawBackground() drawText() } From 8dd41d4759b98e9b1d2017157f84d7d0e3423a62 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 6 Jul 2019 12:43:44 +0200 Subject: [PATCH 4/6] 2nd update of layers when calculating --- CockpitSpace/RestartSimulation.js | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/CockpitSpace/RestartSimulation.js b/CockpitSpace/RestartSimulation.js index 3c85d0917..a52272e84 100644 --- a/CockpitSpace/RestartSimulation.js +++ b/CockpitSpace/RestartSimulation.js @@ -167,11 +167,21 @@ function newRestartSimulation () { break case 'Calculating': thisObject.status = 'Refreshing' - turnOffProductCards() - counterTillNextState = 10 + counterTillNextState = 25 break case 'Refreshing': + thisObject.status = 'Reviewing' + turnOffProductCards() + turnOnProductCards() + counterTillNextState = 250 + break + case 'Reviewing': + thisObject.status = '2nd Refresh' + counterTillNextState = 25 + break + case '2nd Refresh': thisObject.status = 'Ready' + turnOffProductCards() turnOnProductCards() break case 'Error': @@ -224,7 +234,7 @@ function newRestartSimulation () { break } case 'Saving': - params.backgroundColor = UI_COLOR.MANGANESE_PURPLE + params.backgroundColor = UI_COLOR.GREY break case 'Restarting': params.backgroundColor = UI_COLOR.GREY @@ -235,6 +245,12 @@ function newRestartSimulation () { case 'Calculating': params.backgroundColor = UI_COLOR.TITANIUM_YELLOW break + case 'Reviewing': + params.backgroundColor = UI_COLOR.GREY + break + case '2nd Refresh': + params.backgroundColor = UI_COLOR.GOLDEN_ORANGE + break case 'Error': params.backgroundColor = UI_COLOR.RUSTED_RED break @@ -259,7 +275,7 @@ function newRestartSimulation () { switch (thisObject.status) { case 'Ready': - label = 'RE-CALCULATE' + label = 'RUN SIMULATION' break case 'Saving': label = 'SAVING STRATEGIES CHANGES...' @@ -273,6 +289,12 @@ function newRestartSimulation () { case 'Calculating': label = 'CALCULATING...' break + case 'Reviewing': + label = 'WAITING TO UPDATE...' + break + case '2nd Refresh': + label = 'UPDATING...' + break case 'Error': label = 'ERROR, RETRY LATER' break @@ -288,4 +310,3 @@ function newRestartSimulation () { browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y) } } - From de3512e02384c1565ab180b70a56f1f79aea8a95 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 6 Jul 2019 12:48:14 +0200 Subject: [PATCH 5/6] fine tunning --- CockpitSpace/RestartSimulation.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CockpitSpace/RestartSimulation.js b/CockpitSpace/RestartSimulation.js index a52272e84..927f82c75 100644 --- a/CockpitSpace/RestartSimulation.js +++ b/CockpitSpace/RestartSimulation.js @@ -167,13 +167,13 @@ function newRestartSimulation () { break case 'Calculating': thisObject.status = 'Refreshing' - counterTillNextState = 25 + counterTillNextState = 15 break case 'Refreshing': thisObject.status = 'Reviewing' turnOffProductCards() turnOnProductCards() - counterTillNextState = 250 + counterTillNextState = 150 break case 'Reviewing': thisObject.status = '2nd Refresh' From 611185b6eaa6116a4d4cfae9d76ec2fa97e37b47 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 6 Jul 2019 14:14:07 +0200 Subject: [PATCH 6/6] Mass Fine Tunning --- FloatingSpace/StrategyPartConstructor.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/FloatingSpace/StrategyPartConstructor.js b/FloatingSpace/StrategyPartConstructor.js index 2f953ff06..378d9a724 100644 --- a/FloatingSpace/StrategyPartConstructor.js +++ b/FloatingSpace/StrategyPartConstructor.js @@ -2070,7 +2070,7 @@ function newStrategyPartConstructor () { floatingObject.targetFriction = 0.93 floatingObject.friction = INITIAL_FRICTION - floatingObject.initializeMass(1000) + floatingObject.initializeMass(500) floatingObject.initializeRadius(45) floatingObject.initializeImageSize(80) floatingObject.initializeFontSize(10) @@ -2082,7 +2082,7 @@ function newStrategyPartConstructor () { floatingObject.targetFriction = 0.94 floatingObject.friction = INITIAL_FRICTION - floatingObject.initializeMass(750) + floatingObject.initializeMass(600) floatingObject.initializeRadius(45) floatingObject.initializeImageSize(80) floatingObject.initializeFontSize(10) @@ -2098,7 +2098,7 @@ function newStrategyPartConstructor () { floatingObject.targetFriction = FRICTION floatingObject.friction = INITIAL_FRICTION - floatingObject.initializeMass(500) + floatingObject.initializeMass(300) floatingObject.initializeRadius(40) floatingObject.initializeImageSize(70) floatingObject.initializeFontSize(10) @@ -2114,7 +2114,7 @@ function newStrategyPartConstructor () { floatingObject.targetFriction = FRICTION floatingObject.friction = INITIAL_FRICTION - floatingObject.initializeMass(250) + floatingObject.initializeMass(150) floatingObject.initializeRadius(35) floatingObject.initializeImageSize(60) floatingObject.initializeFontSize(10) @@ -2130,7 +2130,7 @@ function newStrategyPartConstructor () { floatingObject.targetFriction = FRICTION floatingObject.friction = INITIAL_FRICTION - floatingObject.initializeMass(100) + floatingObject.initializeMass(75) floatingObject.initializeRadius(30) floatingObject.initializeImageSize(50) floatingObject.initializeFontSize(10)