Trendline with Snap to Point & Semi log Aware Trendline
Trendline with Snap to Point & Semi log Aware Trendline
Here we have 2 requirements:
1] Draw Line with Snap to Point
This requires drawing a Line with "Snap to Point" option similar as Cursor Tool's Snap Feature.
2] Semi Log Aware Line [Dependent on requirement 1]
Say e.g. we have a normal Candle Series and we draw the line which is based on this candle series. Now assume that we changed this Candle to Logarithmic with log base equal to 10. Since the previously drawn line is based on Candle Series this line should now updated as per the Logarithmic Candle Series. In this transformation the line may change its appearance from straight line to curved line. Same can happen vice versa.
Please help us in solving above two requirements.
1] Draw Line with Snap to Point
This requires drawing a Line with "Snap to Point" option similar as Cursor Tool's Snap Feature.
2] Semi Log Aware Line [Dependent on requirement 1]
Say e.g. we have a normal Candle Series and we draw the line which is based on this candle series. Now assume that we changed this Candle to Logarithmic with log base equal to 10. Since the previously drawn line is based on Candle Series this line should now updated as per the Logarithmic Candle Series. In this transformation the line may change its appearance from straight line to curved line. Same can happen vice versa.
Please help us in solving above two requirements.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Trendline with Snap to Point & Semi log Aware Trendline
Hello Quant,
Would you be so kind as to send us some example code you have already written to implement these requirements of yours?
It would save us a lot of time to work on what you have already done rather than writing an application for you from scratch. If you could also send us some screenshots of what functionality you would like to see in your code but haven't been able to implement, that would also be greatly appreciated.
Would you be so kind as to send us some example code you have already written to implement these requirements of yours?
It would save us a lot of time to work on what you have already done rather than writing an application for you from scratch. If you could also send us some screenshots of what functionality you would like to see in your code but haven't been able to implement, that would also be greatly appreciated.
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 |
Re: Trendline with Snap to Point & Semi log Aware Trendline
We yet to start work on this, but we can explain you both the requirement in more detail.
1] Draw Line with Snap to Point (Check below Image 1):
As shown in the screenshot we draw two trend lines. The Pink Line is normal line without Snap to Point Option. Whereas the Green Line as you see are attached to series points. Green line is drawn using Snap to Point Option. Both Start and End points of Green Line are attached to CandleStick Series. 2] Semi Log Aware Line
Image 2 shows Line Drawn on series whose Logarithmic Property is Set to True.
Whereas Image 3 shows the same Line on same series whose Logarithmic Property is Set to False.
By clearly looking at both the image, you can clearly make out the difference in Image 3 that the blue line is now has the appearance of Curved Line.
The line shown in Image 3 is actual Semi Log Aware Trend Line.
1] Draw Line with Snap to Point (Check below Image 1):
As shown in the screenshot we draw two trend lines. The Pink Line is normal line without Snap to Point Option. Whereas the Green Line as you see are attached to series points. Green line is drawn using Snap to Point Option. Both Start and End points of Green Line are attached to CandleStick Series. 2] Semi Log Aware Line
Image 2 shows Line Drawn on series whose Logarithmic Property is Set to True.
Whereas Image 3 shows the same Line on same series whose Logarithmic Property is Set to False.
By clearly looking at both the image, you can clearly make out the difference in Image 3 that the blue line is now has the appearance of Curved Line.
The line shown in Image 3 is actual Semi Log Aware Trend Line.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Trendline with Snap to Point & Semi log Aware Trendline
Quant,
A couple of questions:
1) which algorithm are you using to calculate the points that are drawn in the trendline?
2) the snap to point functionality ... how do you want this to work? Which if the OHLC (open, high, low, close) points do you want the line to snap to when the mouse is moved?
A couple of questions:
1) which algorithm are you using to calculate the points that are drawn in the trendline?
2) the snap to point functionality ... how do you want this to work? Which if the OHLC (open, high, low, close) points do you want the line to snap to when the mouse is moved?
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 |
Re: Trendline with Snap to Point & Semi log Aware Trendline
Hi,
Currently we are not using any algorithm for calculating points that are drawn in the trendline. We are using Line Tool for drawing trendline.
I can suggest you algorithm that is TeeChart currently using for Tool "Nearest Point".
For the Snap Point functionality yes we want the line to snap when the mouse is moved.
Currently we are not using any algorithm for calculating points that are drawn in the trendline. We are using Line Tool for drawing trendline.
I can suggest you algorithm that is TeeChart currently using for Tool "Nearest Point".
For the Snap Point functionality yes we want the line to snap when the mouse is moved.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Trendline with Snap to Point & Semi log Aware Trendline
Okay ... so how do you expect the line to "bend" as you require? For this to happen more than two points (start, end) are necessary.Quant wrote: Currently we are not using any algorithm for calculating points that are drawn in the trendline. We are using Line Tool for drawing trendline.
Please do not forget that even without the TeeChart source code you have access to this algorithm - the TeeChart.dll is not obfuscated, which means you can easily use tools such as reflector or ILSpy to copy code.Quant wrote: I can suggest you algorithm that is TeeChart currently using for Tool "Nearest Point".
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 |
Re: Trendline with Snap to Point & Semi log Aware Trendline
Hi,
We did R&D on the mentioned requirement in this post, but we yet to get solution on this.
Please provide us with some sample code.
We did R&D on the mentioned requirement in this post, but we yet to get solution on this.
Please provide us with some sample code.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Trendline with Snap to Point & Semi log Aware Trendline
Hello Quant,
To be able to understand which is your exact requirement you should answer the questions Christopher Ireland made you before:
Thanks in advance.
To be able to understand which is your exact requirement you should answer the questions Christopher Ireland made you before:
Christopher wrote: 2) the snap to point functionality ... how do you want this to work? Which if the OHLC (open, high, low, close) points do you want the line to snap to when the mouse is moved?
Christopher wrote: Okay ... so how do you expect the line to "bend" as you require? For this to happen more than two points (start, end) are necessary.
Did you look at that, which problems did you come across?
Thanks in advance.
Best Regards,
Narcís Calvet / 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 |
Re: Trendline with Snap to Point & Semi log Aware Trendline
Hi,
1] Snap to Point Functionality should work on selected series data. It can be OHLC, Line or Volume etc.
2] I explained the same point in more details (with images), in this post. Yes sometimes we need more than two points to achieve this.
3] Currently we have not looked in your source code, but as we have to deliver these requirements asap, we do not have much time to follow this step. It would be very great if you help us in fulfilling these requirements.
1] Snap to Point Functionality should work on selected series data. It can be OHLC, Line or Volume etc.
2] I explained the same point in more details (with images), in this post. Yes sometimes we need more than two points to achieve this.
3] Currently we have not looked in your source code, but as we have to deliver these requirements asap, we do not have much time to follow this step. It would be very great if you help us in fulfilling these requirements.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Trendline with Snap to Point & Semi log Aware Trendline
Hi Quant,
You could try using NearestPoint tool GetNearestPoint method as Yeray explained here to snap points to your series.
You could try using NearestPoint tool GetNearestPoint method as Yeray explained here to snap points to your series.
Best Regards,
Narcís Calvet / 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 |
Re: Trendline with Snap to Point & Semi log Aware Trendline
Hi,
We need an example for Semi Log Aware Trendline, which we have explained with image in this post.
We did our research on this but still we haven't found any solution.
We need an example for Semi Log Aware Trendline, which we have explained with image in this post.
We did our research on this but still we haven't found any solution.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Trendline with Snap to Point & Semi log Aware Trendline
Hello,
My colleague Narcís has been kind enough to produce a simple mock-up of what we understand as your requirement, which is here:
I hope you can use this very simple example to further explain to us exactly what your requirements are.
Can you please explain the specific problems you encountered in your research of this functionality?Quant wrote:We did our research on this but still we haven't found any solution.
My colleague Narcís has been kind enough to produce a simple mock-up of what we understand as your requirement, which is here:
Code: Select all
private Steema.TeeChart.Styles.Candle candle1;
private Steema.TeeChart.Tools.NearestPoint nearestPoint1;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart1.Zoom.Direction = Steema.TeeChart.ZoomDirections.None;
tChart1.Panning.Allow = Steema.TeeChart.ScrollModes.None;
candle1 = new Steema.TeeChart.Styles.Candle(tChart1.Chart);
candle1.FillSampleValues();
nearestPoint1 = new Steema.TeeChart.Tools.NearestPoint(candle1);
nearestPoint1.Active = false;
tChart1.MouseDown += tChart1_MouseDown;
tChart1.MouseMove += tChart1_MouseMove;
tChart1.MouseUp += tChart1_MouseUp;
}
void tChart1_MouseUp(object sender, MouseEventArgs e)
{
if (!multiPointLine && (index != -1))
{
AddNewPoint(new Point(e.X, e.Y));
}
index = -1;
}
private void AddNewPoint(Point point)
{
int newIndex = nearestPoint1.GetNearestPoint(point);
tChart1[tChart1.Series.Count - 1].Add(candle1.XValues[newIndex], candle1.YValues[newIndex]);
}
void tChart1_MouseMove(object sender, MouseEventArgs e)
{
if (multiPointLine && (index != -1))
{
AddNewPoint(new Point(e.X, e.Y));
}
}
private int index = -1;
void tChart1_MouseDown(object sender, MouseEventArgs e)
{
index = nearestPoint1.GetNearestPoint(new Point(e.X, e.Y));
if (index != -1)
{
tChart1.Series.Add(new Steema.TeeChart.Styles.Line());
tChart1[tChart1.Series.Count - 1].Add(candle1.XValues[index], candle1.YValues[index]);
}
}
private bool multiPointLine = false;
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
multiPointLine = checkBox1.Checked;
}
private void checkBox2_CheckedChanged(object sender, EventArgs e)
{
tChart1.Axes.Left.Logarithmic = checkBox2.Checked;
}
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 |
Re: Trendline with Snap to Point & Semi log Aware Trendline
Dear Steema,
We checked your code, but it is not what we expected. Last time we explained the same with some screenshots. Please take look of this post once again. If you still have difficulty to understand the same, please let us know.
We checked your code, but it is not what we expected. Last time we explained the same with some screenshots. Please take look of this post once again. If you still have difficulty to understand the same, please let us know.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Trendline with Snap to Point & Semi log Aware Trendline
Without a mathematical or algorithmic explanation of your requirement, I'm afraid we cannot help. Images are simply not enough as a basis for us to implement it, I'm afraid.Quant wrote:We checked your code, but it is not what we expected. Last time we explained the same with some screenshots. Please take look of this post once again. If you still have difficulty to understand the same, please let us know.
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 |
Re: Trendline with Snap to Point & Semi log Aware Trendline
watch this video which explain semi log in Excel
*Line is converted to log curve *
http://www.youtube.com/watch?v=y55VmSIMBjE
for mathematical formula use below link
https://en.wikipedia.org/wiki/Semi-log_plot
*Line is converted to log curve *
http://www.youtube.com/watch?v=y55VmSIMBjE
for mathematical formula use below link
https://en.wikipedia.org/wiki/Semi-log_plot