From 29fcad10596a2cdfac284e6cdd2ebeb727c4ca64 Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 29 Jan 2024 01:25:48 -0400 Subject: [PATCH] initial chart checkin --- .gitmodules | 3 + src/components/DiagonalOrder.vue | 15 +- src/components/Footer.vue | 22 +-- src/components/Orders.vue | 2 +- src/components/SplitPane.vue | 146 ++++++++++++++++++ src/components/chart/Chart.vue | 102 ++++++++++++ src/components/chart/ChartOrder.vue | 17 ++ src/components/chart/ChartTranche.vue | 18 +++ src/components/chart/LimitTranche.vue | 15 ++ src/components/chart/LineTranche.vue | 34 ++++ src/components/chart/MarketTranche.vue | 16 ++ src/components/chart/TranchePanel.vue | 21 +++ src/layouts/chart/ChartLayout.vue | 16 ++ src/layouts/chart/MainView.vue | 15 ++ .../default/{Layout.vue => DefaultLayout.vue} | 4 +- src/layouts/default/MainView.vue | 4 +- src/orderbuild.js | 19 +-- src/plugins/index.js | 2 +- src/router/index.js | 10 +- src/store/{index.js => pinia.js} | 0 src/store/store.js | 26 +++- src/views/ChartView.vue | 24 +++ tradingview | 1 + 23 files changed, 490 insertions(+), 42 deletions(-) create mode 100644 .gitmodules create mode 100644 src/components/SplitPane.vue create mode 100644 src/components/chart/Chart.vue create mode 100644 src/components/chart/ChartOrder.vue create mode 100644 src/components/chart/ChartTranche.vue create mode 100644 src/components/chart/LimitTranche.vue create mode 100644 src/components/chart/LineTranche.vue create mode 100644 src/components/chart/MarketTranche.vue create mode 100644 src/components/chart/TranchePanel.vue create mode 100644 src/layouts/chart/ChartLayout.vue create mode 100644 src/layouts/chart/MainView.vue rename src/layouts/default/{Layout.vue => DefaultLayout.vue} (96%) rename src/store/{index.js => pinia.js} (100%) create mode 100644 src/views/ChartView.vue create mode 160000 tradingview diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..12d4101 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "tradingview"] + path = tradingview + url = git@git.tolson.net:dexorder/advanced_charts.git diff --git a/src/components/DiagonalOrder.vue b/src/components/DiagonalOrder.vue index baed84a..3df20ae 100644 --- a/src/components/DiagonalOrder.vue +++ b/src/components/DiagonalOrder.vue @@ -3,11 +3,11 @@
Line Point A
- +
Line Point B
- +
@@ -32,15 +32,18 @@ import {applyLinePoints, linePointsValue} from "@/orderbuild.js"; import {newTranche} from "@/blockchain/orderlib.js"; import TimeEntry from "@/components/TimeEntry.vue"; import RoutePrice from "@/components/RoutePrice.vue"; +import {timestamp} from "@/misc.js"; const s = useStore() const os = useOrderStore() -const time1 = ref(new Date()) +const date1 = ref(new Date()) const price1 = ref(null) -const time2 = ref(new Date()) +const date2 = ref(new Date()) const price2 = ref(null) -const curLimit = computed(()=>linePointsValue(time1.value, price1.value, time2.value, price2.value, s.time)) +const time1 = computed(()=>timestamp(date1.value)) +const time2 = computed(()=>timestamp(date2.value)) +const curLimit = computed(()=>linePointsValue(time1.value, price1.value, time2.value, price2.value, s.clock)) function buildTranches() { const t = newTranche(); @@ -49,7 +52,7 @@ function buildTranches() { } function validOrder() { - return time1.value && (price1.value || price1.value===0) && time2.value && (price2.value || price2.value===0) + return date1.value && (price1.value || price1.value===0) && date2.value && (price2.value || price2.value===0) } diff --git a/src/components/Footer.vue b/src/components/Footer.vue index 7e3f844..7d4d5c1 100644 --- a/src/components/Footer.vue +++ b/src/components/Footer.vue @@ -1,14 +1,13 @@ @@ -21,5 +20,10 @@ const s = useStore() diff --git a/src/components/Orders.vue b/src/components/Orders.vue index 9bdbdb3..7ee8baf 100644 --- a/src/components/Orders.vue +++ b/src/components/Orders.vue @@ -241,7 +241,7 @@ function describeTrancheLine(st, isMin, b, m) { const t0 = inverted ? st.order.tokenIn : st.order.tokenOut const t1 = !inverted ? st.order.tokenIn : st.order.tokenOut if( m !== 0 ) { - const limit = b + m * s.time + const limit = b + m * s.clock const price = pairPriceAddr(t0, t1, limit); return 'diagonal ' + (price === null ? null : price.toPrecision(5)) } diff --git a/src/components/SplitPane.vue b/src/components/SplitPane.vue new file mode 100644 index 0000000..36dbc9f --- /dev/null +++ b/src/components/SplitPane.vue @@ -0,0 +1,146 @@ + + + + + + + + \ No newline at end of file diff --git a/src/components/chart/Chart.vue b/src/components/chart/Chart.vue new file mode 100644 index 0000000..5a95c51 --- /dev/null +++ b/src/components/chart/Chart.vue @@ -0,0 +1,102 @@ + + + + + \ No newline at end of file diff --git a/src/components/chart/ChartOrder.vue b/src/components/chart/ChartOrder.vue new file mode 100644 index 0000000..8200284 --- /dev/null +++ b/src/components/chart/ChartOrder.vue @@ -0,0 +1,17 @@ + + + + + diff --git a/src/components/chart/ChartTranche.vue b/src/components/chart/ChartTranche.vue new file mode 100644 index 0000000..fff0be3 --- /dev/null +++ b/src/components/chart/ChartTranche.vue @@ -0,0 +1,18 @@ + + + + + \ No newline at end of file diff --git a/src/components/chart/LimitTranche.vue b/src/components/chart/LimitTranche.vue new file mode 100644 index 0000000..db492e1 --- /dev/null +++ b/src/components/chart/LimitTranche.vue @@ -0,0 +1,15 @@ + + + + + \ No newline at end of file diff --git a/src/components/chart/LineTranche.vue b/src/components/chart/LineTranche.vue new file mode 100644 index 0000000..daa5a4c --- /dev/null +++ b/src/components/chart/LineTranche.vue @@ -0,0 +1,34 @@ + + + + + \ No newline at end of file diff --git a/src/components/chart/MarketTranche.vue b/src/components/chart/MarketTranche.vue new file mode 100644 index 0000000..482ded0 --- /dev/null +++ b/src/components/chart/MarketTranche.vue @@ -0,0 +1,16 @@ + + + + + \ No newline at end of file diff --git a/src/components/chart/TranchePanel.vue b/src/components/chart/TranchePanel.vue new file mode 100644 index 0000000..7b95eeb --- /dev/null +++ b/src/components/chart/TranchePanel.vue @@ -0,0 +1,21 @@ + + + + + \ No newline at end of file diff --git a/src/layouts/chart/ChartLayout.vue b/src/layouts/chart/ChartLayout.vue new file mode 100644 index 0000000..27248d7 --- /dev/null +++ b/src/layouts/chart/ChartLayout.vue @@ -0,0 +1,16 @@ + + + diff --git a/src/layouts/chart/MainView.vue b/src/layouts/chart/MainView.vue new file mode 100644 index 0000000..3fe4093 --- /dev/null +++ b/src/layouts/chart/MainView.vue @@ -0,0 +1,15 @@ + + + + + diff --git a/src/layouts/default/Layout.vue b/src/layouts/default/DefaultLayout.vue similarity index 96% rename from src/layouts/default/Layout.vue rename to src/layouts/default/DefaultLayout.vue index 3f44c90..5b11aba 100644 --- a/src/layouts/default/Layout.vue +++ b/src/layouts/default/DefaultLayout.vue @@ -1,9 +1,9 @@ diff --git a/src/layouts/default/MainView.vue b/src/layouts/default/MainView.vue index 0703e7e..02263d8 100644 --- a/src/layouts/default/MainView.vue +++ b/src/layouts/default/MainView.vue @@ -1,11 +1,9 @@