Merge pull request #94 from AAMasters/develop
Envio de simulationParams junto con la definition.json
This commit is contained in:
2 files changed
+10
-6
No files matched your search
@@ -103,17 +103,20 @@ function newRestartSimulation () {
|
||||
}
|
||||
|
||||
let simulationParams = {
|
||||
beginDatetime: dateAtScreenCorner.valueOf() / 1000 | 0,
|
||||
beginDatetime: dateAtScreenCorner.valueOf(),
|
||||
resumeExecution: false,
|
||||
timePeriodDailyArray: timePeriodDailyArray,
|
||||
timePeriodMarketArray: timePeriodMarketArray
|
||||
timePeriodMarketArray: timePeriodMarketArray,
|
||||
timestamp: (new Date()).valueOf()
|
||||
}
|
||||
try {
|
||||
thisObject.status = 'Saving'
|
||||
let result = await canvas.strategySpace.strategizerGateway.saveToStrategyzer()
|
||||
let result = await canvas.strategySpace.strategizerGateway.saveToStrategyzer(simulationParams)
|
||||
if (result === true) {
|
||||
thisObject.status = 'Restarting'
|
||||
await graphQlRestartSimulation(simulationParams)
|
||||
if (window.canvasApp.executingAt !== 'Local') {
|
||||
thisObject.status = 'Restarting'
|
||||
await graphQlRestartSimulation(simulationParams)
|
||||
}
|
||||
thisObject.status = 'Calculating'
|
||||
counterTillNextState = 50
|
||||
} else {
|
||||
|
||||
@@ -94,7 +94,7 @@ function newStrategizerGateway () {
|
||||
}
|
||||
}
|
||||
|
||||
async function saveToStrategyzer () {
|
||||
async function saveToStrategyzer (simulationParams) {
|
||||
try {
|
||||
const accessToken = window.localStorage.getItem(LOGGED_IN_ACCESS_TOKEN_LOCAL_STORAGE_KEY)
|
||||
if (accessToken === null) {
|
||||
@@ -121,6 +121,7 @@ function newStrategizerGateway () {
|
||||
}
|
||||
|
||||
if (window.canvasApp.executingAt === 'Local') {
|
||||
tradingSystem.simulationParams = simulationParams
|
||||
callServer(JSON.stringify(tradingSystem), 'SaveDefinition', onSaved)
|
||||
function onSaved (err) {
|
||||
if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
|
||||
|
||||
Reference in new issue
Block a user