diff --git a/src/charts/ordershapes.js b/src/charts/ordershapes.js index 6fc9b02..d278d09 100644 --- a/src/charts/ordershapes.js +++ b/src/charts/ordershapes.js @@ -87,7 +87,7 @@ class TrancheShapes { price *= scale // console.log('price', price) const channel = buy?'low':'high'; - const text = allocationText(buy, weight, amount, amountSymbol, amountIsBase ? null : this.symbol.base.s, '\n') + const text = allocationText(buy, weight, amount, amountSymbol, amountIsBase ? null : this.symbol.base.s, 1, '\n') const s = createShape(buy?'arrow_up':'arrow_down', {time, price}, {channel,text,lock:true}) // console.log('created fill shape at', time, price) this.fills.push(s) diff --git a/src/charts/shape.js b/src/charts/shape.js index 3df2bfa..9227c32 100644 --- a/src/charts/shape.js +++ b/src/charts/shape.js @@ -40,7 +40,7 @@ export const ShapeType = { } -export function allocationText(buy, weight, amount, baseSymbol, amountSymbol = null, separator = ' ') { +export function allocationText(buy, weight, amount, baseSymbol, amountSymbol = null, parts = 1, separator = ' ') { const hasAmount = amount !== null && amount !== undefined && amount > 0 if (hasAmount) amount = Number(amount) @@ -59,9 +59,12 @@ export function allocationText(buy, weight, amount, baseSymbol, amountSymbol = n else text += `${toPrecision(amount,3)} ${baseSymbol}` } + if (parts > 1) + text += separator + `in ${Math.round(parts)} parts` return text } + export class Shape { constructor(type, onModel=null, onDelete=null, props=null, readonly=false, overrides={}) { diff --git a/src/components/chart/DCABuilder.vue b/src/components/chart/DCABuilder.vue index 4b39447..53b369a 100644 --- a/src/components/chart/DCABuilder.vue +++ b/src/components/chart/DCABuilder.vue @@ -44,7 +44,7 @@