Support Board
Date/Time: Sat, 15 Mar 2025 08:04:10 +0000
ACSIL Study - Paint on Initial Chart Load/Refresh
View Count: 802
[2022-07-09 16:35:02] |
SavantTrader - Posts: 110 |
I have an ACSIL study which I wrote. It uses the standard loop to extract tick VAP: for (int ElementIndex = 0; ElementIndex < Count; ElementIndex ++){
sc.VolumeAtPriceForBars->GetVAPElementAtIndex(sc.Index, ElementIndex, &p_VolumeAtPriceAtIndex); if (p_VolumeAtPriceAtIndex) { // processing and subgraph update inside here }//endif }//endfor It updates and displays subgraph symbology just fine, but only on bars as they are forming. It does not paint when the chart is initially loaded or refreshed (such as when a study is added). If that's not clear, I'll say it a different way: The study only paints its business on new bars that are forming, and fails to process (older existing) bars upon initial load of the chart. I'm relatively new to ACSIL programming. Can someone please clue me in as to what I need to be doing to get this to paint on initial chart load/refresh, and not just on new bars that are forming? Thank you. Date Time Of Last Edit: 2022-07-10 02:02:55
|
[2022-07-10 05:43:45] |
User99735 - Posts: 234 |
Make sure sc.AutoLoop is set to 1. How is Count being calculated in the code snippet?
|
[2022-07-10 15:22:07] |
SavantTrader - Posts: 110 |
Thank you for lending a hand. sc.AutoLoop is set to 1 here: // Set configuration variables
if (sc.SetDefaults) { sc.AutoLoop = 1; // ... other settings... } ...and Count is being initialized prior to the for loop shown earlier: const s_VolumeAtPriceV2 *p_VolumeAtPrice;
s_VolumeAtPriceV2 *p_VolumeAtPriceAtIndex; int Count = sc.VolumeAtPriceForBars-> GetSizeAtBarIndex(sc.Index); Everything works if I let bars form real-time, but not if I pull up a new chart or cause any type of refresh (such as add a study). Any further clues? I'm sure (as a newbie to ACSIL) it's something I overlooked, perhaps involving how to iterate VAP on refresh? It acts as if the bar's tick-by-tick innards are not being iterated during refresh, but they are when it's a new bar forming. Date Time Of Last Edit: 2022-07-10 15:26:14
|
[2022-07-10 16:13:00] |
User99735 - Posts: 234 |
Also make sure sc.MaintainVolumeAtPriceData is set to 1 (TRUE) in the sc.SetDefaults block.
|
[2022-07-10 16:43:40] |
SavantTrader - Posts: 110 |
Everything is set (I used a sample study as my template): // Set configuration variables
if (sc.SetDefaults) { sc.MaintainVolumeAtPriceData = 1; sc.GraphName = "Bid/Ask Cluster Study (LDP)"; sc.GraphRegion = 0; sc.ScaleRangeType = SCALE_AUTO; sc.AutoLoop = 1; Here's a possible clue, from my debugging attempt. I used the "text display above/below bar" study to show my study's subgraph value(s). As with my problem description, they display zero (for all bars) when a chart is initially loaded, and then start displaying correct values as new bars form. It's as if the code is not iterating individual bar ticks unless it's a new bar forming. I am hoping to understand (via docs + school of hard knocks) enough of ACSIL's idiosyncrasies to become proficient enough to code my own studies which cannot be coded using CBBOAC logic. This one is stumping me, and I feel it has something to do with the fact that I'm iterating an inner (VAP) structure... and perhaps doing something wrong in the process. Date Time Of Last Edit: 2022-07-10 16:50:57
|
[2022-07-10 21:38:26] |
|
Have a look at this function in Studies8.cpp: scsf_VolumeAtPriceArrayTest 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 |
To post a message in this thread, you need to log in with your Sierra Chart account: