Login Page - Create Account

Support Board


Date/Time: Sat, 18 May 2024 14:09:55 +0000



Post From: Tool.AddMethod Performance questions

[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 - 247 views
attachmentToolPerformance.cpp - Attached On 2017-06-14 14:29:13 UTC - Size: 3.01 KB - 300 views