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">
|
2021-06-24 05:18:06 +00:00
|
|
|
<!-- <div v-if="isWebserverMode" class="mr-auto ml-3"> -->
|
|
|
|
<!-- Currently only available in Webserver mode -->
|
|
|
|
<!-- <b-checkbox v-model="historicView">HistoricData</b-checkbox> -->
|
|
|
|
<!-- </div> -->
|
2022-04-15 18:40:03 +00:00
|
|
|
<div v-if="isWebserverMode" class="mx-md-3 mt-2">
|
2021-05-24 12:37:39 +00:00
|
|
|
<div class="d-flex flex-wrap">
|
|
|
|
<div class="col-md-3 text-left">
|
|
|
|
<span>Strategy</span>
|
|
|
|
<StrategySelect v-model="strategy" class="mt-1"></StrategySelect>
|
2021-05-24 09:03:36 +00:00
|
|
|
</div>
|
2021-05-24 12:37:39 +00:00
|
|
|
<div class="col-md-3 text-left">
|
|
|
|
<span>Timeframe</span>
|
|
|
|
<TimeframeSelect v-model="selectedTimeframe" class="mt-1" />
|
|
|
|
</div>
|
|
|
|
<TimeRangeSelect v-model="timerange" class="col-12 col-md-5 mr-md-2"></TimeRangeSelect>
|
|
|
|
</div>
|
2020-07-11 15:25:28 +00:00
|
|
|
</div>
|
2020-07-02 05:01:24 +00:00
|
|
|
|
2021-06-22 19:08:03 +00:00
|
|
|
<div class="mx-2 mt-2 pb-1 h-100">
|
2020-09-14 17:56:43 +00:00
|
|
|
<CandleChartContainer
|
2022-04-15 18:40:03 +00:00
|
|
|
:available-pairs="isWebserverMode ? pairlist : whitelist"
|
|
|
|
:historic-view="isWebserverMode"
|
|
|
|
:timeframe="isWebserverMode ? selectedTimeframe : timeframe"
|
2020-09-14 17:56:43 +00:00
|
|
|
:trades="trades"
|
2022-04-15 18:40:03 +00:00
|
|
|
:timerange="isWebserverMode ? timerange : ''"
|
|
|
|
:strategy="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>
|
|
|
|
|
2020-06-22 06:05:03 +00:00
|
|
|
<script lang="ts">
|
2020-08-08 13:38:47 +00:00
|
|
|
import CandleChartContainer from '@/components/charts/CandleChartContainer.vue';
|
2020-07-11 17:55:47 +00:00
|
|
|
import TimeRangeSelect from '@/components/ftbot/TimeRangeSelect.vue';
|
2021-05-23 14:57:39 +00:00
|
|
|
import TimeframeSelect from '@/components/ftbot/TimeframeSelect.vue';
|
2021-05-24 09:13:11 +00:00
|
|
|
import StrategySelect from '@/components/ftbot/StrategySelect.vue';
|
2020-09-30 05:48:36 +00:00
|
|
|
import { BotStoreGetters } from '@/store/modules/ftbot';
|
2021-12-20 19:12:57 +00:00
|
|
|
import StoreModules from '@/store/storeSubModules';
|
2022-04-15 18:40:03 +00:00
|
|
|
import { defineComponent, onMounted, ref } from '@vue/composition-api';
|
|
|
|
import { useNamespacedActions, useNamespacedGetters } from 'vuex-composition-helpers';
|
2020-06-17 18:38:25 +00:00
|
|
|
|
2022-04-15 18:40:03 +00:00
|
|
|
export default defineComponent({
|
|
|
|
name: 'Graphs',
|
2021-05-24 09:13:11 +00:00
|
|
|
components: { CandleChartContainer, StrategySelect, TimeRangeSelect, TimeframeSelect },
|
2022-04-15 18:40:03 +00:00
|
|
|
setup() {
|
|
|
|
const strategy = ref('');
|
|
|
|
const timerange = ref('');
|
|
|
|
const selectedTimeframe = ref('');
|
|
|
|
const { pairlist, whitelist, trades, timeframe, isWebserverMode } = useNamespacedGetters(
|
|
|
|
StoreModules.ftbot,
|
|
|
|
[
|
|
|
|
BotStoreGetters.pairlist,
|
|
|
|
BotStoreGetters.whitelist,
|
|
|
|
BotStoreGetters.trades,
|
|
|
|
BotStoreGetters.timeframe,
|
|
|
|
BotStoreGetters.isWebserverMode,
|
|
|
|
],
|
|
|
|
);
|
|
|
|
|
|
|
|
const { getWhitelist, getAvailablePairs } = useNamespacedActions(StoreModules.ftbot, [
|
|
|
|
'getWhitelist',
|
|
|
|
'getAvailablePairs',
|
|
|
|
]);
|
|
|
|
onMounted(() => {
|
|
|
|
if (!whitelist.value || whitelist.value.length === 0) {
|
|
|
|
getWhitelist();
|
|
|
|
}
|
|
|
|
console.log(isWebserverMode.value);
|
|
|
|
if (isWebserverMode.value) {
|
|
|
|
// this.refresh();
|
|
|
|
getAvailablePairs({ timeframe: timeframe.value });
|
|
|
|
// .then((val) => {
|
|
|
|
// console.log(val);
|
|
|
|
// });
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return {
|
|
|
|
pairlist,
|
|
|
|
whitelist,
|
|
|
|
trades,
|
|
|
|
timeframe,
|
|
|
|
isWebserverMode,
|
|
|
|
getWhitelist,
|
|
|
|
getAvailablePairs,
|
|
|
|
strategy,
|
|
|
|
timerange,
|
|
|
|
selectedTimeframe,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
});
|
2020-06-17 18:38:25 +00:00
|
|
|
</script>
|
|
|
|
|
2021-03-19 07:43:32 +00:00
|
|
|
<style scoped></style>
|