Refactoring
This commit is contained in:
1 parent
79bff38001
commit
a876a15e42
5 files changed
+9
-9
No files matched your search
@@ -94,7 +94,7 @@ function newStrategizerGateway () {
|
||||
}
|
||||
}
|
||||
|
||||
async function saveToStrategyzer (simulationParams) {
|
||||
async function saveToStrategyzer (uiCurrentValues) {
|
||||
try {
|
||||
const accessToken = window.localStorage.getItem(LOGGED_IN_ACCESS_TOKEN_LOCAL_STORAGE_KEY)
|
||||
if (accessToken === null) {
|
||||
@@ -115,7 +115,7 @@ function newStrategizerGateway () {
|
||||
}
|
||||
|
||||
if (window.canvasApp.executingAt === 'Local') {
|
||||
tradingSystem.simulationParams = simulationParams
|
||||
tradingSystem.uiCurrentValues = uiCurrentValues
|
||||
callServer(JSON.stringify(tradingSystem), 'SaveDefinition', onSaved)
|
||||
function onSaved (err) {
|
||||
if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
|
||||
|
||||
@@ -19,7 +19,7 @@ function newSessionFunctions () {
|
||||
|
||||
function getDefinition () {
|
||||
let definitionNode = canvas.strategySpace.workspace.getProtocolDefinitionNode()
|
||||
definitionNode.simulationParams = getSimulationParams()
|
||||
definitionNode.uiCurrentValues = getUICurrentValues()
|
||||
return JSON.stringify(definitionNode)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ function newWorkspace () {
|
||||
break
|
||||
case 'Save Trading System':
|
||||
{
|
||||
let result = await canvas.strategySpace.strategizerGateway.saveToStrategyzer(getSimulationParams())
|
||||
let result = await canvas.strategySpace.strategizerGateway.saveToStrategyzer(getUICurrentValues())
|
||||
if (result === true) {
|
||||
callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE)
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user