Trading Engine Refactoring
This commit is contained in:
1 parent
0fd53d7cef
commit
f05022e026
13 files changed
+28
-32
No files matched your search
@@ -303,7 +303,7 @@ function newUiObject () {
|
||||
compatibleType = '->' + 'Task' + '->'
|
||||
compatibleSubType = undefined
|
||||
break
|
||||
case 'Trading Engine':
|
||||
case 'Trading Bot Instance':
|
||||
compatibleType = '->' + 'Task' + '->'
|
||||
compatibleSubType = undefined
|
||||
break
|
||||
@@ -318,7 +318,7 @@ function newUiObject () {
|
||||
break
|
||||
}
|
||||
case 'Trading Engine Process': {
|
||||
compatibleType = '->' + 'Trading Engine' + '->'
|
||||
compatibleType = '->' + 'Trading Bot Instance' + '->'
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -425,7 +425,7 @@ function newUiObject () {
|
||||
if (thisObject.payload.node.type === 'Task' && nearbyNode.task !== undefined) { continue }
|
||||
if (thisObject.payload.node.type === 'Sensor Bot Instance' && nearbyNode.bot !== undefined) { continue }
|
||||
if (thisObject.payload.node.type === 'Indicator Bot Instance' && nearbyNode.bot !== undefined) { continue }
|
||||
if (thisObject.payload.node.type === 'Trading Engine' && nearbyNode.bot !== undefined) { continue }
|
||||
if (thisObject.payload.node.type === 'Trading Bot Instance' && nearbyNode.bot !== undefined) { continue }
|
||||
if (thisObject.payload.node.type === 'Process' && nearbyNode.process !== undefined) { continue }
|
||||
if (thisObject.payload.node.type === 'Trading System' && nearbyNode.tradingSystem !== undefined) { continue }
|
||||
if (thisObject.payload.node.type === 'Personal Data' && nearbyNode.personalData !== undefined) { continue }
|
||||
|
||||
@@ -801,7 +801,7 @@ function newUiObjectConstructor () {
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Add Trading Engine',
|
||||
visible: true,
|
||||
relatedUiObject: 'Trading Engine',
|
||||
relatedUiObject: 'Trading Bot Instance',
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
@@ -974,7 +974,7 @@ function newUiObjectConstructor () {
|
||||
)
|
||||
break
|
||||
}
|
||||
case 'Trading Engine': {
|
||||
case 'Trading Bot Instance': {
|
||||
uiObject.codeEditor = newCodeEditor()
|
||||
uiObject.codeEditor.isVisibleFunction = uiObject.isVisibleFunction
|
||||
uiObject.codeEditor.initialize()
|
||||
@@ -3242,7 +3242,7 @@ function newUiObjectConstructor () {
|
||||
level_3()
|
||||
break
|
||||
}
|
||||
case 'Trading Engine': {
|
||||
case 'Trading Bot Instance': {
|
||||
level_3()
|
||||
break
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ function newUiObjectTitle () {
|
||||
thisObject.allwaysVisible = true
|
||||
break
|
||||
}
|
||||
case 'Trading Engine': {
|
||||
case 'Trading Bot Instance': {
|
||||
break
|
||||
}
|
||||
case 'Process': {
|
||||
|
||||
@@ -297,7 +297,7 @@ function newProductsPanel () {
|
||||
|
||||
for (let j = 0; j < devTeam.bots.length; j++) {
|
||||
let bot = devTeam.bots[j]
|
||||
if (bot.type !== 'Trading Engine') { continue }
|
||||
if (bot.type !== 'Trading Bot Instance') { continue }
|
||||
|
||||
if (devTeam.codeName === code.team && bot.codeName === code.bot) {
|
||||
/* We found an instance of the same Trading Engine we are currently looking at.
|
||||
|
||||
@@ -51,7 +51,7 @@ function newStrategySpace () {
|
||||
['Task', 'timeline'],
|
||||
['Sensor Bot Instance', 'bot-sensor'],
|
||||
['Indicator Bot Instance', 'bot-indicator'],
|
||||
['Trading Engine', 'trading-engine'],
|
||||
['Trading Bot Instance', 'trading-engine'],
|
||||
['Process', 'process'],
|
||||
['Backtesting Session', 'session-backtesting'],
|
||||
['Live Trading Session', 'session-live-trading'],
|
||||
|
||||
@@ -145,7 +145,7 @@ function newAttachDetach () {
|
||||
completeDetachment(node, rootNodes)
|
||||
return
|
||||
}
|
||||
case 'Trading Engine': {
|
||||
case 'Trading Bot Instance': {
|
||||
node.payload.parentNode.bot = undefined
|
||||
completeDetachment(node, rootNodes)
|
||||
return
|
||||
@@ -437,7 +437,7 @@ function newAttachDetach () {
|
||||
completeAttachment(node, rootNodes)
|
||||
}
|
||||
break
|
||||
case 'Trading Engine': {
|
||||
case 'Trading Bot Instance': {
|
||||
node.payload.parentNode = attachToNode
|
||||
node.payload.chainParent = attachToNode
|
||||
node.payload.parentNode.bot = node
|
||||
|
||||
@@ -44,7 +44,7 @@ function newNodeChildren () {
|
||||
case 'Indicator Bot Instance': {
|
||||
return countChildrenIndicator(parentNode, childNode)
|
||||
}
|
||||
case 'Trading Engine': {
|
||||
case 'Trading Bot Instance': {
|
||||
return countChildrenTradingEngine(parentNode, childNode)
|
||||
}
|
||||
case 'Process': {
|
||||
|
||||
@@ -109,7 +109,7 @@ function newNodeDeleter () {
|
||||
deleteBot(rootNode, rootNodes)
|
||||
break
|
||||
}
|
||||
case 'Trading Engine': {
|
||||
case 'Trading Bot Instance': {
|
||||
deleteBot(rootNode, rootNodes)
|
||||
break
|
||||
}
|
||||
|
||||
@@ -574,7 +574,7 @@ function newOnFocus () {
|
||||
return
|
||||
}
|
||||
}
|
||||
case 'Trading Engine': {
|
||||
case 'Trading Bot Instance': {
|
||||
let child
|
||||
for (let m = 0; m < node.processes.length; m++) {
|
||||
child = getNodeThatIsOnFocus(node.processes[m])
|
||||
|
||||
@@ -481,8 +481,8 @@ function newPartsFromNodes () {
|
||||
}
|
||||
return
|
||||
}
|
||||
case 'Trading Engine': {
|
||||
createPart('Trading Engine', node.name, node, parentNode, chainParent, 'Trading Engine')
|
||||
case 'Trading Bot Instance': {
|
||||
createPart('Trading Bot Instance', node.name, node, parentNode, chainParent, 'Trading Bot Instance')
|
||||
for (let m = 0; m < node.processes.length; m++) {
|
||||
let process = node.processes[m]
|
||||
createPartFromNode(process, node, node)
|
||||
@@ -500,7 +500,7 @@ function newPartsFromNodes () {
|
||||
node.subType = 'Indicator Process'
|
||||
break
|
||||
}
|
||||
case 'Trading Engine': {
|
||||
case 'Trading Bot Instance': {
|
||||
node.subType = 'Trading Engine Process'
|
||||
break
|
||||
}
|
||||
@@ -701,7 +701,7 @@ function newPartsFromNodes () {
|
||||
processes: [],
|
||||
code: '{}'
|
||||
}
|
||||
createPart('Trading Engine', '', node.bot, node, node)
|
||||
createPart('Trading Bot Instance', '', node.bot, node, node)
|
||||
}
|
||||
return node.bot
|
||||
}
|
||||
@@ -723,7 +723,7 @@ function newPartsFromNodes () {
|
||||
process.name = 'Indicator Process'
|
||||
break
|
||||
}
|
||||
case 'Trading Engine': {
|
||||
case 'Trading Bot Instance': {
|
||||
process.subType = 'Trading Engine Process'
|
||||
process.name = 'Trading Engine Process'
|
||||
break
|
||||
|
||||
@@ -824,7 +824,7 @@ function newProtocolNode () {
|
||||
}
|
||||
return object
|
||||
}
|
||||
case 'Trading Engine': {
|
||||
case 'Trading Bot Instance': {
|
||||
let object = {
|
||||
type: node.type,
|
||||
subType: node.subType,
|
||||
|
||||
@@ -575,7 +575,7 @@ function newShortcutKeys () {
|
||||
return
|
||||
}
|
||||
}
|
||||
case 'Trading Engine': {
|
||||
case 'Trading Bot Instance': {
|
||||
let child
|
||||
for (let m = 0; m < node.processes.length; m++) {
|
||||
child = getNodeByShortcutKey(node.processes[m], searchingKey)
|
||||
|
||||
@@ -179,7 +179,7 @@ function newWorkspace () {
|
||||
let taskManager = networkNode.taskManagers[i]
|
||||
for (k = 0; k < taskManager.tasks.length; k++) {
|
||||
let task = taskManager.tasks[k]
|
||||
if (task.bot.type === 'Trading Engine') {
|
||||
if (task.bot.type === 'Trading Bot Instance') {
|
||||
tradingEngines.push(task.bot)
|
||||
}
|
||||
}
|
||||
@@ -195,22 +195,18 @@ function newWorkspace () {
|
||||
function getNodeByShortcutKey (searchingKey) {
|
||||
for (let i = 0; i < thisObject.workspaceNode.rootNodes.length; i++) {
|
||||
let rootNode = thisObject.workspaceNode.rootNodes[i]
|
||||
if (rootNode.type === 'Definition') {
|
||||
let definition = rootNode
|
||||
let node = functionLibraryShortcutKeys.getNodeByShortcutKey(rootNode, searchingKey)
|
||||
if (node !== undefined) { return node }
|
||||
}
|
||||
let definition = rootNode
|
||||
let node = functionLibraryShortcutKeys.getNodeByShortcutKey(rootNode, searchingKey)
|
||||
if (node !== undefined) { return node }
|
||||
}
|
||||
}
|
||||
|
||||
function getNodeThatIsOnFocus () {
|
||||
for (let i = 0; i < thisObject.workspaceNode.rootNodes.length; i++) {
|
||||
let rootNode = thisObject.workspaceNode.rootNodes[i]
|
||||
if (rootNode.type === 'Definition') {
|
||||
let definition = rootNode
|
||||
let node = functionLibraryOnFocus.getNodeThatIsOnFocus(rootNode)
|
||||
if (node !== undefined) { return node }
|
||||
}
|
||||
let definition = rootNode
|
||||
let node = functionLibraryOnFocus.getNodeThatIsOnFocus(rootNode)
|
||||
if (node !== undefined) { return node }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user