Chart.DrawText problems, need some help
23 Aug 2023, 12:14
I have searched through the whole internet about how to align Chart.DrawText like the picture1 below and yet I got zero answer,

this is my code
…..
//Initialize
protected override void Initialize()
{
isFB = false;
}
//Calculating
public override void Calculate(int index)
{
// Calculate FB
bool isFBCondition = *all of the calculation………*
isFB = isFBCondition;
//FB Signal
if ( isFB )
{
string textFB = "▲";
double yFB = Bars.LowPrices[index] - Symbol.PipSize * 30;
Color colorFB = Color.Yellow;
Chart.DrawText("FB_Signal" + index, textFB, index, yFB, colorFB);
}
}
…..
as you can see my arrow is not aligned to the center of the bar where it should be, could anyone help me to fix this?
Replies
ctid+customer-395444
27 Aug 2023, 15:26
You need to do something like this:
ChartText ct = Chart.DrawText("FB_Signal" + index, textFB, index, yFB, colorFB);
ct.VerticalAlignment = VerticalAlignment.Center;
ct.HorizontalAlignment = HorizontalAlignment.Left;
Play wit the Vertical and Horizontal alignments.
@ctid+customer-395444
PanagiotisChar
24 Aug 2023, 05:24 ( Updated at: 24 Aug 2023, 05:25 )
Hi there,
Better share the complete indicator code so if there is a bug, Spotware can fix it.
Aieden Technologies
Need help? Join us on Telegram
@PanagiotisChar