Add force-enter tag to entry form

This commit is contained in:
Matthias 2023-04-12 07:13:41 +02:00
parent ffb9219e79
commit a2e6be1be7
2 changed files with 20 additions and 1 deletions

View File

@ -87,7 +87,7 @@
</b-form-group>
<b-form-group
v-if="botStore.activeBot.botApiVersion > 1.1"
label="*OrderType"
label="OrderType"
label-for="ordertype-input"
invalid-feedback="OrderType"
:state="true"
@ -103,6 +103,18 @@
size="sm"
></b-form-radio-group>
</b-form-group>
<b-form-group
v-if="botStore.activeBot.botApiVersion > 1.16"
label="*Custom entry tag Optional]"
label-for="enterTag-input"
>
<b-form-input
id="enterTag-input"
v-model="enterTag"
type="text"
name="radios-btn-orderType"
></b-form-input>
</b-form-group>
</form>
</b-modal>
</template>
@ -128,6 +140,7 @@ const leverage = ref<number | undefined>(undefined);
const ordertype = ref('');
const orderSide = ref<OrderSides>(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;
}

View File

@ -9,6 +9,7 @@ export interface ForceEnterPayload {
price?: number;
ordertype?: string;
stakeamount?: number;
entry_tag?: string;
leverage?: number;
}