More backtesting refs to btStore

This commit is contained in:
Matthias 2023-07-22 11:19:18 +02:00
parent 2d3f1c7391
commit 68171faf8d
2 changed files with 7 additions and 7 deletions

View File

@ -11,6 +11,8 @@ export const useBtStore = defineStore('btStore', {
stakeAmount: '', stakeAmount: '',
startingCapital: '', startingCapital: '',
allowCache: true, allowCache: true,
enableProtections: false,
stakeAmountUnlimited: false,
freqAI: { freqAI: {
enabled: false, enabled: false,
model: '', model: '',

View File

@ -167,7 +167,7 @@
<div class="d-flex"> <div class="d-flex">
<b-form-checkbox <b-form-checkbox
id="stake-amount-bool" id="stake-amount-bool"
v-model="stakeAmountUnlimited" v-model="btStore.stakeAmountUnlimited"
class="col-md-6" class="col-md-6"
>Unlimited stake</b-form-checkbox >Unlimited stake</b-form-checkbox
> >
@ -178,7 +178,7 @@
type="number" type="number"
placeholder="Use strategy default" placeholder="Use strategy default"
step="0.01" step="0.01"
:disabled="stakeAmountUnlimited" :disabled="btStore.stakeAmountUnlimited"
></b-form-input> ></b-form-input>
</div> </div>
</b-form-group> </b-form-group>
@ -191,7 +191,7 @@
> >
<b-form-checkbox <b-form-checkbox
id="enable-protections" id="enable-protections"
v-model="enableProtections" v-model="btStore.enableProtections"
></b-form-checkbox> ></b-form-checkbox>
</b-form-group> </b-form-group>
<b-form-group <b-form-group
@ -365,8 +365,6 @@ const timeframe = computed((): string => {
const showLeftBar = ref(false); const showLeftBar = ref(false);
const enableProtections = ref(false);
const stakeAmountUnlimited = ref(false);
const btFormMode = ref('run'); const btFormMode = ref('run');
const pollInterval = ref<number | null>(null); const pollInterval = ref<number | null>(null);
@ -392,13 +390,13 @@ const clickBacktest = () => {
const btPayload: BacktestPayload = { const btPayload: BacktestPayload = {
strategy: btStore.strategy, strategy: btStore.strategy,
timerange: btStore.timerange, timerange: btStore.timerange,
enable_protections: enableProtections.value, enable_protections: btStore.enableProtections,
}; };
const openTradesInt = parseInt(btStore.maxOpenTrades, 10); const openTradesInt = parseInt(btStore.maxOpenTrades, 10);
if (openTradesInt) { if (openTradesInt) {
btPayload.max_open_trades = openTradesInt; btPayload.max_open_trades = openTradesInt;
} }
if (stakeAmountUnlimited.value) { if (btStore.stakeAmountUnlimited) {
btPayload.stake_amount = 'unlimited'; btPayload.stake_amount = 'unlimited';
} else { } else {
const stakeAmountLoc = Number(btStore.stakeAmount); const stakeAmountLoc = Number(btStore.stakeAmount);