Hello,
I’m trying to display the value of the bars in the Market Profile chart. I was trying to add a text for each bar created but I don’t know where to find the surface position to instantiate the text.
This is the part of the code where the bars are created.
for (int i = 0; i < ticksPerCandle; i++)
{
_index++;
volume = _random.Next(100);
bidOrAsk = _random.Next(2) == 0 ? BidOrAsk.Bid : BidOrAsk.Ask;
//date = date;
var newTick = _data[_index];
var open = _dataSeries0.OpenValues[_candleCount - 1];
high = _dataSeries0.HighValues[_candleCount - 1];
high = high > newTick ? high : newTick;
low = _dataSeries0.LowValues[_candleCount - 1];
low = low < newTick ? low : newTick;
var meta = (CandlestickMetaData)_dataSeries0.Metadata[_candleCount - 1];
meta.AddTick(new CandleTick
{
BidOrAsk = bidOrAsk,
Price = newTick,
Volume = volume,
TimeStamp = date
});
- Spanish Geek asked 4 years ago
- You must login to post comments
Hi! I did some research and I thought some options.
Is there any way to add an annotation in the CandlestickMetaData?
The horizontal bars are generated with the AddTick() function of the CandlestickMetaData. I couldn’t find any property to grab the exact X and Y coordinates to instantiate a text or annotation.
This is how the horizontal bars are created
var meta = (CandlestickMetaData)_dataSeries0.Metadata[_candleCount - 1];
meta.AddTick(new CandleTick
{
BidOrAsk = bidOrAsk,
Price = newTick,
Volume = volume,
TimeStamp = date
});
Also, I don’t know if annotations are the best way to approach this problem. So maybe it’s possible to add a text block but I have the same problem to find the XY coordinates.
- Spanish Geek answered 4 years ago
- You must login to post comments
Please login first to submit.