Tech Study CPU issue

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
DaveR
Newbie
Newbie
Posts: 23
Joined: Tue Feb 07, 2012 12:00 am

Re: Tech Study CPU issue

Post by DaveR » Wed Jul 25, 2012 1:37 pm

I had missed your Button3 code in that sample you created. I dropped in a new button to be able to use it and saw the same thing you experienced, no problem blowing out the Selector tool. I wonder if it has to do with the properties that I am setting when creating a Bollinger Band study. It could be things like the PeriodAlign and/or the PeriodStyle settings in use. At any rate, it does happen with the code that I sent to you. Perhaps you can determine what I am doing that is causing it.

I did upload a file to you just now, tStudyBBands.vb. That will show you how I am creating the study. In mine, I do not use PeriodAlign or PeriodStyle. I set the regular tChart.Period property to 1 and have my own Period property in the tStudy class. Basically, I set all the properties for the first Bollinger Band line. The .Span property is my "Period" setting in my class. Your .Period property is set to 1. Notice my WhichLine property below. That indicates that this particular class will actually calculate the study values.

Dim line1 As New Steema.TeeChart.Styles.Line(TChart1.Chart)
Dim Bollinger1 As New tStudyBBandsCls
Bollinger1.Deviation = DT.Rows(0).Item("Deviations")
Bollinger1.Span = DT.Rows(0).Item("Period")
Bollinger1.WhichLine = 0
Bollinger1.Period = 1
Bollinger1.PeriodAlign = Functions.PeriodAligns.Last
Bollinger1.PeriodStyle = Functions.PeriodStyles.NumPoints


Then I create a second line function with a second instance of that class. Properties are set similarly there, but not really used. The ones that really count are:

Bollinger2.WhichLine = 1
Bollinger2.BBandTopCol = Bollinger1.BBandTopCol

The first line here tells the class that it is not one that calculates the values, it simply gets the data from a different class. The second line sets the data source to the data calculated in the class used for the first Bollinger Band line.

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

Re: Tech Study CPU issue

Post by Narcís » Thu Jul 26, 2012 10:45 am

Hi DaveR,

Thanks for the code and feedback.
The first line here tells the class that it is not one that calculates the values, it simply gets the data from a different class. The second line sets the data source to the data calculated in the class used for the first Bollinger Band line.
If I understand this correctly, you are using 2 series as Bollinger implementation in TeeChart does. Notice that when assigning a DataSource to a series this data will be copied into the series. Series need to have values to be able to calculate their positions in the screen and being plotted. So I would not expect any memory usage difference here.
The net effect is that you get both lines, but you only have one set of calculations going.
Having in mind what I said before and looking at the implementation of Bollinger function in TeeChart, it's true that there are two calls to the InternalAddPoints method, one for each series in the function. This may add CPU overhead to the calculation so we will also look at your code more deeply to see if this can help improving TeeChart's Bollinger function.
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

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Tech Study CPU issue

Post by Sandra » Tue Oct 02, 2012 1:43 pm

Hello DaveR,

I inform you that the bug number [TF02016256] is already fixed for next maintenance release of TeeChartFor.Net. I recommend you to be aware at this forum, our RSS news feed, twitter and facebook accounts for new release announcements and what's implemented on them.

Thanks,
Best Regards,
Sandra Pazos / 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

Post Reply