Login Page - Create Account

Support Board


Date/Time: Sun, 24 Nov 2024 14:41:38 +0000



Custom studies called too often (even when disconnected)

View Count: 395

[2024-04-16 18:51:06]
User145575 - Posts: 20
Hello,

I have a few ACSIL studies I have written. I often do a bit of chart analysis at the end of the day, but I have noticed that my studies are called every 10ms (my chart update interval) even when the market is not moving, and even when I have manually disconnected from the data feed. I first noticed because my CPU/GPU fans were running as they do while the market is moving, but while I was disconnected.
I do have my chart update interval set to 10ms, and that's what I want while I'm trading. But I'd like to be able to disconnect while keeping my charts visible, but my CPU/GPU fans not humming as if I'm trading.

My studies all have sc.AutoLoop = true (but NOT sc.UpdateAlways). I have verified that these are indeed being called every chart update interval by attaching my debugger, setting a breakpoint at the top of my function, and changing the chart update interval, and seeing my breakpoint get hit exactly that often. All while disconnected from the data feed, meaning that none of the usual "When the Study Function is Called" things are happening. So.... why is my study function repeatedly called when it shouldn't?

I've created a smaller chartbook for testing this issue, one with only one chart window, so there is no chance of circular references etc. It still happens in that test chartbook.

Perhaps the workaround for now is to set my update interval to something like 10000000 when I disconnect. But still, this seems like a bug to me, or I have something wrong. Can you advise me on this please?
Thank you!
[2024-04-17 01:50:24]
Sierra_Chart Engineering - Posts: 17156
If one of the studies on the chart has sc.UpdateAlways set to nonzero, all of the studies will be calculated. We are updating the documentation now regarding that. Check if this is the case.

Refer to:
Working with ACSIL Arrays and Understanding Looping: Update Study Function Calls

Working with ACSIL Arrays and Understanding Looping: When the Study Function is Called
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-04-17 03:01:24]
User145575 - Posts: 20
Ah, interesting. Do you know if "Cumulative Delta Bars - Volume" is set to always update? In my testing I pared everything down to just one of my studies that depends on that built-in study. So only the two studies were there, and it was still constantly updating.
[2024-04-17 03:56:34]
Sierra_Chart Engineering - Posts: 17156
Definitely that study does not use UpdateAlways.

Do you still notice continuous updating of the chart when removing all studies from the chart? Although not sure how you would be able to tell that. Check the Window >> Message Log for full recalculations of the chart.
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2024-04-17 03:57:02
[2024-04-17 07:58:58]
User145575 - Posts: 20
Actually, yes, judging by my CPU (just looking in Windows Task Manager) it does seem that SC is using relatively high CPU even if I remove all studies from my chartbook, and disconnect from data feed. Now, "relatively high" in this case with no studies is only 2%, but if I start a brand new chartbook with no studies, and disconnect, the CPU shows 0.0 or 0.1%. Could my chartbook be corrupted somehow, even after I delete all studies from it?
If I remove all studies from my cht except one of my own ACSILs, and all chart windows but the one, connect to data feed and then disconnect, and set a breakpoint, it is definitely updating constantly (whether or not I add the Cumulative Delta Bars dependency). However if I start a new chartbook and just add my study, it does not do that. Very weird! I think I need to try rebuilding my whole chartbook from scratch (not looking forward to that), and seeing if this still happens.

To summarize again:
if I start a new cht and add my study, CPU is "at rest" while data feed disconnected, and my breakpoints aren't hit.
if I remove all studies from my old cht, then re-add my study, CPU is higher even with data disconnected, and my breakpoints are constantly hit.
[2024-04-17 13:35:25]
Sierra_Chart Engineering - Posts: 17156
No:
Could my chartbook be corrupted somehow, even after I delete all studies from it?

There is some reason for the recalculation occurring. See if there is any indication of why in the Window >> Message Log.

If you provide us the Chartbook we can look at the reason. Instructions to attach:
https://www.sierrachart.com/index.php?page=PostingInformation.php#AttachFile
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-04-18 21:34:14]
User145575 - Posts: 20
Sure thing, thanks. Here is the empty chartbook that, when open and disconnected from data, still seems to be using CPU/GPU relative to the length of the update interval. If I close this cht and go to File->New Intraday Chart, cpu/gpu remains very low with that chart.
The Message Log doesn't have any smoking guns that I can see.
Private File
[2024-04-19 14:31:20]
Sierra_Chart Engineering - Posts: 17156
This chart is not calculating or drawing at all when disconnected from the data feed.
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-05-13 22:03:57]
User145575 - Posts: 20
I figured it out. There are two culprits on my chart (which uses 4-tick range bars) :

1) I was using the "Bid & Ask Depth Bars" study, in Sum mode, calculating over 10 levels, as the input to one of my alerts (a Color Background Based On Alert Condition) -- this was a simple "low liquidity indicator" that colors my chart background when the book thins out during news events.

2) I was using the Label Column (of the Market Data Columns) to display the labels of some of my levels (yesterday's low, etc.).

After much experimentation, I discovered that by removing the Bid&Ask study, and unchecking "Show Market Data Columns," my CPU/GPU usage went way down. These were causing continual callbacks to my ACSIL studies, even while disconnected from data (and even though my ACSIL studies don't use these as references/inputs--they are unrelated). I was able to confirm this by setting a breakpoint in my code and attaching to SC. When I re-check "Show Market Data Columns," bam, my breakpoint is hit (not even doing a full recalculate, as on every call I see that sc.Index == sc.ArraySize-1).
Only by removing both of these conditions do things calm down.

I don't know if this is how it's supposed to work, but for now I'll have to do without the Label Column (unless you know of a workaround?), and I'll have to figure out a different way to calculate liquidity on the fly (I'm open to ideas if you have them).
[2024-05-31 19:32:38]
User145575 - Posts: 20
Any thoughts on my previous post? Is there a reason why bid and ask depth bars should be causing calculations even when disconnected? And how about the label column?

I do understand why bid&ask would cause recalcs WHEN connected to data.
[2024-06-02 18:34:27]
Sierra_Chart Engineering - Posts: 17156
These definitely will not cause continuous calculations:
1) I was using the "Bid & Ask Depth Bars" study, in Sum mode, calculating over 10 levels, as the input to one of my alerts (a Color Background Based On Alert Condition) -- this was a simple "low liquidity indicator" that colors my chart background when the book thins out during news events.

2) I was using the Label Column (of the Market Data Columns) to display the labels of some of my levels (yesterday's low, etc.).

Such functionality does not even exist to even cause a recalculation. It simply does not exist at all.
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2024-06-03 00:53:52

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

Login

Login Page - Create Account