mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-23 19:45:15 +00:00
Show botcontrols only when the bot is trading
This commit is contained in:
parent
1aa15cb18d
commit
554f64e91e
|
@ -1,15 +1,30 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<button class="btn btn-primary btn-sm col-md-5 m-1" @click="startBot()">Start</button>
|
<button
|
||||||
<button class="btn btn-primary btn-sm col-md-5 m-1" @click="stopBot()">Stop</button>
|
class="btn btn-primary btn-sm col-md-5 m-1"
|
||||||
<button class="btn btn-primary btn-sm col-md-5 m-1" @click="stopBuy()">StopBuy</button>
|
:disabled="!isTrading"
|
||||||
<button class="btn btn-primary btn-sm col-md-5 m-1" @click="reloadConfig()">
|
@click="startBot()"
|
||||||
|
>
|
||||||
|
Start
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-primary btn-sm col-md-5 m-1" :disabled="!isTrading" @click="stopBot()">
|
||||||
|
Stop
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-primary btn-sm col-md-5 m-1" :disabled="!isTrading" @click="stopBuy()">
|
||||||
|
StopBuy
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="btn btn-primary btn-sm col-md-5 m-1"
|
||||||
|
:disabled="!isTrading"
|
||||||
|
@click="reloadConfig()"
|
||||||
|
>
|
||||||
Reload Config
|
Reload Config
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
v-if="botState.forcebuy_enabled"
|
v-if="botState.forcebuy_enabled"
|
||||||
class="btn btn-primary btn-sm col-md-5 m-1"
|
class="btn btn-primary btn-sm col-md-5 m-1"
|
||||||
|
:disabled="!isTrading"
|
||||||
@click="initiateForcebuy"
|
@click="initiateForcebuy"
|
||||||
>
|
>
|
||||||
Forcebuy
|
Forcebuy
|
||||||
|
@ -22,7 +37,7 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Component, Vue } from 'vue-property-decorator';
|
import { Component, Vue } from 'vue-property-decorator';
|
||||||
import { namespace } from 'vuex-class';
|
import { namespace } from 'vuex-class';
|
||||||
import { BotState } from '@/types';
|
import { BotState, RunModes } from '@/types';
|
||||||
import ForceBuyForm from './ForceBuyForm.vue';
|
import ForceBuyForm from './ForceBuyForm.vue';
|
||||||
|
|
||||||
const ftbot = namespace('ftbot');
|
const ftbot = namespace('ftbot');
|
||||||
|
@ -41,6 +56,10 @@ export default class BotControls extends Vue {
|
||||||
|
|
||||||
@ftbot.Action reloadConfig;
|
@ftbot.Action reloadConfig;
|
||||||
|
|
||||||
|
get isTrading(): boolean {
|
||||||
|
return this.botState.runmode === RunModes.LIVE || this.botState.runmode === RunModes.DRY_RUN;
|
||||||
|
}
|
||||||
|
|
||||||
initiateForcebuy() {
|
initiateForcebuy() {
|
||||||
this.$bvModal.show('forcebuy-modal');
|
this.$bvModal.show('forcebuy-modal');
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,29 @@ export interface BalanceInterface {
|
||||||
value: number;
|
value: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Values for BotState.state */
|
||||||
|
export enum BotStates {
|
||||||
|
RUNNING = 'running',
|
||||||
|
STOPPED = 'stopped',
|
||||||
|
RELOAD_CONFIG = 'reload_config',
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum RunModes {
|
||||||
|
LIVE = 'live',
|
||||||
|
DRY_RUN = 'dry_run',
|
||||||
|
BACKTEST = 'backtest',
|
||||||
|
EDGE = 'edge',
|
||||||
|
HYPEROPT = 'hyperopt',
|
||||||
|
UTIL_EXCHANGE = 'util_exchange',
|
||||||
|
UTIL_NO_EXCHANGE = 'util_no_exchange',
|
||||||
|
PLOT = 'plot',
|
||||||
|
WEBSERVER = 'webserver',
|
||||||
|
OTHER = 'other',
|
||||||
|
}
|
||||||
|
|
||||||
export interface BotState {
|
export interface BotState {
|
||||||
|
state: BotStates;
|
||||||
|
runmode: RunModes;
|
||||||
bid_strategy: object;
|
bid_strategy: object;
|
||||||
ask_strategy: object;
|
ask_strategy: object;
|
||||||
dry_run: boolean;
|
dry_run: boolean;
|
||||||
|
@ -51,7 +73,6 @@ export interface BotState {
|
||||||
minimal_roi: object;
|
minimal_roi: object;
|
||||||
stake_amount: number;
|
stake_amount: number;
|
||||||
stake_currency: string;
|
stake_currency: string;
|
||||||
state: string;
|
|
||||||
stoploss: number;
|
stoploss: number;
|
||||||
strategy: string;
|
strategy: string;
|
||||||
/** Timeframe in readable form (e.g. 5m) */
|
/** Timeframe in readable form (e.g. 5m) */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user