crossLine
Syntax
Parameters
Return Value
Example
//@version=1
init = () => {
// Place the drawings on the main price chart
indicator({ onMainPanel: true, format: 'inherit' });
};
onTick = () => {
// Every 50 candles, place a cross marker
if (index % 50 === 0) {
// Get the time of the current candle
const time_cross = time(0);
// Get the current candle closing price
const price_cross = closeC(0);
// Draw a cross at (time = current candle, price = close price)
// - Cross color: orange
// - Line thickness: 2
// - Line style: dashed
crossLine(
time_cross,
price_cross,
{ linecolor: color.yellow, linewidth: 2 , linestyle: 2 }
);
}
};Result

Last updated