diff --git a/src/store/modules/ftbot/index.ts b/src/store/modules/ftbot/index.ts index 9d57fba0..59baaf13 100644 --- a/src/store/modules/ftbot/index.ts +++ b/src/store/modules/ftbot/index.ts @@ -591,7 +591,18 @@ export default { const result = await api.get('/backtest'); commit('updateBacktestRunning', result.data.running); if (result.data.running === false && result.data.backtest_result) { - commit('updateBacktestResult', result.data.backtest_result); + // TODO: This should be aligned in the backend, which would allow us to remove this whole block + const backtestresult = result.data.backtest_result; + for (let i = 0, len = backtestresult.strategy_comparison.length; i < len; i += 1) { + const { key } = backtestresult.strategy_comparison[i]; + for (let j = 0, len = backtestresult.strategy[key].trades.length; j < len; j += 1) { + // eslint-disable-next-line @typescript-eslint/camelcase + backtestresult.strategy[key].trades[j].profit_ratio = + backtestresult.strategy[key].trades[j].profit_percent; + } + } + + commit('updateBacktestResult', backtestresult); } }, async removeBacktest({ commit }) { diff --git a/src/views/Backtesting.vue b/src/views/Backtesting.vue index fc961f8b..a1242a9f 100644 --- a/src/views/Backtesting.vue +++ b/src/views/Backtesting.vue @@ -133,7 +133,15 @@ :show-title="true" /> -