Fix bug in parameter parsing for backtesting

This commit is contained in:
Matthias 2021-01-06 13:13:10 +01:00
parent edcd3ff62b
commit a7bae84c2b

View File

@ -280,13 +280,15 @@ export default class Backtesting extends Vue {
strategy: this.strategy,
timerange: this.timerange,
};
if (this.maxOpenTrades && Number.isSafeInteger(this.maxOpenTrades)) {
const openTradesInt = parseInt(this.maxOpenTrades, 10);
if (openTradesInt) {
// eslint-disable-next-line @typescript-eslint/camelcase
btPayload.max_open_trades = parseInt(this.maxOpenTrades, 10);
btPayload.max_open_trades = openTradesInt;
}
if (this.stakeAmount && Number.isSafeInteger(this.stakeAmount)) {
const stakeAmountInt = Number(this.stakeAmount);
if (stakeAmountInt) {
// eslint-disable-next-line @typescript-eslint/camelcase
btPayload.stake_amount = Number(this.stakeAmount);
btPayload.stake_amount = stakeAmountInt;
}
if (this.selectedTimeframe) {
btPayload.timeframe = this.selectedTimeframe;