Login Page - Create Account

Support Board


Date/Time: Sun, 05 May 2024 10:30:32 +0000



Tool.AddMethod Performance questions

View Count: 907

[2017-06-14 14:33:17]
DabbaDo - Posts: 146
Attached is a study and a chartbook supporting my question.
Version 1568, Windows 10
The Tools.AddMethod methods for Add_Only_If_New and Add_Or_Adjust seems surprisingly slow, in a non-linear fashion (not a square function, but nearly).
For example, with QQQ 1 Minute chart, last 30 days, I have 11,804 bars (UES).
I get these results, using the wonderful time measurements on the studies dialog:
21 ms UTAM_ADD_ALWAYS Draw an X at the top of each bar
3308 ms UTAM_ADD_ONLY_IF_NEW Draw an X at the top of each bar. Called with Tool.LineNumber = -1 every time;
9114 ms UTAM_ADD_OR_ADJUST Draw an X at the top of each bar, then move it to to the next bar, resulting in a X at the top of the last bar only.
4634 ms UTAM_ADD_ALWAYS then Delete. Draw an X at the top of each bar, then Delete it before the next bar, resulting in a X at the top of the last bar only.

The numbers jump around a lot. For example, if I only run the first and third:
39 ms UTAM_ADD_ALWAYS Draw an X at the top of each bar
4372 ms UTAM_ADD_OR_ADJUST Draw an X at the top of each bar, then move it to to the next bar, resulting in a X at the top of the last bar only.

And there seems to be interaction between the study instances on the chart: For example, if I only run the fourth one:
34 ms UTAM_ADD_ALWAYS then Delete. Draw an X at the top of each bar, then Delete it before the next bar, resulting in a X at the top of the last bar only.

Bottom line, I typically more-complex coding to use the fourth case, UTAM_ADD_ALWAYS then Delete, rather than use UTAM_ADD_OR_ADJUST because of the huge performance difference on larger bar sizes. I think I must be missing something.

Thanks,
Dale
attachmentDebug.cht - Attached On 2017-06-14 14:28:51 UTC - Size: 58.33 KB - 245 views
attachmentToolPerformance.cpp - Attached On 2017-06-14 14:29:13 UTC - Size: 3.01 KB - 296 views
[2017-06-15 01:15:18]
Sierra Chart Engineering - Posts: 104368
All of this does make sense when you understand what is happening at a lower level. We are working on documentation for all of this. Give us a couple of days.

In general, any type of AddMethod that has to search the Chart Drawing container to see if the drawing exists, is going to take longer and the larger the container is of drawings, the longer it takes.


And there seems to be interaction between the study instances on the chart: For example, if I only run the fourth one:
34 ms UTAM_ADD_ALWAYS then Delete. Draw an X at the top of each bar, then Delete it before the next bar, resulting in a X at the top of the last bar only.
This is very efficient because only a single drawing is being added to the chart and then deleted. So when you are deleting the drawing, it is found on the very first iteration when searching for the one to delete.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2017-06-15 01:15:52
[2017-06-16 02:24:08]
Sierra Chart Engineering - Posts: 104368
We are done with the documentation:
https://www.sierrachart.com/index.php?page=doc/ACSILDrawingTools.html#AddMethod

We have also done some performance improvements which will be out in the next release.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2017-06-16 06:29:40]
Sierra Chart Engineering - Posts: 104368

3308 ms UTAM_ADD_ONLY_IF_NEW Draw an X at the top of each bar. Called with Tool.LineNumber = -1 every time;

You will notice a huge performance improvement with this particular operation in version 1571.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account