Login Page - Create Account

Support Board


Date/Time: Mon, 29 Apr 2024 16:31:45 +0000



[Programming Help] - Check for Range (Highs-Lows)

View Count: 673

[2017-06-13 16:51:49]
rhovega - Posts: 279
Presume outside support, but any chance you could tell me why the following two statements to not yield the same result?

if (sc.GetHighest(sc.High, 10) - sc.GetLowest(sc.Low, 10) > 3)
do something;

vs

int x, z;
for (x = 0, z = 0; x <= 9, z <=9; x++, z++)
{ if (sc.High[sc.Index-x] - sc.Low[sc.Index-z] > 3)
do something; }

The for loop should be doing "(any High in last 10 bars - any Low in last 10 bars) > 3 then do something".
Which should is the same as doing "(Highest High in last 10 bars - Lowest Low in last 10 bars) > 3 then do something".
But it is not.

If not SC if anyone could shed I light I'd greatly appreciate it. This should be very simple yet I'm stuck.
Date Time Of Last Edit: 2017-06-13 16:55:14

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

Login

Login Page - Create Account