2022-04-21 17:36:12 +00:00
|
|
|
forceexit
|
2020-05-06 04:38:57 +00:00
|
|
|
<template>
|
2021-08-30 17:57:42 +00:00
|
|
|
<div>
|
|
|
|
<button
|
2022-11-18 18:48:15 +00:00
|
|
|
class="btn btn-secondary btn-sm ms-1"
|
2022-04-19 04:53:35 +00:00
|
|
|
:disabled="!botStore.activeBot.isTrading || isRunning"
|
2021-08-30 17:57:42 +00:00
|
|
|
title="Start Trading"
|
2022-04-26 20:00:21 +00:00
|
|
|
@click="botStore.activeBot.startBot()"
|
2021-08-30 17:57:42 +00:00
|
|
|
>
|
2023-05-09 16:25:28 +00:00
|
|
|
<i-mdi-play height="24" width="24" />
|
2021-08-30 17:57:42 +00:00
|
|
|
</button>
|
|
|
|
<button
|
2022-11-18 18:48:15 +00:00
|
|
|
class="btn btn-secondary btn-sm ms-1"
|
2022-04-19 04:53:35 +00:00
|
|
|
:disabled="!botStore.activeBot.isTrading || !isRunning"
|
2021-08-30 17:57:42 +00:00
|
|
|
title="Stop Trading - Also stops handling open trades."
|
|
|
|
@click="handleStopBot()"
|
|
|
|
>
|
2023-05-09 16:25:28 +00:00
|
|
|
<i-mdi-stop height="24" width="24" />
|
2021-08-30 17:57:42 +00:00
|
|
|
</button>
|
|
|
|
<button
|
2022-11-18 18:48:15 +00:00
|
|
|
class="btn btn-secondary btn-sm ms-1"
|
2022-04-19 04:53:35 +00:00
|
|
|
:disabled="!botStore.activeBot.isTrading || !isRunning"
|
2021-08-30 17:57:42 +00:00
|
|
|
title="StopBuy - Stops buying, but still handles open trades"
|
|
|
|
@click="handleStopBuy()"
|
|
|
|
>
|
2023-05-09 16:25:28 +00:00
|
|
|
<i-mdi-pause height="24" width="24" />
|
2021-08-30 17:57:42 +00:00
|
|
|
</button>
|
|
|
|
<button
|
2022-11-18 18:48:15 +00:00
|
|
|
class="btn btn-secondary btn-sm ms-1"
|
2022-04-19 04:53:35 +00:00
|
|
|
:disabled="!botStore.activeBot.isTrading"
|
2021-08-30 17:57:42 +00:00
|
|
|
title="Reload Config - reloads configuration including strategy, resetting all settings changed on the fly."
|
|
|
|
@click="handleReloadConfig()"
|
|
|
|
>
|
2023-05-09 16:25:28 +00:00
|
|
|
<i-mdi-reload height="24" width="24" />
|
2021-08-30 17:57:42 +00:00
|
|
|
</button>
|
2022-01-22 12:04:12 +00:00
|
|
|
<button
|
2022-11-18 18:48:15 +00:00
|
|
|
class="btn btn-secondary btn-sm ms-1"
|
2022-04-19 04:53:35 +00:00
|
|
|
:disabled="!botStore.activeBot.isTrading"
|
2022-04-21 17:36:12 +00:00
|
|
|
title="Force exit all"
|
|
|
|
@click="handleForceExit()"
|
2022-01-22 12:04:12 +00:00
|
|
|
>
|
2023-05-09 16:25:28 +00:00
|
|
|
<i-mdi-close-box-multiple height="24" width="24" />
|
2022-01-22 12:04:12 +00:00
|
|
|
</button>
|
2021-08-30 17:57:42 +00:00
|
|
|
<button
|
2023-04-22 16:29:36 +00:00
|
|
|
v-if="botStore.activeBot.botState && botStore.activeBot.botState.force_entry_enable"
|
2022-11-18 18:48:15 +00:00
|
|
|
class="btn btn-secondary btn-sm ms-1"
|
2022-04-19 04:53:35 +00:00
|
|
|
:disabled="!botStore.activeBot.isTrading || !isRunning"
|
2022-04-21 17:36:12 +00:00
|
|
|
title="Force enter - Immediately enter a trade at an optional price. Exits are then handled according to strategy rules."
|
2022-11-19 09:53:04 +00:00
|
|
|
@click="forceEnter = true"
|
2021-08-30 17:57:42 +00:00
|
|
|
>
|
2023-05-09 16:25:28 +00:00
|
|
|
<i-mdi-plus-box-multiple-outline style="font-size: 20px" />
|
2021-08-30 17:57:42 +00:00
|
|
|
</button>
|
|
|
|
<button
|
2022-04-19 04:53:35 +00:00
|
|
|
v-if="botStore.activeBot.isWebserverMode && false"
|
2022-04-28 17:21:30 +00:00
|
|
|
:disabled="botStore.activeBot.isTrading"
|
2022-11-18 18:48:15 +00:00
|
|
|
class="btn btn-secondary btn-sm ms-1"
|
2021-08-30 17:57:42 +00:00
|
|
|
title="Start Trading mode"
|
2022-04-26 20:00:21 +00:00
|
|
|
@click="botStore.activeBot.startTrade()"
|
2021-08-30 17:57:42 +00:00
|
|
|
>
|
2023-05-09 16:25:28 +00:00
|
|
|
<i-mdi-play class="fs-4" />
|
2021-08-30 17:57:42 +00:00
|
|
|
</button>
|
2022-11-19 09:53:04 +00:00
|
|
|
<ForceEntryForm v-model="forceEnter" :pair="botStore.activeBot.selectedPair" />
|
2022-12-03 07:24:51 +00:00
|
|
|
<MessageBox ref="msgBox" />
|
2020-05-06 04:38:57 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2023-05-09 18:04:57 +00:00
|
|
|
<script setup lang="ts">
|
2022-12-03 07:24:51 +00:00
|
|
|
import MessageBox, { MsgBoxObject } from '@/components/general/MessageBox.vue';
|
2022-04-19 04:53:35 +00:00
|
|
|
import { useBotStore } from '@/stores/ftbotwrapper';
|
2023-05-09 04:49:13 +00:00
|
|
|
import { ForceSellPayload } from '@/types';
|
|
|
|
|
|
|
|
import ForceEntryForm from './ForceEntryForm.vue';
|
2020-05-06 04:38:57 +00:00
|
|
|
|
2023-05-09 18:04:57 +00:00
|
|
|
const botStore = useBotStore();
|
|
|
|
const forceEnter = ref<boolean>(false);
|
|
|
|
const msgBox = ref<typeof MessageBox>();
|
2022-04-16 05:43:26 +00:00
|
|
|
|
2023-05-09 18:04:57 +00:00
|
|
|
const isRunning = computed((): boolean => {
|
|
|
|
return botStore.activeBot.botState?.state === 'running';
|
|
|
|
});
|
2021-07-01 19:02:51 +00:00
|
|
|
|
2023-05-09 18:04:57 +00:00
|
|
|
const handleStopBot = () => {
|
|
|
|
const msg: MsgBoxObject = {
|
|
|
|
title: 'Stop Bot',
|
|
|
|
message: 'Stop the bot loop from running?',
|
|
|
|
accept: () => {
|
|
|
|
botStore.activeBot.stopBot();
|
|
|
|
},
|
|
|
|
};
|
|
|
|
msgBox.value?.show(msg);
|
|
|
|
};
|
2022-04-16 05:43:26 +00:00
|
|
|
|
2023-05-09 18:04:57 +00:00
|
|
|
const handleStopBuy = () => {
|
|
|
|
const msg: MsgBoxObject = {
|
|
|
|
title: 'Stop Buying',
|
|
|
|
message: 'Freqtrade will continue to handle open trades.',
|
|
|
|
accept: () => {
|
|
|
|
botStore.activeBot.stopBuy();
|
|
|
|
},
|
|
|
|
};
|
|
|
|
msgBox.value?.show(msg);
|
|
|
|
};
|
2022-04-16 05:43:26 +00:00
|
|
|
|
2023-05-09 18:04:57 +00:00
|
|
|
const handleReloadConfig = () => {
|
|
|
|
const msg: MsgBoxObject = {
|
|
|
|
title: 'Reload',
|
|
|
|
message: 'Reload configuration (including strategy)?',
|
|
|
|
accept: () => {
|
|
|
|
console.log('reload...');
|
|
|
|
botStore.activeBot.reloadConfig();
|
|
|
|
},
|
|
|
|
};
|
|
|
|
msgBox.value?.show(msg);
|
|
|
|
};
|
2022-01-22 12:04:12 +00:00
|
|
|
|
2023-05-09 18:04:57 +00:00
|
|
|
const handleForceExit = () => {
|
|
|
|
const msg: MsgBoxObject = {
|
|
|
|
title: 'ForceExit all',
|
|
|
|
message: 'Really forceexit ALL trades?',
|
|
|
|
accept: () => {
|
|
|
|
const payload: ForceSellPayload = {
|
|
|
|
tradeid: 'all',
|
|
|
|
// TODO: support ordertype (?)
|
2022-12-03 07:24:51 +00:00
|
|
|
};
|
2023-05-09 18:04:57 +00:00
|
|
|
botStore.activeBot.forceexit(payload);
|
|
|
|
},
|
|
|
|
};
|
|
|
|
msgBox.value?.show(msg);
|
|
|
|
};
|
2020-05-06 04:38:57 +00:00
|
|
|
</script>
|