breakout orders

This commit is contained in:
tim
2024-10-31 16:54:57 -04:00
parent 4eb15355a6
commit a65bc94dac
9 changed files with 87 additions and 28 deletions

View File

@@ -108,6 +108,8 @@ export class Shape {
// both amount and amountSymbol must be set in order to display amount text
this.model.amount = null
this.model.amountSymbol = null
this.model.extraText = null
this.model.textLocation = 'above'
// LEAF SUBCLASSES MUST CALL setModel(model) AFTER ALL CONSTRUCTION.
}
@@ -127,6 +129,10 @@ export class Shape {
this.model.amount = model.amount
if (model.amountSymbol)
this.model.amountSymbol = model.amountSymbol
if (model.extraText)
this.model.extraText = model.extraText
if (model.textLocation)
this.model.textLocation = model.textLocation
const newProps = {}
@@ -152,12 +158,18 @@ export class Shape {
// text label
let text = allocationText(this.model.allocation, this.model.amount, this.model.amountSymbol)
if (this.model.extraText)
text += ' '+this.model.extraText
if (this.debug) text = `${this.id} ` + text
if (!text.length)
newProps.showLabel = false
else {
newProps.text = text
newProps.showLabel = true
newProps.textLocation = this.model.textLocation
newProps.vertLabelsAlign =
this.model.textLocation === 'above' ? 'bottom' :
this.model.textLocation === 'below' ? 'top' : null;
}
if (this.debug && this.id)
@@ -612,7 +624,7 @@ export class DLine extends Line {
}
/*
/* todo tim
pointsToTvOhlcStart(points, periodSeconds = null) {
if (points === null) return null
const [v,w] = points