From a2e6be1be7836d015108ac449e8dfa777214407b Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 12 Apr 2023 07:13:41 +0200 Subject: [PATCH] Add force-enter tag to entry form --- src/components/ftbot/ForceEntryForm.vue | 20 +++++++++++++++++++- src/types/types.ts | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/components/ftbot/ForceEntryForm.vue b/src/components/ftbot/ForceEntryForm.vue index 53e9d66f..81249bf3 100644 --- a/src/components/ftbot/ForceEntryForm.vue +++ b/src/components/ftbot/ForceEntryForm.vue @@ -87,7 +87,7 @@ + + + @@ -128,6 +140,7 @@ const leverage = ref(undefined); const ordertype = ref(''); const orderSide = ref(OrderSides.long); +const enterTag = ref('force_entry'); const orderTypeOptions = [ { value: 'market', text: 'Market' }, @@ -173,6 +186,11 @@ const handleSubmit = async () => { if (botStore.activeBot.botApiVersion >= 2.13 && botStore.activeBot.shortAllowed) { payload.side = orderSide.value; } + if (botStore.activeBot.botApiVersion >= 2.16 && enterTag.value) { + // eslint-disable-next-line @typescript-eslint/camelcase + payload.entry_tag = enterTag.value; + } + if (leverage.value) { payload.leverage = leverage.value; } diff --git a/src/types/types.ts b/src/types/types.ts index d289912a..e51a3186 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -9,6 +9,7 @@ export interface ForceEnterPayload { price?: number; ordertype?: string; stakeamount?: number; + entry_tag?: string; leverage?: number; }