Fibonanci Retracement Tool

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Quant
Advanced
Posts: 142
Joined: Tue Dec 30, 2014 12:00 am

Fibonanci Retracement Tool

Post by Quant » Thu Mar 19, 2015 11:47 am

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?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Fibonanci Retracement Tool

Post by Narcís » Fri Mar 20, 2015 4:43 pm

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Quant
Advanced
Posts: 142
Joined: Tue Dec 30, 2014 12:00 am

Re: Fibonanci Retracement Tool

Post by Quant » Thu Sep 24, 2015 10:00 am

i am using latest version 4.1.2015.08061 but still not getting any event.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Fibonanci Retracement Tool

Post by Christopher » Thu Sep 24, 2015 1:30 pm

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);
    }
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Quant
Advanced
Posts: 142
Joined: Tue Dec 30, 2014 12:00 am

Re: Fibonanci Retracement Tool

Post by Quant » Sat Sep 26, 2015 6:23 am

by this way selection can not be highlighted.
I want selector tool to select fibonacci. same as we are selecting rectangle or line.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Fibonanci Retracement Tool

Post by Christopher » Mon Sep 28, 2015 7:33 am

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;
    }
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Quant
Advanced
Posts: 142
Joined: Tue Dec 30, 2014 12:00 am

Re: Fibonanci Retracement Tool

Post by Quant » Tue Sep 29, 2015 4:28 am

we dont want this work around. we want same way as we select line or rectangle tool.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Fibonanci Retracement Tool

Post by Christopher » Tue Sep 29, 2015 8:19 am

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?
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Quant
Advanced
Posts: 142
Joined: Tue Dec 30, 2014 12:00 am

Re: Fibonanci Retracement Tool

Post by Quant » Tue Sep 29, 2015 9:36 am

with selector tool

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Fibonanci Retracement Tool

Post by Christopher » Tue Sep 29, 2015 9:40 am

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.
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Marc
Site Admin
Site Admin
Posts: 1265
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Fibonanci Retracement Tool

Post by Marc » Fri Oct 09, 2015 10:20 am

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
Steema Support

Post Reply