Support Board
Date/Time: Sun, 24 Nov 2024 14:38:05 +0000
Post From: Custom studies called too often (even when disconnected)
[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). |