Page 1 of 1
Fibonanci Retracement Tool
Posted: Thu Mar 19, 2015 11:47 am
by 16071129
Hi All,
There is no event for FibonanciTool (other than Disposed) present in TeeChart .Net.
We need to select already drawn FibonanciTool using code. How can we achieve the same?
Re: Fibonanci Retracement Tool
Posted: Fri Mar 20, 2015 4:43 pm
by narcis
Hello Quant,
Yes, you are right. I have added your request to bugzilla (
#1174). Does the bug description fit your needs?
Thanks for your collaboration.
Re: Fibonanci Retracement Tool
Posted: Thu Sep 24, 2015 10:00 am
by 16071129
i am using latest version 4.1.2015.08061 but still not getting any event.
Re: Fibonanci Retracement Tool
Posted: Thu Sep 24, 2015 1:30 pm
by Christopher
Hello,
Quant wrote:i am using latest version 4.1.2015.08061 but still not getting any event.
That's because no event was added; however, a Clicked method was added which can be used like this:
Code: Select all
FibonacciTool tool;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tool = new FibonacciTool(tChart1.Chart);
Candle candle = new Candle(tChart1.Chart);
candle.FillSampleValues(40);
tool.StartX = candle.DateValues[0];
tool.StartY = candle.CloseValues[0];
tool.EndX = candle.DateValues[10];
tool.EndY = candle.CloseValues[10];
tool.Series = candle;
tChart1.MouseDown += TChart1_MouseDown;
}
private void TChart1_MouseDown(object sender, MouseEventArgs e)
{
tChart1.Header.Text = "FibonacciTool clicked " + tool.Clicked(e.X, e.Y);
}
Re: Fibonanci Retracement Tool
Posted: Sat Sep 26, 2015 6:23 am
by 16071129
by this way selection can not be highlighted.
I want selector tool to select fibonacci. same as we are selecting rectangle or line.
Re: Fibonanci Retracement Tool
Posted: Mon Sep 28, 2015 7:33 am
by Christopher
Quant wrote:by this way selection can not be highlighted.
You could highlight the tool by changing the Pen colors, e.g.
Code: Select all
private void TChart1_MouseDown(object sender, MouseEventArgs e)
{
bool clicked = tool.Clicked(e.X, e.Y);
for (int i = 0; i < tool.Levels.Count; i++)
{
tool.Levels[i].Pen.Color = clicked ? Color.Fuchsia : Color.Black;
}
tool.TrendPen.Color = clicked ? Color.Fuchsia : Color.Black;
}
Re: Fibonanci Retracement Tool
Posted: Tue Sep 29, 2015 4:28 am
by 16071129
we dont want this work around. we want same way as we select line or rectangle tool.
Re: Fibonanci Retracement Tool
Posted: Tue Sep 29, 2015 8:19 am
by Christopher
Quant wrote:we dont want this work around. we want same way as we select line or rectangle tool.
How do you select a line or a rectangle tool?
Re: Fibonanci Retracement Tool
Posted: Tue Sep 29, 2015 9:36 am
by 16071129
with selector tool
Re: Fibonanci Retracement Tool
Posted: Tue Sep 29, 2015 9:40 am
by Christopher
Quant wrote:with selector tool
I see, thank you. This is quite a different request to the origin request in this thread, and as such has been added to our issue tracking software with
id=1325.
Re: Fibonanci Retracement Tool
Posted: Fri Oct 09, 2015 10:20 am
by Marc
Hello,
Selector marks can be client coded on the Fibonacci Trendline in this way:
Code: Select all
bool isFiboClicked = false;
private void TChart1_MouseDown(object sender, MouseEventArgs e)
{
if (fibonacciTool1.Clicked(e.X, e.Y))
isFiboClicked = true;
else
isFiboClicked = false;
tChart1.Invalidate();
}
private void tChart1_AfterDraw(object sender, Drawing.Graphics3D g)
{
if (isFiboClicked)
{
int startX = tChart1.Axes.Bottom.CalcPosValue(fibonacciTool1.StartX);
int startY = tChart1.Axes.Left.CalcPosValue(fibonacciTool1.StartY);
int endX = tChart1.Axes.Bottom.CalcPosValue(fibonacciTool1.EndX);
int endY = tChart1.Axes.Left.CalcPosValue(fibonacciTool1.EndY);
g.Brush.Solid = true;
g.Brush.Color = Color.Black;
g.Rectangle(startX - 4, startY - 4, startX + 4, startY + 4);
g.Rectangle(endX - 4, endY - 4, endX + 4, endY + 4);
}
}
The Arcs or alternatively drawstyled lines can also have selector marks applied to them, it requires a little more work to extract the values from the Fibonacci class.
Regards,
Marc Meumann