mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-11 02:33:51 +00:00
Improve backtesting ui
This commit is contained in:
parent
7758d2f7c3
commit
18e9cfd240
|
@ -3,6 +3,8 @@ import { Trade } from './trades';
|
||||||
export interface BacktestPayload {
|
export interface BacktestPayload {
|
||||||
strategy: string;
|
strategy: string;
|
||||||
timerange: string;
|
timerange: string;
|
||||||
|
max_open_trades?: number;
|
||||||
|
stake_amount?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PairResult {
|
export interface PairResult {
|
||||||
|
|
|
@ -71,6 +71,7 @@
|
||||||
>
|
>
|
||||||
<b-form-input
|
<b-form-input
|
||||||
id="max-open-trades"
|
id="max-open-trades"
|
||||||
|
v-model="maxOpenTrades"
|
||||||
placeholder="Use strategy default"
|
placeholder="Use strategy default"
|
||||||
type="number"
|
type="number"
|
||||||
></b-form-input>
|
></b-form-input>
|
||||||
|
@ -84,20 +85,21 @@
|
||||||
>
|
>
|
||||||
<b-form-input
|
<b-form-input
|
||||||
id="stake-amount"
|
id="stake-amount"
|
||||||
|
v-model="stakeAmount"
|
||||||
type="number"
|
type="number"
|
||||||
placeholder="Use strategy default"
|
placeholder="Use strategy default"
|
||||||
step="0.01"
|
step="0.01"
|
||||||
></b-form-input>
|
></b-form-input>
|
||||||
</b-form-group>
|
</b-form-group>
|
||||||
|
|
||||||
<b-form-group label-cols-sm="5" label="Fee:" label-align-sm="right" label-for="fee">
|
<!-- <b-form-group label-cols-sm="5" label="Fee:" label-align-sm="right" label-for="fee">
|
||||||
<b-form-input
|
<b-form-input
|
||||||
id="fee"
|
id="fee"
|
||||||
type="number"
|
type="number"
|
||||||
placeholder="Use exchange default"
|
placeholder="Use exchange default"
|
||||||
step="0.01"
|
step="0.01"
|
||||||
></b-form-input>
|
></b-form-input>
|
||||||
</b-form-group>
|
</b-form-group> -->
|
||||||
</b-form-group>
|
</b-form-group>
|
||||||
</b-card>
|
</b-card>
|
||||||
</div>
|
</div>
|
||||||
|
@ -231,6 +233,10 @@ export default class Backtesting extends Vue {
|
||||||
|
|
||||||
timerange = '';
|
timerange = '';
|
||||||
|
|
||||||
|
maxOpenTrades = '';
|
||||||
|
|
||||||
|
stakeAmount = '';
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
@ftbot.Action startBacktest!: (payload: BacktestPayload) => void;
|
@ftbot.Action startBacktest!: (payload: BacktestPayload) => void;
|
||||||
|
|
||||||
|
@ -265,6 +271,15 @@ export default class Backtesting extends Vue {
|
||||||
strategy: this.strategy,
|
strategy: this.strategy,
|
||||||
timerange: this.timerange,
|
timerange: this.timerange,
|
||||||
};
|
};
|
||||||
|
if (this.maxOpenTrades && Number.isSafeInteger(this.maxOpenTrades)) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||||
|
btPayload.max_open_trades = parseInt(this.maxOpenTrades, 10);
|
||||||
|
}
|
||||||
|
if (this.stakeAmount && Number.isSafeInteger(this.stakeAmount)) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||||
|
btPayload.stake_amount = Number(this.stakeAmount);
|
||||||
|
}
|
||||||
|
|
||||||
this.startBacktest(btPayload);
|
this.startBacktest(btPayload);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user