Login Page - Create Account

Support Board


Date/Time: Sun, 29 Jun 2025 14:38:32 +0000



Post From: Forcing study update before the function finishes.

[2021-07-30 08:30:17]
P3rri - Posts: 16
Greetings.
I have the following code:
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 that I am getting the same Peak for all 10 iterations cause the VBP does not update even if I move the ending date until the for loop and the whole study function finishes... Is there a way to force update the VBP so I can get the correct peak for each iteration?
Thank you and have a great day.