Merge pull request #506 from Luis-Fernando-Molina/develop
Contribution: Switch between Trading Sessions
This commit is contained in:
7 files changed
+74
-10
No files matched your search
@@ -2839,6 +2839,12 @@
|
||||
"relatedUiObject": "Trading Parameters",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
"action": "Switch To Paper Trading",
|
||||
"label": "Switch To Paper Trading",
|
||||
"relatedUiObject": "Paper Trading Session",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"askConfirmation": true,
|
||||
@@ -10093,6 +10099,12 @@
|
||||
"relatedUiObject": "Trading Parameters",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
"action": "Switch To Backtesting",
|
||||
"label": "Switch To Backtesting",
|
||||
"relatedUiObject": "Backtesting Session",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"askConfirmation": true,
|
||||
@@ -10194,6 +10206,12 @@
|
||||
"relatedUiObject": "Trading Parameters",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
"action": "Switch To Live Trading",
|
||||
"label": "Switch To Live Trading",
|
||||
"relatedUiObject": "Live Trading Session",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"askConfirmation": true,
|
||||
@@ -10321,6 +10339,12 @@
|
||||
"relatedUiObject": "Trading Parameters",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
"action": "Switch To Forward Testing",
|
||||
"label": "Switch To Forward Testing",
|
||||
"relatedUiObject": "Forward Testing Session",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"askConfirmation": true,
|
||||
|
||||
@@ -634,7 +634,7 @@ function newSuperalgosActionSwitch() {
|
||||
{
|
||||
let definition = getSchemaDocument(action.node)
|
||||
if (definition !== undefined) {
|
||||
UI.projects.superalgos.spaces.docsSpace.openSpaceAreaAndNavigateTo(action.node.project,'Node', action.node.type)
|
||||
UI.projects.superalgos.spaces.docsSpace.openSpaceAreaAndNavigateTo(action.node.project, 'Node', action.node.type)
|
||||
}
|
||||
}
|
||||
break
|
||||
@@ -678,6 +678,30 @@ function newSuperalgosActionSwitch() {
|
||||
UI.projects.superalgos.functionLibraries.workspaceFunctions.addMissingWorkspaceProjects(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
case 'Switch To Forward Testing':
|
||||
{
|
||||
action.node.type = "Forward Testing Session"
|
||||
UI.projects.superalgos.spaces.floatingSpace.uiObjectConstructor.createUiObject(true, action.node.payload)
|
||||
}
|
||||
break
|
||||
case 'Switch To Live Trading':
|
||||
{
|
||||
action.node.type = "Live Trading Session"
|
||||
UI.projects.superalgos.spaces.floatingSpace.uiObjectConstructor.createUiObject(true, action.node.payload)
|
||||
}
|
||||
break
|
||||
case 'Switch To Paper Trading':
|
||||
{
|
||||
action.node.type = "Paper Trading Session"
|
||||
UI.projects.superalgos.spaces.floatingSpace.uiObjectConstructor.createUiObject(true, action.node.payload)
|
||||
}
|
||||
break
|
||||
case 'Switch To Backtesting':
|
||||
{
|
||||
action.node.type = "Backtesting Session"
|
||||
UI.projects.superalgos.spaces.floatingSpace.uiObjectConstructor.createUiObject(true, action.node.payload)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -156,7 +156,6 @@ function newSuperalgosFunctionLibraryNodeDeleter() {
|
||||
node.payload.targetPosition.x = undefined
|
||||
node.payload.targetPosition.y = undefined
|
||||
node.payload.visible = undefined
|
||||
node.payload.subTitle = undefined
|
||||
node.payload.title = undefined
|
||||
node.payload.node = undefined
|
||||
node.payload.parentNode = undefined
|
||||
|
||||
@@ -641,13 +641,6 @@ function newSuperalgosFunctionLibraryUiObjectsFromNodes() {
|
||||
}
|
||||
}
|
||||
|
||||
/* Setting the title */
|
||||
if (title !== undefined) {
|
||||
payload.subTitle = title
|
||||
} else {
|
||||
payload.subTitle = uiObjectType
|
||||
}
|
||||
|
||||
payload.visible = true
|
||||
payload.title = name
|
||||
payload.node = node
|
||||
|
||||
@@ -210,6 +210,12 @@ function newFloatingLayer() {
|
||||
let newInvisibleArray = []
|
||||
for (let i = 0; i < invisibleFloatingObjects.length; i++) {
|
||||
let floatingObject = invisibleFloatingObjects[i]
|
||||
|
||||
if (floatingObject.payload === undefined) {
|
||||
/* The floating object was replaced by another one. */
|
||||
invisibleFloatingObjects.splice(i, 1)
|
||||
return
|
||||
}
|
||||
|
||||
collapsePhysics(floatingObject)
|
||||
|
||||
@@ -227,6 +233,12 @@ function newFloatingLayer() {
|
||||
for (let i = 0; i < visibleFloatingObjects.length; i++) {
|
||||
let floatingObject = visibleFloatingObjects[i]
|
||||
|
||||
if (floatingObject.payload === undefined) {
|
||||
/* The floating object was replaced by another one. */
|
||||
visibleFloatingObjects.splice(i, 1)
|
||||
return
|
||||
}
|
||||
|
||||
collapsePhysics(floatingObject)
|
||||
|
||||
if (floatingObject.isParentCollapsed === true) {
|
||||
|
||||
@@ -1679,7 +1679,7 @@ function newUiObject() {
|
||||
if (radius > 6) {
|
||||
const MAX_LABEL_LENGTH = 30
|
||||
|
||||
label = thisObject.payload.subTitle
|
||||
label = thisObject.payload.node.type
|
||||
label = addIndexNumber(label)
|
||||
|
||||
if (label !== undefined) {
|
||||
|
||||
@@ -25,10 +25,22 @@ function newUiObjectConstructor() {
|
||||
}
|
||||
|
||||
function createUiObject(userAddingNew, payload) {
|
||||
|
||||
/*
|
||||
In case we are replacing an existing uiObject and floatingObject
|
||||
*/
|
||||
if (payload.floatingObject !== undefined) {
|
||||
payload.floatingObject.finalize()
|
||||
}
|
||||
if (payload.uiObject !== undefined) {
|
||||
payload.uiObject.finalize()
|
||||
}
|
||||
|
||||
let floatingObject = newFloatingObject()
|
||||
floatingObject.fitFunction = UI.projects.superalgos.spaces.floatingSpace.fitIntoVisibleArea
|
||||
floatingObject.container.connectToParent(UI.projects.superalgos.spaces.floatingSpace.container, false, false, false, false, false, false, false, false)
|
||||
floatingObject.initialize('UI Object', payload)
|
||||
|
||||
payload.floatingObject = floatingObject
|
||||
|
||||
/*
|
||||
|
||||
Reference in new issue
Block a user