Login Page - Create Account

Support Board


Date/Time: Sat, 18 May 2024 23:30:46 +0000



Faster Relative Volume study

View Count: 1391

[2017-02-13 22:43:25]
DabbaDo - Posts: 146
For what it's worth, attached is a version of Relative Volume that is faster than the one supplied with Sierra Chart. I made minimal modifications to the scsf_RelativeVolume function in Studies8.cpp (version 1518).
Using 1 minute bars, 1000 Days to Load, and the default settings except Period - Days To Include = 60, the original indicator takes roughly 5 seconds on my machine. The revised indicator takes considerably less than 1 second. (I didn't try to make precise measurements.)
The technique is simply to use a tiny bit of memory to remember PriorIndex values rather than use sc.GetContainingIndexForSCDateTime().
As far as I can tell, the new study results are identical to those for the original study.
attachmentNewRelativeVolume.cpp - Attached On 2017-02-13 22:35:46 UTC - Size: 8.82 KB - 351 views
[2017-02-14 04:42:14]
Sierra Chart Engineering - Posts: 104368
We are implementing a performance enhancement similar but utilizing one of the persistent data maps.
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-02-14 13:09:41]
DabbaDo - Posts: 146
I see the V1519 changes in Studies8.cpp scsf_RelativeVolume().
I have some questions:
1. Ln 7236: sc.ClearAllPersistentData() seems to have an obvious function, and seems helpful. But do you agree it is undocumented?
2. Ln 7315: sc.GetContainingIndexForSCDateTime() in my 1000-day 1m test case is called more than 270,000 times, I think, once for each bar, each with a different key. But the documentation at http://www.sierrachart.com/index.php?page=doc/ACSIL_Members_Functions.html#scGetPersistentInt says the limit is 5000 keys, after which they are not persisted. Are the first 5000 persisted, or the most recent 5000?

Your new version doesn't seem to significantly address the O(N^2) speed issue, as it still calls c.GetContainingIndexForSCDateTime() for all 270K+ bars, and each call averages 135K+ inspections of sc.BaseDateTimeIn array elements.

[I'm not trying to cause trouble; I just want to understand. Sierra Chart is terrific software, VERY far ahead of the competition in my opinion.]

Cheers,
Dale
[2017-02-14 15:18:22]
Sierra Chart Engineering - Posts: 104368
We are not finished and we have not even thought through the changes carefully or done any testing.

We have no comments now.
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-02-14 18:04:30]
Sierra Chart Engineering - Posts: 104368
We want to let you know that these changes were done quickly without thoroughly understanding the code. The original code was done by a different developer.

They may not even make sense. We are still thinking through this. Pay no attention to what we have done already and it may not even work correctly anyway.
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-02-14 18:04:43
[2017-02-14 18:07:06]
DabbaDo - Posts: 146
Sure, that makes sense.
And I'm working on a bug in the code I supplied - ignore it as well.
[2017-02-15 10:44:16]
DabbaDo - Posts: 146
Attached is the corrected version of the code I had attached earlier.
To recap the speed difference:
Chart:
ESH7 1 Minute bars Using Extended Session
Days To Load = 500
Study parameters default except:
Period - Days To Include 60
Day Session Only = No
Times:
Original: ~7 seconds
Attached: ~1 second

I understand you might want to rewrite this indicator, but it's not necessary for me.
I'm just posting here in case it's useful to someone.
I'm happy, and this "support request" can be closed as far as I'm concerned.

Cheers,
Dale
Attachment Deleted.
attachmentBruRelativeVolume.cpp - Attached On 2017-02-15 10:33:06 UTC - Size: 9.48 KB - 374 views
[2017-02-15 18:05:10]
Sierra Chart Engineering - Posts: 104368
OK thank you for this.

If someone wants to use that particular CPP file attached to the prior post, refer to the instructions here:
http://www.sierrachart.com/index.php?page=doc/BuildCustomStudiesDLL.html
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
[2019-03-30 16:12:49]
User428493 - Posts: 20
Hi SC! May I ask you to upgrade Relative Volume indicator? I use it in many charts (not only with volume) and it works slow :( Maybe there is a chance for quick fix? It's really very-very important for me. Thank you!
[2019-03-30 20:32:01]
Sierra Chart Engineering - Posts: 104368
Do you mean the calculation time is too high? The first thing to do is to increase the time frame per chart bar:
Changing Chart Bars Period
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
[2019-03-30 21:36:48]
User428493 - Posts: 20
Yes. I use 5-15-60 min charts. 5min chart with 50 days look back period shows 150 ms (all other studies 0-1 ms) in studies menu. I have 6-10 charts in one chartbook and when I switch between my chartbooks - it takes time to draw all the charts. I understand that there is no problem with speed on 240+ min charts (60 min chart shows 23 ms on 50 days look back period), but I really need 5-15 min charts too.

I even tried to build the .cpp file above, but it doesn't work (SC crashes).
Date Time Of Last Edit: 2019-03-30 21:40:30

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

Login

Login Page - Create Account