Login Page - Create Account

Support Board


Date/Time: Sun, 28 Apr 2024 09:56:41 +0000



Post From: GetStudyPeakValleyLine doesn't work correctly with Volume by Price studies

[2018-11-18 21:17:51]
Usermb - Posts: 126
GetStudyPeakValleyLine() doesn't seem to be working correctly for Volume by Price studies: the value returned in PeakValleyType is always 0 (PEAKVALLEYTYPE_NONE), even when the value of PeakValleyLinePrice and StartIndex is set correctly.
Furthermore the value returned by GetStudyPeakValleyLine() is correct and as expected not zero for PeakValleyIndex between 0 and up to (but excluding) the number of levels in the profile.

The behaviour is the same for "Multiple Profiles" period type or for a single one.

Given a "Multiple Profiles" period type, ProfileIndex seems to be inconsistent across functions:
- GetNumPriceLevelsForStudyProfile must have ProfileIndex set to 1 to reference the prior profile (second from right to left). 0 refences the most recent profile (most to the right)
- GetStudyPeakValleyLine must have ProfileIndex set to -1 to reference the most recent profile. ProfileIndex=0 refers to the first profile in the chart (the one starting at bar index 0), ProfileIndex=1 references the one next towards right after the one with ProfileIndex=0 and so on. Setting ProfileIndex to lower than zero seems to always reference the most recent profile (most to the right). It doesn't appear to be possible to reference the prior profile.

I didn't test it with TPO profiles.