fix trade context overrides in executeTrades()

This commit is contained in:
woodser 2023-03-08 15:36:33 -05:00
parent 2c07e82668
commit 86b41b87e9

View File

@ -1874,7 +1874,7 @@ async function executeTrades(ctxs: TradeContext[], executionCtx?: TradeContext):
// assign default execution context // assign default execution context
if (!executionCtx) executionCtx = {}; if (!executionCtx) executionCtx = {};
if (executionCtx.concurrentTrades === undefined) executionCtx.concurrentTrades = ctxs.length > 1; if (executionCtx.concurrentTrades === undefined) executionCtx.concurrentTrades = ctxs.length > 1;
Object.assign(executionCtx, TestConfig.trade, executionCtx); Object.assign(executionCtx, TestConfig.trade, Object.assign({}, executionCtx));
// start mining if executing trades concurrently // start mining if executing trades concurrently
let miningStarted = executionCtx.concurrentTrades && await startMining(); let miningStarted = executionCtx.concurrentTrades && await startMining();