2020-06-17 18:38:25 +00:00
|
|
|
<template>
|
2021-03-19 07:43:32 +00:00
|
|
|
<div class="d-flex flex-column h-100">
|
2022-11-18 18:48:15 +00:00
|
|
|
<!-- <div v-if="isWebserverMode" class="me-auto ms-3"> -->
|
2021-06-24 05:18:06 +00:00
|
|
|
<!-- Currently only available in Webserver mode -->
|
2022-10-30 10:15:40 +00:00
|
|
|
<!-- <b-form-checkbox v-model="historicView">HistoricData</b-form-checkbox> -->
|
2021-06-24 05:18:06 +00:00
|
|
|
<!-- </div> -->
|
2022-04-18 11:43:55 +00:00
|
|
|
<div v-if="botStore.activeBot.isWebserverMode" class="mx-md-3 mt-2">
|
2023-12-17 14:56:23 +00:00
|
|
|
<div class="d-flex flex-wrap mx-1 gap-1 gap-md-2">
|
2023-12-18 18:19:19 +00:00
|
|
|
<div class="col-12 col-md-3 text-start me-md-1">
|
2021-05-24 12:37:39 +00:00
|
|
|
<span>Strategy</span>
|
|
|
|
<StrategySelect v-model="strategy" class="mt-1"></StrategySelect>
|
2021-05-24 09:03:36 +00:00
|
|
|
</div>
|
2023-12-18 18:19:19 +00:00
|
|
|
<div class="col-12 col-md-3 text-start">
|
2021-05-24 12:37:39 +00:00
|
|
|
<span>Timeframe</span>
|
|
|
|
<TimeframeSelect v-model="selectedTimeframe" class="mt-1" />
|
|
|
|
</div>
|
2023-12-17 14:56:23 +00:00
|
|
|
<TimeRangeSelect v-model="timerange"></TimeRangeSelect>
|
2021-05-24 12:37:39 +00:00
|
|
|
</div>
|
2020-07-11 15:25:28 +00:00
|
|
|
</div>
|
2020-07-02 05:01:24 +00:00
|
|
|
|
2023-12-17 15:01:28 +00:00
|
|
|
<div class="mx-md-2 mt-2 pb-1 h-100">
|
2020-09-14 17:56:43 +00:00
|
|
|
<CandleChartContainer
|
2023-12-17 14:40:03 +00:00
|
|
|
:available-pairs="availablePairs"
|
2022-04-18 11:43:55 +00:00
|
|
|
:historic-view="botStore.activeBot.isWebserverMode"
|
2023-12-17 14:40:03 +00:00
|
|
|
:timeframe="finalTimeframe"
|
2022-04-18 11:43:55 +00:00
|
|
|
:trades="botStore.activeBot.trades"
|
|
|
|
:timerange="botStore.activeBot.isWebserverMode ? timerange : ''"
|
|
|
|
:strategy="botStore.activeBot.isWebserverMode ? strategy : ''"
|
2021-06-22 19:08:03 +00:00
|
|
|
:plot-config-modal="false"
|
2020-09-14 17:56:43 +00:00
|
|
|
>
|
2020-08-08 13:37:18 +00:00
|
|
|
</CandleChartContainer>
|
2020-06-20 06:52:43 +00:00
|
|
|
</div>
|
2020-06-17 18:38:25 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2023-04-13 04:36:41 +00:00
|
|
|
<script setup lang="ts">
|
2022-04-18 11:43:55 +00:00
|
|
|
import { useBotStore } from '@/stores/ftbotwrapper';
|
2020-06-17 18:38:25 +00:00
|
|
|
|
2023-04-13 04:36:41 +00:00
|
|
|
const botStore = useBotStore();
|
|
|
|
const strategy = ref('');
|
|
|
|
const timerange = ref('');
|
|
|
|
const selectedTimeframe = ref('');
|
2022-04-15 18:40:03 +00:00
|
|
|
|
2023-12-17 14:40:03 +00:00
|
|
|
const finalTimeframe = computed<string>(() => {
|
|
|
|
return botStore.activeBot.isWebserverMode
|
|
|
|
? selectedTimeframe.value || botStore.activeBot.strategy.timeframe || ''
|
|
|
|
: botStore.activeBot.timeframe;
|
|
|
|
});
|
|
|
|
|
|
|
|
const availablePairs = computed<string[]>(() => {
|
|
|
|
if (botStore.activeBot.isWebserverMode) {
|
|
|
|
if (finalTimeframe.value && finalTimeframe.value !== '') {
|
|
|
|
const tf = finalTimeframe.value;
|
|
|
|
return botStore.activeBot.pairlistWithTimeframe
|
2024-04-25 13:27:45 +00:00
|
|
|
.filter(([_, timeframe]) => {
|
2024-03-07 05:25:01 +00:00
|
|
|
// console.log(pair, timeframe, tf);
|
2023-12-17 14:40:03 +00:00
|
|
|
return timeframe === tf;
|
|
|
|
})
|
|
|
|
.map(([pair]) => pair);
|
|
|
|
}
|
|
|
|
return botStore.activeBot.pairlist;
|
|
|
|
}
|
|
|
|
return botStore.activeBot.whitelist;
|
|
|
|
});
|
|
|
|
|
2023-04-13 04:36:41 +00:00
|
|
|
onMounted(() => {
|
|
|
|
if (botStore.activeBot.isWebserverMode) {
|
|
|
|
// this.refresh();
|
|
|
|
botStore.activeBot.getAvailablePairs({ timeframe: botStore.activeBot.timeframe });
|
|
|
|
// .then((val) => {
|
|
|
|
// console.log(val);
|
|
|
|
// });
|
|
|
|
} else if (!botStore.activeBot.whitelist || botStore.activeBot.whitelist.length === 0) {
|
|
|
|
botStore.activeBot.getWhitelist();
|
|
|
|
}
|
2022-04-15 18:40:03 +00:00
|
|
|
});
|
2020-06-17 18:38:25 +00:00
|
|
|
</script>
|
|
|
|
|
2021-03-19 07:43:32 +00:00
|
|
|
<style scoped></style>
|