Can somebody adjust this script so that it prints an orange circle above every 15:29 minute?
const predef = require("./tools/predef");
const { du } = require("./tools/graphics");
class SingleBarDot {
init() {}
map(d, i, history) {
let items = [];
const data = history.data;
const targetIndex = data.length - 30; // last 30th bar
if (i === targetIndex) {
items.push({
tag: "Shapes",
key: "dot",
primitives: [
{
tag: "Rectangle",
position: {
x: du(d.index()),
y: du(Math.min(d.open(), d.close())) // top of the candle body
},
size: {
width: du(1), // small width = single bar
height: du(Math.abs(d.close() - d.open())) // candle body height
}
}
],
fillStyle: {
color: "orange",
opacity: 100
}
});
}
return { graphics: { items } };
}
}
module.exports = {
name: "Single Bar Dot",
description: "Draws an orange rectangle on a single candle",
calculator: SingleBarDot,
inputType: "bars",
params: {},
tags: ["Debug"],
schemeStyles: predef.styles.solidLine("#ff8800")
};