order marker inside tradingview candle

Viewed 288

How can i add marker (for my buy and sell orders) inside the candle ,like the image

enter image description here

currently my chart is showing like this (using getmarks function) enter image description here

my getsmarks function

 getMarks(symbolInfo, from, to, onDataCallback, resolution) {
    
    if (localStorage.bnApiStatus.toString() == "true") {
        let symbol = symbolInfo.name;
        if(this.self.getclosedOrders){
            this.self.getclosedOrders().then((closedorders) => {
                var result = [];

                if (closedorders.length) {

                    closedorders.forEach(function(row, i) {
                        let label, text, border, background;

                        if (row.side == 'BUY') {
                            label = 'B';
                            text = 'BUY';
                            border = '#00c853';
                            background = '#00c853';
                        } else if (row.side == 'SELL') {
                            label = 'S';
                            text = 'SELL';
                            border = '#EA0070';
                            background = '#EA0070';
                        }
                        i = i + 1;
                        var el = {
                            id: i,
                            color: { border: border, background: background },
                            time: row.time / 1000,
                            text: text,
                            label: label,
                            labelFontColor: '#fff',
                            minSize: 8
                        }
                        result.push(el);
                    });
                    onDataCallback(result)
                }


            }).catch(err => {
                console.error(err)
            });
        }
    }   

}

i don't know the exact function , so i just try the createShape,createMultipointShape function but i didn't get the exact result.

0 Answers
Related