diff --git a/src/store/modules/ftbot/index.ts b/src/store/modules/ftbot/index.ts index 59baaf13..7dbcd8ec 100644 --- a/src/store/modules/ftbot/index.ts +++ b/src/store/modules/ftbot/index.ts @@ -195,6 +195,11 @@ export default { }, updateBacktestResult(state, backtestResult: BacktestResult) { state.backtestResult = backtestResult; + // TODO: Properly identify duplicates to avoid pushing the same multiple times + Object.entries(backtestResult.strategy).forEach(([key, strat]) => { + const xxx = `${key}_${strat.total_trades}_${strat.profit_total.toFixed(3)}`; + state.backtestHistory[xxx] = strat; + }); }, }, actions: { diff --git a/src/store/modules/ftbot/state.ts b/src/store/modules/ftbot/state.ts index 2b3112bf..8e88a4f1 100644 --- a/src/store/modules/ftbot/state.ts +++ b/src/store/modules/ftbot/state.ts @@ -44,6 +44,7 @@ export interface FtbotStateType { currentLocks?: LockResponse; backtestRunning: boolean; backtestResult?: BacktestResult; + backtestHistory: Record; } const state: FtbotStateType = { version: '', @@ -75,6 +76,7 @@ const state: FtbotStateType = { // backtesting backtestRunning: false, backtestResult: undefined, + backtestHistory: {}, }; export default state; diff --git a/src/views/Backtesting.vue b/src/views/Backtesting.vue index c1be0ee4..387aac70 100644 --- a/src/views/Backtesting.vue +++ b/src/views/Backtesting.vue @@ -144,6 +144,16 @@
+
+ + {{ key }} {{ strat.total_trades }} {{ formatPercent(strat.profit_total) }} + +
void; + formatPercent = formatPercent; + get canRunBacktest() { // TODO: Analyze if parameters and strategy has been selected. return true;