@@ -97,7 +93,7 @@ import TradeProfit from './TradeProfit.vue';
import TradeActionsPopover from './TradeActionsPopover.vue';
import ForceExitForm from '@/components/ftbot/ForceExitForm.vue';
-import { ref, computed, watch } from 'vue';
+import { ref, computed, watch, onMounted } from 'vue';
import { useBotStore } from '@/stores/ftbotwrapper';
import { useRouter } from 'vue-router';
import { TableField, TableItem } from 'bootstrap-vue-next';
@@ -143,43 +139,48 @@ const rows = computed(() => {
return props.trades.length;
});
-const tableFields: TableField[] = [
- { key: 'trade_id', label: 'ID' },
- { key: 'pair', label: 'Pair' },
- { key: 'amount', label: 'Amount' },
- {
- key: 'stake_amount',
- label: 'Stake amount',
- },
- {
- key: 'open_rate',
- label: 'Open rate',
- formatter: (value: unknown) => formatPrice(value as number),
- },
- {
- key: props.activeTrades ? 'current_rate' : 'close_rate',
- label: props.activeTrades ? 'Current rate' : 'Close rate',
- formatter: (value: unknown) => formatPrice(value as number),
- },
- {
- key: 'profit',
- label: props.activeTrades ? 'Current profit %' : 'Profit %',
+// This using "TableField[]" below causes
+// Error: Debug Failure. No error for last overload signature
+const tableFields = ref
([]);
- formatter: (value: unknown, key?: string, item?: unknown) => {
- if (!item) {
- return '';
- }
- const typedItem = item as Trade;
- const percent = formatPercent(typedItem.profit_ratio, 2);
- return `${percent} ${`(${formatPriceWithDecimals(typedItem.profit_abs)})`}`;
+onMounted(() => {
+ tableFields.value = [
+ { key: 'trade_id', label: 'ID' },
+ { key: 'pair', label: 'Pair' },
+ { key: 'amount', label: 'Amount' },
+ {
+ key: 'stake_amount',
+ label: 'Stake amount',
},
- },
- { key: 'open_timestamp', label: 'Open date' },
- ...(props.activeTrades ? openFields : closedFields),
-];
-if (props.multiBotView) {
- tableFields.unshift({ key: 'botName', label: 'Bot' });
-}
+ {
+ key: 'open_rate',
+ label: 'Open rate',
+ formatter: (value: unknown) => formatPrice(value as number),
+ },
+ {
+ key: props.activeTrades ? 'current_rate' : 'close_rate',
+ label: props.activeTrades ? 'Current rate' : 'Close rate',
+ formatter: (value: unknown) => formatPrice(value as number),
+ },
+ {
+ key: 'profit',
+ label: props.activeTrades ? 'Current profit %' : 'Profit %',
+ formatter: (value: unknown, key?: string, item?: unknown) => {
+ if (!item) {
+ return '';
+ }
+ const typedItem = item as Trade;
+ const percent = formatPercent(typedItem.profit_ratio, 2);
+ return `${percent} ${`(${formatPriceWithDecimals(typedItem.profit_abs)})`}`;
+ },
+ },
+ { key: 'open_timestamp', label: 'Open date' },
+ ...(props.activeTrades ? openFields : closedFields),
+ ];
+ if (props.multiBotView) {
+ tableFields.value.unshift({ key: 'botName', label: 'Bot' });
+ }
+});
const feOrderType = ref(undefined);
const forceExitHandler = (item: Trade, ordertype: string | undefined = undefined) => {
diff --git a/src/components/ftbot/TradeListNav.vue b/src/components/ftbot/TradeListNav.vue
index 6f8eda89..523c8e4f 100644
--- a/src/components/ftbot/TradeListNav.vue
+++ b/src/components/ftbot/TradeListNav.vue
@@ -9,26 +9,48 @@
>Trade Navigation {{ sortNewestFirst ? '↓' : '↑' }}
-
-
{{
- trade.is_short ? 'S-' : 'L-'
- }}
-
+
+
+
+ {{
+ trade.is_short ? 'S-' : 'L-'
+ }}
+
+
+
+
+
+
+
+
-
-
+
+
+ -
+ {{ order.ft_order_side }} {{ order.amount }} at {{ order.safe_price }}
+
+
+
No trades to show...
@@ -39,7 +61,7 @@
import { Trade } from '@/types';
import TradeProfit from '@/components/ftbot/TradeProfit.vue';
import ProfitPill from '@/components/general/ProfitPill.vue';
-import { computed, ref } from 'vue';
+import { computed, ref, watch } from 'vue';
import { useBotStore } from '@/stores/ftbotwrapper';
import DateTimeTZ from '@/components/general/DateTimeTZ.vue';
@@ -67,6 +89,15 @@ const sortedTrades = computed(() => {
: a.open_timestamp - b.open_timestamp,
);
});
+
+const ordersVisible = ref(sortedTrades.value.map(() => false));
+
+watch(
+ () => botStore.activeBot.selectedPair,
+ () => {
+ ordersVisible.value = sortedTrades.value.map(() => false);
+ },
+);