Login Page - Create Account

Support Board


Date/Time: Tue, 04 Mar 2025 16:06:21 +0000



[Programming Help] - Finding Previous High Behind Latest High

View Count: 776

[2019-06-24 20:27:05]
User439067 - Posts: 48
Hello.

I'm using sc.GetIndexofHighestValue to get the index.

I need the high immediately preceding that.

How can I manual loop backwards starting from GetIndexofHighestValue to find the previous high?

  //for(auto index = index_of_highest_value - 1; counter != 2; --index) 
  //{ 
  //  if (sc.High[index - 1] > sc.High[index] && counter == 0) 
  //  { 
  //    counter = 1; 
  //  } 
 
  //  if (sc.High[index - 1] < sc.High[index] && counter == 1) 
  //  { 
  //    counter = 2; 
  //    index_of_highest_value = index; 
  //  } 
 
  //}

The code results in an endless loop.

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

Login

Login Page - Create Account