Stop and Take Profit can be downlaoded
This commit is contained in:
1 parent
3619802f33
commit
ff132b4e2b
2 files changed
+64
-3
No files matched your search
@@ -282,7 +282,19 @@ function newStrategyPartConstructor () {
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: 0
|
||||
angle: -20
|
||||
},
|
||||
{
|
||||
action: 'Download',
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Download',
|
||||
visible: false,
|
||||
iconPathOn: 'upload',
|
||||
iconPathOff: 'upload',
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: 20
|
||||
}]
|
||||
break
|
||||
}
|
||||
@@ -312,7 +324,19 @@ function newStrategyPartConstructor () {
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: 0
|
||||
angle: -20
|
||||
},
|
||||
{
|
||||
action: 'Download',
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Download',
|
||||
visible: false,
|
||||
iconPathOn: 'upload',
|
||||
iconPathOff: 'upload',
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: 20
|
||||
}]
|
||||
break
|
||||
}
|
||||
|
||||
@@ -273,7 +273,13 @@ function newWorkspace () {
|
||||
case 'Download':
|
||||
|
||||
let text = JSON.stringify(getProtocolNode(payload.node))
|
||||
let fileName = payload.node.type + '.' + payload.node.name + '.json'
|
||||
let nodeName = payload.node.name
|
||||
if (nodeName === undefined) {
|
||||
nodeName = ''
|
||||
} else {
|
||||
nodeName = '.' + nodeName
|
||||
}
|
||||
let fileName = payload.node.type + nodeName + '.json'
|
||||
download(fileName, text)
|
||||
|
||||
break
|
||||
@@ -467,6 +473,37 @@ function newWorkspace () {
|
||||
return phase
|
||||
break
|
||||
}
|
||||
case 'Stop': {
|
||||
let stop = {
|
||||
type: node.type,
|
||||
subType: node.subType,
|
||||
name: node.name,
|
||||
phases: []
|
||||
}
|
||||
|
||||
for (let m = 0; m < node.phases.length; m++) {
|
||||
let phase = getProtocolNode(node.phases[m])
|
||||
stop.phases.push(phase)
|
||||
}
|
||||
return stop
|
||||
break
|
||||
}
|
||||
case 'Take Profit': {
|
||||
let takeProfit = {
|
||||
type: node.type,
|
||||
subType: node.subType,
|
||||
name: node.name,
|
||||
phases: []
|
||||
}
|
||||
|
||||
for (let m = 0; m < node.phases.length; m++) {
|
||||
let phase = getProtocolNode(node.phases[m])
|
||||
takeProfit.phases.push(phase)
|
||||
}
|
||||
return takeProfit
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user