Login Page - Create Account

Support Board


Date/Time: Sat, 04 May 2024 22:54:28 +0000



GetVolumeAtPriceDataForStudyProfile Index Value During Replay

View Count: 513

[2021-03-09 02:34:42]
yellowandy - Posts: 20
Hi, I have a custom study that is leveraging the volume profiles which are set to a fixed amount of time (1 day). I'm able to access all the data I need from the profile but what I noticed is that when my study is recalculated or loaded I'm never able to access the profile for the current index while it's looping. I specify "0" for the current profile assuming that during the recalculation it would always point to the latest profile at that point in time. Instead it seams as though all of the volume profiles are first calculated and drawn, then my custom study is initiated and looped through and is then always pointing to the very last profile. I am using auto looping and have set the MaintainVolumeAtPriceData flag to true. With GetStudyPeakValleyLine you can pass in -1 to indicate to use the latest one, is there an equivalent for GetNumPriceLevelsForStudyProfile and GetVolumeAtPriceDataForStudyProfile? The docs state it has to be a positive index >= 0;
[2021-03-09 12:39:09]
cbissell - Posts: 4
@SCE
[2021-03-09 13:49:14]
cbissell - Posts: 4
@Ackin
[2021-03-10 15:00:40]
Sierra Chart Engineering - Posts: 104368
Here is the documentation for this function:
sc.GetVolumeAtPriceDataForStudyProfile()

. I specify "0" for the current profile assuming that during the recalculation it would always point to the latest profile at that point in time.
No it definitely does not work this way. You have to determine what the right index to use is.
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
[2021-03-11 05:54:27]
yellowandy - Posts: 20
Well, even if I use GetStudyProfileInformation I could theoretically get the datetime for the current index (during recaculation) and then search through all the profiles to see which one I'm interested in. But the problem is if those profiles have already been created I'll never be able to get an accurate snapshot of that profile for my current index. So for example if my bars are at the minute granularity and I have fixed profiles aggregated at the day level, I will only be able to get the data for that day profile that has already ended. The only other way to do what I want is to basically create my own data structure to store what I need but then I'm basically recreating volume profiles..... Any other ways around this? Why is it the volume profiles aren't calculated at the same time my custom study is calculated?

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

Login

Login Page - Create Account