Login Page - Create Account

Support Board


Date/Time: Fri, 28 Feb 2025 05:00:56 +0000



Post From: ASCIL - Potential Bug in GetStudyPeakValleyLine.

[2021-07-29 14:45:43]
P3rri - Posts: 16
Greetings,
I have a similar for loop that grabs the the Peak for the next X candles.

sc.Input[0].GetStudyID() -> A VP that I am manipulating.


closing_time = 0.483;
for(i=0; i<10; i++) {
sc.SetChartStudyInputFloat(sc.ChartNumber,sc.Input[0].GetStudyID(), 40, closing_time);

int index_last_peak = 0;

int PeakValleyType = 0;
int StartIndex = 0;
int PeakValleyExtensionChartColumnEndIndex = 0;
float PeakValleyLinePrice = 0;
sc.GetStudyPeakValleyLine(sc.ChartNumber, sc.Input[0].GetStudyID(), PeakValleyLinePrice, PeakValleyType, StartIndex, PeakValleyExtensionChartColumnEndIndex, 0, index_last_peak);

Subgraph[i] = PeakValleyLinePrice;

closing_time = closing_time + 0.05 //Increasing the time to move the profile more to the right.
}

The problem is, even if the Peak changed on the meantime for some reason all the 10 iterations will give first's iterations Peak value. So if the first PeakValleyLinePrice is 4000.00 all of them are gonna be 4000.00 even if I am setting PeakValleyLinePrice = 0 and again setting it with the function.
I do not think I am doing something wrong, I tried a lot of different variables and everything else works. If I try to get the next 10 sc.Highs I can, without having a problem but when I am trying to get the Peak I am getting the same results for all 10 iterations(all same like first one).

Could you please have a look, looks like a bug to me.
Thank you, have a great day!
Date Time Of Last Edit: 2021-07-29 16:17:44