diff --git a/src/components/ftbot/DownloadDataMain.vue b/src/components/ftbot/DownloadDataMain.vue index af11f091..5ec00b45 100644 --- a/src/components/ftbot/DownloadDataMain.vue +++ b/src/components/ftbot/DownloadDataMain.vue @@ -5,6 +5,12 @@ const botStore = useBotStore(); const pairs = ref(['XRP/USDT', 'BTC/USDT']); const timeframes = ref(['5m', '1h']); +const timeSelection = ref({ + useCustomTimerange: false, + timerange: '', + days: 30, +}); + const { pairTemplates } = usePairTemplates(); const exchange = ref<{ @@ -35,9 +41,15 @@ async function startDownload() { const payload: DownloadDataPayload = { pairs: pairs.value.filter((pair) => pair !== ''), timeframes: timeframes.value.filter((tf) => tf !== ''), - timerange: '20240101-', }; + // Add either timerange or days to the payload + if (timeSelection.value.useCustomTimerange && timeSelection.value.timerange) { + payload.timerange = timeSelection.value.timerange; + } else { + payload.days = timeSelection.value.days; + } + // Include advanced options only if the section is open if (isAdvancedOpen.value) { payload.erase = erase.value; @@ -56,9 +68,9 @@ async function startDownload() {