Login Page - Create Account

Support Board


Date/Time: Mon, 23 Jun 2025 19:31:15 +0000



Post From: Sierra should allow ability to treat +/- FLT_MAX like it does sc.Subgraph[].DrawZeros=0

[2022-02-12 02:03:21]
User719512 - Posts: 316
EDIT: please see reply #19 for an improved description of the request. Keeping the original thread below intact so that the comments below have relevant context.

To detect a higher high or lower low, you compare current value to previous value. So for the first comparison what is the initial value? In code usually you initialize the min to FLT_MAX and for max the FLT_MIN. That way the first real bar you compare against your variable is always greater than or less than the first real value. If like in my case we are not comparing a single bar, but rather a series of bars, trying to handle sc.Index=0 or creating some other tracking variable for each SG whether it is uninitialized is not an elegant solution. It also means you need to store 0 in the SG and constantly check whether the SG=0 is really 0 or it is uninitialized and zero for that reason. Such code is really cluttered and should be unnecessary.

A lot of times in code it is valid to initialize to zero. Since futures can trade negative as we have seen, we'd be broken if we used 0 for initial value since say if first bar for CL was like -5.20/-5.30 for high/low then we'd never detect that -5.20 high because max(0, -5.20) is 0 and we'd print the wrong bar. If you init to FLT_MIN then max(FLT_MIN, -5.20) works but if we store FLT_MIN or FLT_MAX in a Subgraph (SG), Sierra draws a chart really poorly. The scale jumps super wide and you have to manually set a constant range to get your chart back.

To fix Sierra, I think Sierra should allow the ability treat FLT_MIN/FLT_MAX like it does sc.Subgraph[].DrawZeros=0 for example in Study Price Overlay/etc. and not try to draw these values because the chart gets really messed up if you do!
Date Time Of Last Edit: 2022-02-12 21:07:54