Support Board
Date/Time: Wed, 15 Jan 2025 12:49:15 +0000
Post From: Tool.AddMethod Performance questions
[2017-06-14 14:33:17] |
DabbaDo - Posts: 148 |
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 |
Debug.cht - Attached On 2017-06-14 14:28:51 UTC - Size: 58.33 KB - 352 views ToolPerformance.cpp - Attached On 2017-06-14 14:29:13 UTC - Size: 3.01 KB - 436 views |