Page 1 of 1

OnGetMarkText - Event of a TBigCandleSeries

Posted: Thu Oct 16, 2008 12:32 pm
by 10549438
Hello,

I'm using the "OnGetMark"-Event of a TBigCandleSeries to set some Marks visible and the other Marks of the Series invisible.

In this Event i'm comparing the var "MarkText" with Values calculated in my Application:

Code: Select all

if ((MarkText=FloatToStr(MinMarkValue[0])) or (MarkText=FloatToStr(MaxMarkValue[0]))) then
 Series1.Marks.Item[ValueIndex].Visible := True;
But the "MarkText"-String only contains the Candle close-Values of each TBigCandleSeries-Point. How can I get the other values of a BigVCandleSeries-Point like Open, High, Low in the MarkText-String to compare if the Mark has to be visible or not?

Best Regards.

Posted: Thu Oct 16, 2008 1:09 pm
by narcis
Hi Woehr.Mi,

In that case you can also use ValueIndex argument for retrieving other values, for example:

Code: Select all

procedure TForm1.Series1GetMarkText(Sender: TChartSeries;
  ValueIndex: Integer; var MarkText: String);
var
  tmpStr: String;
begin
  tmpStr:=FloatToStr(Series1.OpenValues[ValueIndex]) + ', ' +
          FloatToStr(Series1.HighValues[ValueIndex]) + ', ' +
          FloatToStr(Series1.LowValues[ValueIndex]) + ', ' +
          FloatToStr(Series1.CloseValues[ValueIndex]);

  MarkText:=tmpStr;
end;

Posted: Thu Oct 16, 2008 1:18 pm
by 10549438
Thanks NarcĂ­s,

now it works the way I want.

with best regard's.

Michael

Posted: Fri Oct 17, 2008 11:48 am
by 10549438
Hello Narcis,

I've got one more question about the Marks of a TBigCandleSeries. How is it possible to draw lines from the Mark (with the Value) to the corresponding Point in the TBigCandleSeries (Min, Max, Open and Close).

In TLineSeries it works fine.There I've enabled the option Marks-Arrows-Pointer = visible.

With best regards.

Michael

Posted: Fri Oct 17, 2008 1:12 pm
by narcis
Hi Michael,

Sorry but I'm not sure about what you are trying to achieve. Would you like a mark arrow from the mark to Open, High, Low and Close values? This would mean 4 arrows each mark or would you like 4 marks per value?

Thanks in advance.

Posted: Fri Oct 17, 2008 1:26 pm
by 10549438
Hi, Narcis.

When you enable the Marks of a TBigCandleSeries you have 4 single Marks around every Series-Point (High, Open, Close, Low).
And when I have Series-Points, that are very close to the next one, it's often not easy to see to which Candle-Point they belong.

So I want to draw one arrow (or line) per Mark to the corresponding value (High, Open, Close, Low) of the TBigCandleSeries.

Posted: Tue Oct 21, 2008 11:23 am
by narcis
Hi Woehr.Mi,

In that case the only solution we can think of is using annotation tools for each mark and manually set a custom position for the annotations according to series' values and using CalcXPos/CalcYPos and CalcXPosValue and CalcYPosVAlue methods, for example:

http://www.teechart.net/support/viewtopic.php?t=6155
http://www.teechart.net/support/viewtopic.php?t=6527

For the arrows you can manually draw them in the chanvas using Chart1.Canvas.Arrow method.

Hope this helps!