From 7e3e011de8efe0d33aa539d49012da97ba4cb71f Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Thu, 6 Jun 2019 11:42:24 +0200 Subject: [PATCH] new menu items added --- FloatingSpace/StrategyPartConstructor.js | 210 ++++++++++++++++++++++- Spaces/StrategySpace.js | 3 + 2 files changed, 211 insertions(+), 2 deletions(-) diff --git a/FloatingSpace/StrategyPartConstructor.js b/FloatingSpace/StrategyPartConstructor.js index d43b6517d..daa1ef5c7 100644 --- a/FloatingSpace/StrategyPartConstructor.js +++ b/FloatingSpace/StrategyPartConstructor.js @@ -173,6 +173,143 @@ function newStrategyPartConstructor () { }] break } + case 'Parameters': { + menuItemsInitialValues = [ + { + action: 'Pin / Unpin', + actionFunction: floatingObject.pinToggle, + actionStatus: floatingObject.getPinStatus, + currentStatus: true, + label: undefined, + visible: false, + iconPathOn: 'target', + iconPathOff: 'security', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: -135 + }, + { + action: 'Freeze / Unfreeze', + actionFunction: floatingObject.freezeToggle, + actionStatus: floatingObject.getFreezeStatus, + currentStatus: true, + label: undefined, + visible: false, + iconPathOn: 'broken-link', + iconPathOff: 'security', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 135 + }, + { + action: 'Delete Parameters', + actionFunction: payload.onMenuItemClick, + label: 'Delete Trading System', + visible: false, + iconPathOn: 'trash', + iconPathOff: 'trash', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: -40 + }, + { + action: 'Add Missing Parameters', + actionFunction: payload.onMenuItemClick, + label: 'Add Missing Parameters', + visible: false, + iconPathOn: 'settings', + iconPathOff: 'settings', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 0 + }, + { + action: 'Download', + actionFunction: payload.onMenuItemClick, + label: 'Download', + visible: false, + iconPathOn: 'upload', + iconPathOff: 'upload', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 40 + }] + break + } + case 'Base Asset': { + menuItemsInitialValues = [ + { + action: 'Pin / Unpin', + actionFunction: floatingObject.pinToggle, + actionStatus: floatingObject.getPinStatus, + currentStatus: true, + label: undefined, + visible: false, + iconPathOn: 'target', + iconPathOff: 'security', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: -135 + }, + { + action: 'Freeze / Unfreeze', + actionFunction: floatingObject.freezeToggle, + actionStatus: floatingObject.getFreezeStatus, + currentStatus: true, + label: undefined, + visible: false, + iconPathOn: 'broken-link', + iconPathOff: 'security', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 135 + }, + { + action: 'Delete Base Asset', + actionFunction: payload.onMenuItemClick, + label: 'Delete Base Asset', + visible: false, + iconPathOn: 'trash', + iconPathOff: 'trash', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: -40 + }, + { + action: 'Add Formula', + actionFunction: payload.onMenuItemClick, + label: 'Add Formula', + visible: false, + iconPathOn: 'pipette', + iconPathOff: 'pipette', + relatedStrategyPart: 'Formula', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 0 + }, + { + action: 'Download', + actionFunction: payload.onMenuItemClick, + label: 'Download', + visible: false, + iconPathOn: 'upload', + iconPathOff: 'upload', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 40 + }] + break + } case 'Strategy': { menuItemsInitialValues = [ { @@ -501,6 +638,75 @@ function newStrategyPartConstructor () { }] break } + case 'Position Size': { + menuItemsInitialValues = [ + { + action: 'Pin / Unpin', + actionFunction: floatingObject.pinToggle, + actionStatus: floatingObject.getPinStatus, + currentStatus: true, + label: undefined, + visible: false, + iconPathOn: 'target', + iconPathOff: 'security', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: -135 + }, + { + action: 'Freeze / Unfreeze', + actionFunction: floatingObject.freezeToggle, + actionStatus: floatingObject.getFreezeStatus, + currentStatus: true, + label: undefined, + visible: false, + iconPathOn: 'broken-link', + iconPathOff: 'security', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 135 + }, + { + action: 'Delete Position Size', + actionFunction: payload.onMenuItemClick, + label: 'Delete Trading System', + visible: false, + iconPathOn: 'trash', + iconPathOff: 'trash', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: -40 + }, + { + action: 'Add Formula', + actionFunction: payload.onMenuItemClick, + label: 'Add Formula', + visible: false, + iconPathOn: 'pipette', + iconPathOff: 'pipette', + relatedStrategyPart: 'Formula', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 0 + }, + { + action: 'Download', + actionFunction: payload.onMenuItemClick, + label: 'Download', + visible: false, + iconPathOn: 'upload', + iconPathOff: 'upload', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 40 + }] + break + } case 'Trigger On Event': { menuItemsInitialValues = [ { @@ -949,8 +1155,8 @@ function newStrategyPartConstructor () { actionFunction: payload.onMenuItemClick, label: 'Add Formula', visible: false, - iconPathOn: 'schedule', - iconPathOff: 'schedule', + iconPathOn: 'pipette', + iconPathOff: 'pipette', relatedStrategyPart: 'Formula', rawRadius: 8, targetRadius: 0, diff --git a/Spaces/StrategySpace.js b/Spaces/StrategySpace.js index d99d48d32..01e7bc5df 100644 --- a/Spaces/StrategySpace.js +++ b/Spaces/StrategySpace.js @@ -41,11 +41,14 @@ function newStrategySpace () { function buildIconByPartTypeMap () { const relationshipArray = [ ['Trading System', 'analysis'], + ['Parameters', 'settings'], + ['Base Asset', 'sitemap'], ['Strategy', 'quality'], ['Trigger Stage', 'chronometer'], ['Open Stage', 'photo-camera'], ['Manage Stage', 'video-player'], ['Close Stage', 'timeline'], + ['Position Size', 'responsive'], ['Trigger On Event', 'startup'], ['Trigger Off Event', 'support'], ['Take Position Event', 'compass'],