diff --git a/src/components/DiagonalOrder.vue b/src/components/DiagonalOrder.vue index aeed518..ec94301 100644 --- a/src/components/DiagonalOrder.vue +++ b/src/components/DiagonalOrder.vue @@ -1,23 +1,15 @@ @@ -26,65 +18,22 @@ import {useOrderStore} from "@/store/store"; import LimitPrice from "@/components/LimitPrice.vue"; import Order from "@/components/Order.vue"; import {computed, ref} from "vue"; -import {applyLimit} from "@/orderbuild.js"; +import {applyLimit, applyLinePoints} from "@/orderbuild.js"; import {validateRequired, validateTranches} from "@/validate.js"; import {MAX_FRACTION, newTranche} from "@/blockchain/orderlib.js"; +import TimeEntry from "@/components/TimeEntry.vue"; const os = useOrderStore() -const skew = ref(0) -const rungs = computed(()=>{ - if( !os.limitPrice || !os.limitPrice2 ) - return [] - const n = os.tranches; - const a = parseFloat(os.limitPrice); - const b = parseFloat(os.limitPrice2); - if( n < 1 || !a || !b ) return [] - if( n === 1 ) return [(a+b)/2] - // num >= 2 - const result = [] - const delta = (b-a)/(n-1) - for( let i=0; i{ - return rungs.value.map((r)=>r.toPrecision(5)) // todo precisions -}) -const fractions = computed(()=>{ - const n = os.tranches - const s = skew.value / 100 - const result = [] - if( s === 1 ) { - result.push(1) - for( let i=1; ifractions.value.map((f)=>f*os.totalAmount) ) +const time1 = ref(new Date()) +const price1 = ref(null) +const time2 = ref(new Date()) +const price2 = ref(null) function buildTranches() { - const ts = [] - const n = os.tranches - for( let i=0; i - - + + diff --git a/src/components/LimitPrice.vue b/src/components/LimitPrice.vue index 3d8b0bc..7d6ede2 100644 --- a/src/components/LimitPrice.vue +++ b/src/components/LimitPrice.vue @@ -1,7 +1,7 @@