Add cumprofit to backtesting

This commit is contained in:
Matthias 2020-11-01 13:58:16 +01:00
parent 751cf34017
commit 3e0c34222a

View File

@ -24,6 +24,14 @@
:disabled="!hasBacktestResult" :disabled="!hasBacktestResult"
>Analyze result</b-form-radio >Analyze result</b-form-radio
> >
<b-form-radio
v-model="btFormMode"
name="bt-form-radios"
button
value="visualize-summary"
:disabled="!hasBacktestResult"
>Visualize summary</b-form-radio
>
<b-form-radio <b-form-radio
v-model="btFormMode" v-model="btFormMode"
name="bt-form-radios" name="bt-form-radios"
@ -122,6 +130,16 @@
<div v-if="hasBacktestResult && btFormMode == 'results'" class="text-center w-100 mt-2"> <div v-if="hasBacktestResult && btFormMode == 'results'" class="text-center w-100 mt-2">
<BacktestResultView :strategy="strategy" :backtest-result="selectedBacktestResult" /> <BacktestResultView :strategy="strategy" :backtest-result="selectedBacktestResult" />
</div> </div>
<div
v-if="hasBacktestResult && btFormMode == 'visualize-summary'"
class="text-center w-100 mt-2 cum-profit-container"
>
<CumProfitChart
:trades="selectedBacktestResult.trades"
profit-column="profit_abs"
:show-title="true"
/>
</div>
<div v-if="hasBacktestResult && btFormMode == 'visualize'" class="text-center w-100 mt-2"> <div v-if="hasBacktestResult && btFormMode == 'visualize'" class="text-center w-100 mt-2">
<CandleChartContainer <CandleChartContainer
:available-pairs="selectedBacktestResult.pairlist" :available-pairs="selectedBacktestResult.pairlist"
@ -146,6 +164,7 @@ import BacktestResultView from '@/components/ftbot/BacktestResultView.vue';
import CandleChartContainer from '@/components/charts/CandleChartContainer.vue'; import CandleChartContainer from '@/components/charts/CandleChartContainer.vue';
import StrategyList from '@/components/ftbot/StrategyList.vue'; import StrategyList from '@/components/ftbot/StrategyList.vue';
import ValuePair from '@/components/ftbot/ValuePair.vue'; import ValuePair from '@/components/ftbot/ValuePair.vue';
import CumProfitChart from '@/components/charts/CumProfitChart.vue';
import { import {
BacktestPayload, BacktestPayload,
@ -163,6 +182,7 @@ const ftbot = namespace('ftbot');
BacktestResultView, BacktestResultView,
TimeRangeSelect, TimeRangeSelect,
CandleChartContainer, CandleChartContainer,
CumProfitChart,
StrategyList, StrategyList,
ValuePair, ValuePair,
}, },
@ -260,4 +280,7 @@ export default class Backtesting extends Vue {
.candle-chart-container { .candle-chart-container {
height: 640px !important; height: 640px !important;
} }
.cum-profit-container {
height: 640px !important;
}
</style> </style>