mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-26 13:05:15 +00:00
Add leverage to forceentry field
This commit is contained in:
parent
b09189f0c1
commit
4a8b304802
|
@ -58,6 +58,20 @@
|
|||
@keydown.enter.native="handleEntry"
|
||||
></b-form-input>
|
||||
</b-form-group>
|
||||
<b-form-group
|
||||
v-if="botStore.activeBot.botApiVersion > 2.16 && botStore.activeBot.shortAllowed"
|
||||
:label="`*Leverage to apply [optional]`"
|
||||
label-for="leverage-input"
|
||||
invalid-feedback="Leverage must be empty or a positive number"
|
||||
>
|
||||
<b-form-input
|
||||
id="leverage-input"
|
||||
v-model="leverage"
|
||||
type="number"
|
||||
step="1"
|
||||
@keydown.enter.native="handleEntry"
|
||||
></b-form-input>
|
||||
</b-form-group>
|
||||
<b-form-group
|
||||
v-if="botStore.activeBot.botApiVersion > 1.1"
|
||||
label="*OrderType"
|
||||
|
@ -94,6 +108,8 @@ export default defineComponent({
|
|||
const pair = ref('');
|
||||
const price = ref<number | null>(null);
|
||||
const stakeAmount = ref<number | null>(null);
|
||||
const leverage = ref<number | null>(null);
|
||||
|
||||
const ordertype = ref('');
|
||||
const orderSide = ref<OrderSides>(OrderSides.long);
|
||||
|
||||
|
@ -122,6 +138,9 @@ export default defineComponent({
|
|||
if (botStore.activeBot.botApiVersion >= 2.13 && botStore.activeBot.shortAllowed) {
|
||||
payload.side = orderSide.value;
|
||||
}
|
||||
if (leverage.value) {
|
||||
payload.leverage = leverage.value;
|
||||
}
|
||||
botStore.activeBot.forceentry(payload);
|
||||
nextTick(() => {
|
||||
root?.proxy.$bvModal.hide('forceentry-modal');
|
||||
|
@ -159,6 +178,7 @@ export default defineComponent({
|
|||
stakeAmount,
|
||||
ordertype,
|
||||
orderSide,
|
||||
leverage,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
|
@ -9,6 +9,7 @@ export interface ForceEnterPayload {
|
|||
price?: number;
|
||||
ordertype?: string;
|
||||
stakeamount?: number;
|
||||
leverage?: number;
|
||||
}
|
||||
|
||||
export interface ForceSellPayload {
|
||||
|
|
Loading…
Reference in New Issue
Block a user