2020-06-17 18:38:25 +00:00
|
|
|
<template>
|
2020-06-20 06:52:43 +00:00
|
|
|
<div class="container-fluid">
|
|
|
|
<div class="row mb-2">
|
|
|
|
<div class="col-mb-2">
|
|
|
|
<b-form-select :options="whitelist" v-model="pair" @change="refresh"> </b-form-select>
|
|
|
|
</div>
|
|
|
|
<div class="col-mb-2"></div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
2020-06-20 06:57:24 +00:00
|
|
|
<CandleChart :pair="pair" :timeframe="timeframe" :dataset="dataset"> </CandleChart>
|
2020-06-20 06:52:43 +00:00
|
|
|
</div>
|
2020-06-17 18:38:25 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2020-06-22 06:05:03 +00:00
|
|
|
<script lang="ts">
|
|
|
|
import { Component, Vue } from 'vue-property-decorator';
|
|
|
|
import { mapActions } from 'vuex';
|
|
|
|
import { namespace } from 'vuex-class';
|
2020-06-17 18:38:25 +00:00
|
|
|
|
|
|
|
import CandleChart from '@/components/ftbot/CandleChart.vue';
|
|
|
|
|
2020-06-22 06:05:03 +00:00
|
|
|
const ftbot = namespace('ftbot');
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
components: { CandleChart },
|
|
|
|
methods: {
|
|
|
|
...mapActions('ftbot', ['getPairHistory', 'getWhitelist']),
|
2020-06-20 06:52:43 +00:00
|
|
|
},
|
2020-06-22 06:05:03 +00:00
|
|
|
})
|
|
|
|
export default class Graphs extends Vue {
|
|
|
|
pair = 'XRP/USDT';
|
|
|
|
|
|
|
|
timeframe = '5m';
|
|
|
|
|
|
|
|
@ftbot.State history;
|
|
|
|
|
|
|
|
@ftbot.State whitelist;
|
|
|
|
|
|
|
|
@ftbot.Action
|
|
|
|
public getPairHistory;
|
|
|
|
|
|
|
|
@ftbot.Action
|
|
|
|
public getWhitelist;
|
|
|
|
|
2020-06-17 18:38:25 +00:00
|
|
|
mounted() {
|
2020-06-20 06:52:43 +00:00
|
|
|
this.getWhitelist();
|
|
|
|
this.refresh();
|
2020-06-22 06:05:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
get dataset() {
|
|
|
|
return this.history[`${this.pair}__${this.timeframe}`];
|
|
|
|
}
|
|
|
|
|
|
|
|
refresh() {
|
|
|
|
this.getPairHistory({ pair: this.pair, timeframe: this.timeframe, limit: 500 });
|
|
|
|
}
|
|
|
|
}
|
2020-06-17 18:38:25 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped></style>
|