Wondering about indicator which can highlight levels with low volume prints.
e.g. on ES1 if 0/1 occurs, 0/4 , etc.
Do you have any idea? I was trying AI code bots and so on to refactor the VPOC of a bar code and more, nothing works
Here is the try which should make a rectangle around numbers (volume between 1-10)
const predef = require(“./tools/predef”);
const meta = require(“./tools/meta”);
class TikiScalper {
init() {
this.isBuy = true;
}
map(d, i, history) {
if (i < 5) {
return;
}
const close = d.close();
const priorClose = history.get(i - 1).close();
const priorPriorClose = history.get(i - 2).close();
const priorPriorPriorClose = history.get(i - 3).close();
const isBuy = priorClose < close &&
(priorPriorClose < priorClose ||
priorPriorPriorClose < priorClose);
const isSell = priorClose > close &&
(priorPriorClose > priorClose ||
priorPriorPriorClose > priorClose);
if (isBuy) {
this.isBuy = true;
} else if (isSell) {
this.isBuy = false;
}
const {
upColor,
downColor
} = this.props;
const color = this.isBuy ? upColor: downColor;
return {
candlestick: {
color
}
};
}
}
class BarVPOC {
map(d) {
const profile = d.profile();
const VPOC = profile.reduce((result, value) => {
if (value.vol > result.vol) {
result = value;
}
return result;
}, { vol: 0 });
return {
VPOC: VPOC.price,
tickSize: this.contractInfo.tickSize
};
}
}
function highlightPriceLevels(d) {
for (let i = 0; i < d.history.data.length; i++) {
const item = d.history.get(i);
item.color = “blue”; // Nastaví barvu ceny na modrou
}
return {};
}
module.exports = {
name: “barVPOC”,
description: “VPOC (BAR)”,
calculator: BarVPOC,
tags: [predef.tags.Volumes],
inputType: meta.InputType.BARS,
params: {
boxColor: predef.paramSpecs.color(“#FFFF99”),
boxWidth: predef.paramSpecs.percent(4, 1, 0, 10),
lineOpacity: predef.paramSpecs.number(100, 1, 0),
lineWidth: predef.paramSpecs.number(1, 1, 0)
},
plotter: [
predef.plotters.custom(highlightPriceLevels)
]
};