Support Board
Date/Time: Thu, 28 Nov 2024 13:49:07 +0000
ACSIL GetStudyPeakValleyLine results don't update when profile is moved
View Count: 358
[2023-04-28 00:33:26] |
User145575 - Posts: 20 |
Hello, I'm working on a study that takes as an input the studyId of a user drawn volume profile. On certain events it loops through and gets that VP's peaks/valleys and performs some calculations from them. On other events, the study moves the profile (let's say for example it drags the "end time" of the profile forward on a new high in price) using SetChartStudyInputFloat etc. (this works--I see the profile move to the new location). After moving the profile, it re-fetches the peaks/valleys by looping through and calling GetStudyPeakValleyLine() as before. Unfortunately, it is returning the same peaks/valleys as the first time, as if the internal representation in ACSIL didn't change. Even though graphically I see that the peaks/valleys have updated on the chart. An interesting thing is, I had a very similar study maybe 2 years ago, and I'm pretty sure it worked then -- my study could drag the VP around and get the updated peaks/valleys. But my new study -- and a recompiled version of that old study -- both don't appear to get the updated peaks/valleys now. I have set breakpoints and stepped through and looked at the results, and I can't think of what I'm doing wrong. Do you have any advice? |
[2023-04-28 08:43:11] |
User431178 - Posts: 544 |
After moving the profile, it re-fetches the peaks/valleys by looping through and calling GetStudyPeakValleyLine() as before.
Do you mean in the same function call, after you move the profile programmatically? The VBP won't be calculated until after your study function returns, so you would need to update the PV lines on the next call. |
[2023-04-28 09:10:51] |
Sierra_Chart Engineering - Posts: 17201 |
Yes post #2 is correct.
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 |
[2023-04-28 19:31:40] |
User145575 - Posts: 20 |
Ah, indeed you are right. I made some code changes and I see it working this way *in realtime or replay*. However, when sc.IsFullRecalculation is true (e.g. when I first load the study), the peaks/valleys are still not updating between calls. It would be nice to see what my study would have calculated further back on the chart. |
[2023-04-30 22:00:27] |
User145575 - Posts: 20 |
Should the peaks/valleys be updating between loop iterations during a study initialization/recalculation? Or only during realtime/replay when the profile is graphically rendered? Obviously I would like to have the valleys during init/recalc, but if it's not possible I'd like to know so I can work around it.
|
[2023-05-01 04:21:07] |
Sierra_Chart Engineering - Posts: 17201 |
Should the peaks/valleys be updating between loop iterations during a study initialization/recalculation? Assuming we understand you correctly the answer is no.The recalculation would only take place, after all studies on the chart are calculated and then at the next chart update interval, the Volume by Price study will be recalculated. 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: 2023-05-01 04:21:25
|
To post a message in this thread, you need to log in with your Sierra Chart account: