Parameters attacheable to Trading Engine Process
This commit is contained in:
1 parent
390fca2c10
commit
ce9a45ee0a
6 files changed
+27
-3
No files matched your search
@@ -231,8 +231,8 @@ function newStrategyPart () {
|
||||
compatibleSubType = undefined
|
||||
break
|
||||
case 'Parameters':
|
||||
compatibleType = '->' + 'Trading System' + '->'
|
||||
compatibleSubType = undefined
|
||||
compatibleType = '->' + 'Trading System' + '->' + 'Process' + '->'
|
||||
compatibleSubType = '->' + 'Trading Engine Process' + '->'
|
||||
break
|
||||
case 'Base Asset':
|
||||
compatibleType = '->' + 'Parameters' + '->'
|
||||
@@ -419,6 +419,14 @@ function newStrategyPart () {
|
||||
if (thisObject.payload.node.type === 'Formula' && nearbyNode.formula !== undefined) { continue }
|
||||
if (thisObject.payload.node.type === 'Next Phase Event' && nearbyNode.nextPhaseEvent !== undefined) { continue }
|
||||
if (thisObject.payload.node.type === 'Code' && nearbyNode.code !== undefined) { continue }
|
||||
/* Here we check if the subtypes are compatible. */
|
||||
if (nearbyNode.subType !== undefined) {
|
||||
if (compatibleSubType.indexOf('->' + nearbyNode.subType + '->') >= 0) {
|
||||
if (thisObject.payload.node.type === 'Parameters' && nearbyNode.parameters !== undefined) { continue }
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
}
|
||||
/* Discard Phases without partent */
|
||||
if (thisObject.payload.node.type === 'Phase' && nearbyNode.type === 'Phase' && nearbyNode.payload.parentNode === undefined) { continue }
|
||||
/* Control maxPhases */
|
||||
|
||||
@@ -280,6 +280,12 @@ function newNodeChildren () {
|
||||
childrenCount: 0,
|
||||
childIndex: undefined
|
||||
}
|
||||
if (parentNode.parameters !== undefined) {
|
||||
response.childrenCount++
|
||||
if (parentNode.parameters.id === childNode.id) {
|
||||
response.childIndex = response.childrenCount
|
||||
}
|
||||
}
|
||||
return response
|
||||
}
|
||||
|
||||
|
||||
@@ -364,6 +364,11 @@ function newNodeDeleter () {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (node.parameters !== undefined) {
|
||||
deleteParameters(node.parameters, rootNodes)
|
||||
}
|
||||
|
||||
completeDeletion(node, rootNodes)
|
||||
destroyPart(node)
|
||||
cleanNode(node)
|
||||
|
||||
@@ -424,6 +424,9 @@ function newPartsFromNodes () {
|
||||
}
|
||||
}
|
||||
createPart('Process', node.name, node, parentNode, chainParent, 'Process')
|
||||
if (node.parameters !== undefined) {
|
||||
createPartFromNode(node.parameters, node, node)
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -443,7 +443,8 @@ function newProtocolNode () {
|
||||
type: node.type,
|
||||
subType: node.subType,
|
||||
name: node.name,
|
||||
code: node.code
|
||||
code: node.code,
|
||||
parameters: getProtocolNode(node.parameters, removePersonalData, parseJSONStrings, includeIds)
|
||||
}
|
||||
if (parseJSONStrings) {
|
||||
object.code = JSON.parse(object.code)
|
||||
|
||||
@@ -524,6 +524,7 @@ function newStringifyNode () {
|
||||
subType: node.subType,
|
||||
name: node.name,
|
||||
code: node.code,
|
||||
parameters: prepareForStringify(node.parameters, removePersonalData),
|
||||
savedPayload: getSavedPayload(node)
|
||||
}
|
||||
return object
|
||||
|
||||
Reference in new issue
Block a user