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">
|
2020-07-02 17:58:06 +00:00
|
|
|
<div class="col-mb-2">
|
|
|
|
<b-checkbox v-model="historicView">HistoricData</b-checkbox>
|
2020-07-02 18:05:20 +00:00
|
|
|
</div>
|
|
|
|
<div class="col-mb-2 ml-2 mr-2">
|
2020-07-02 17:58:06 +00:00
|
|
|
<b-button @click="refresh">↻</b-button>
|
|
|
|
</div>
|
2020-06-20 06:52:43 +00:00
|
|
|
<div class="col-mb-2">
|
2020-08-01 15:39:47 +00:00
|
|
|
<b-form-select
|
|
|
|
:options="historicView ? pairlist : whitelist"
|
|
|
|
v-model="pair"
|
|
|
|
@change="refresh"
|
|
|
|
>
|
|
|
|
</b-form-select>
|
2020-06-20 06:52:43 +00:00
|
|
|
</div>
|
2020-06-23 18:37:14 +00:00
|
|
|
</div>
|
2020-07-31 05:36:26 +00:00
|
|
|
<div class="mt-2 row" v-if="historicView">
|
2020-08-01 15:04:05 +00:00
|
|
|
<TimeRangeSelect class="col-md-4 mr-2" v-model="timerange"></TimeRangeSelect>
|
2020-07-31 05:36:26 +00:00
|
|
|
<StrategyList class="col-md-2" v-model="strategy"></StrategyList>
|
2020-07-11 15:25:28 +00:00
|
|
|
</div>
|
2020-07-02 05:01:24 +00:00
|
|
|
|
2020-06-20 06:52:43 +00:00
|
|
|
<div class="row">
|
2020-06-23 18:37:14 +00:00
|
|
|
<CandleChart
|
|
|
|
:pair="pair"
|
|
|
|
:timeframe="timeframe"
|
2020-07-13 19:38:18 +00:00
|
|
|
:timeframems="timeframems"
|
2020-06-23 18:37:14 +00:00
|
|
|
:dataset="dataset"
|
2020-07-13 18:52:29 +00:00
|
|
|
:trades="trades"
|
2020-06-23 18:37:14 +00:00
|
|
|
>
|
2020-06-23 05:09:58 +00:00
|
|
|
</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 { namespace } from 'vuex-class';
|
2020-06-17 18:38:25 +00:00
|
|
|
import CandleChart from '@/components/ftbot/CandleChart.vue';
|
2020-07-11 17:55:47 +00:00
|
|
|
import TimeRangeSelect from '@/components/ftbot/TimeRangeSelect.vue';
|
2020-07-31 05:17:50 +00:00
|
|
|
import StrategyList from '@/components/ftbot/StrategyList.vue';
|
2020-08-03 09:08:39 +00:00
|
|
|
import { AvailablePairPayload, PairCandlePayload, PairHistoryPayload } from '@/store/types';
|
2020-06-17 18:38:25 +00:00
|
|
|
|
2020-06-22 06:05:03 +00:00
|
|
|
const ftbot = namespace('ftbot');
|
2020-07-31 05:17:50 +00:00
|
|
|
|
2020-06-22 06:05:03 +00:00
|
|
|
@Component({
|
2020-07-31 05:17:50 +00:00
|
|
|
components: { CandleChart, StrategyList, TimeRangeSelect },
|
2020-06-22 06:05:03 +00:00
|
|
|
})
|
|
|
|
export default class Graphs extends Vue {
|
|
|
|
pair = 'XRP/USDT';
|
|
|
|
|
|
|
|
timeframe = '5m';
|
|
|
|
|
2020-07-13 19:38:18 +00:00
|
|
|
timeframems = 300000;
|
|
|
|
|
2020-07-02 17:58:06 +00:00
|
|
|
historicView = false;
|
|
|
|
|
2020-07-27 05:20:35 +00:00
|
|
|
strategy = '';
|
|
|
|
|
2020-07-11 17:55:47 +00:00
|
|
|
timerange = '';
|
2020-07-11 15:25:28 +00:00
|
|
|
|
2020-08-01 15:39:47 +00:00
|
|
|
@ftbot.State pairlist;
|
|
|
|
|
2020-07-02 05:09:53 +00:00
|
|
|
@ftbot.State candleData;
|
2020-06-22 06:05:03 +00:00
|
|
|
|
2020-07-02 17:58:06 +00:00
|
|
|
@ftbot.State history;
|
|
|
|
|
2020-06-22 06:05:03 +00:00
|
|
|
@ftbot.State whitelist;
|
|
|
|
|
2020-07-13 18:52:29 +00:00
|
|
|
@ftbot.State trades;
|
|
|
|
|
2020-06-22 06:05:03 +00:00
|
|
|
@ftbot.Action
|
2020-07-02 17:58:06 +00:00
|
|
|
public getPairCandles!: (payload: PairCandlePayload) => void;
|
|
|
|
|
|
|
|
@ftbot.Action
|
|
|
|
public getPairHistory!: (payload: PairHistoryPayload) => void;
|
2020-06-22 06:05:03 +00:00
|
|
|
|
|
|
|
@ftbot.Action
|
|
|
|
public getWhitelist;
|
|
|
|
|
2020-08-01 15:39:47 +00:00
|
|
|
@ftbot.Action
|
|
|
|
public getAvailablePairs!: (payload: AvailablePairPayload) => void;
|
|
|
|
|
2020-06-17 18:38:25 +00:00
|
|
|
mounted() {
|
2020-06-20 06:52:43 +00:00
|
|
|
this.getWhitelist();
|
|
|
|
this.refresh();
|
2020-08-01 15:39:47 +00:00
|
|
|
this.getAvailablePairs({ timeframe: this.timeframe });
|
2020-06-23 18:37:14 +00:00
|
|
|
}
|
|
|
|
|
2020-06-22 06:05:03 +00:00
|
|
|
get dataset() {
|
2020-07-02 17:58:06 +00:00
|
|
|
if (this.historicView) {
|
|
|
|
return this.history[`${this.pair}__${this.timeframe}`];
|
|
|
|
}
|
2020-07-02 05:09:53 +00:00
|
|
|
return this.candleData[`${this.pair}__${this.timeframe}`];
|
2020-06-22 06:05:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
refresh() {
|
2020-07-02 17:58:06 +00:00
|
|
|
if (this.historicView) {
|
|
|
|
this.getPairHistory({
|
|
|
|
pair: this.pair,
|
|
|
|
timeframe: this.timeframe,
|
2020-07-11 17:55:47 +00:00
|
|
|
timerange: this.timerange,
|
2020-07-27 05:20:35 +00:00
|
|
|
strategy: this.strategy,
|
2020-07-02 17:58:06 +00:00
|
|
|
});
|
|
|
|
} else {
|
|
|
|
this.getPairCandles({ pair: this.pair, timeframe: this.timeframe, limit: 500 });
|
|
|
|
}
|
2020-06-22 06:05:03 +00:00
|
|
|
}
|
|
|
|
}
|
2020-06-17 18:38:25 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped></style>
|