intro vid on homepage

This commit is contained in:
tim
2025-03-05 18:12:34 -04:00
parent 488e9f45f1
commit ebf70dd10c
6 changed files with 55 additions and 15 deletions

View File

@@ -39,7 +39,7 @@ export const ShapeType = {
}
export function allocationText(buy, weight, amount, symbol, separator = ' ') {
export function allocationText(buy, weight, amount, symbol, separator = ' ', inSymbol=null) {
// set breakout=true for a buy breakout and breakout=false for a sell breakout
const hasAmount = amount !== null && amount !== undefined && amount > 0
if (hasAmount)
@@ -56,6 +56,8 @@ export function allocationText(buy, weight, amount, symbol, separator = ' ') {
if (hasAmount && hasSymbol) {
if (hasWeight)
text += separator
if (inSymbol)
text += `${inSymbol} worth `
text += `${amount.toPrecision(3).toLocaleString('fullwide')} ${symbol}`
}
return text
@@ -324,11 +326,11 @@ export class Shape {
}
// diagonals need to override this to adjust their price as well.
pointsToTvOhlcStart(points, periodSeconds=null) {
return points === null ? null : points.map((p) => {
return {time: nearestOhlcStart(p.time, periodSeconds), price: p.price}
})
}
pointsToTvOhlcStart(points, periodSeconds = null) {
return points === null ? null : points.map((p) => {
return {time: nearestOhlcStart(p.time, periodSeconds), price: p.price}
})
}
onPoints(points) {} // the control points of an existing shape were changed