Merge branch 'start_trades'

This commit is contained in:
Matthias 2020-11-08 11:08:27 +01:00
commit 3dae24c16f
2 changed files with 18 additions and 0 deletions

View File

@ -29,6 +29,14 @@
>
Forcebuy
</button>
<button
v-if="botState.runmode === 'webserver'"
:disabled="isTrading"
class="btn-primary col-md-5 m-1"
@click="startTrade()"
>
Start Trading
</button>
<ForceBuyForm :modal-show="forcebuyShow" @close="this.$bvModal.hide('forcebuy-modal')" />
</div>
</div>
@ -56,6 +64,8 @@ export default class BotControls extends Vue {
@ftbot.Action reloadConfig;
@ftbot.Action startTrade;
get isTrading(): boolean {
return this.botState.runmode === RunModes.LIVE || this.botState.runmode === RunModes.DRY_RUN;
}

View File

@ -424,6 +424,14 @@ export default {
return Promise.reject(error);
}
},
async startTrade() {
try {
const res = await api.post('/start_trade', {});
return Promise.resolve(res);
} catch (error) {
return Promise.reject(error);
}
},
async forcesell({ dispatch }, tradeid: string) {
if (tradeid) {
const payload = { tradeid };