- Desktop
- Scripting
- Formulas and Scripting Functions
- NearestAlert() Function
NearestAlert() Function
Overview
Section titled “Overview”Introduced in the Optuma v1.5 update the NearestAlert() function allows you to reference the closest alert you have set for a code in either direction (higher / lower).
This can be used (for example) in scans to find where alerts are within a specific range of the closing price, or display the proximity the close is to the nearest alert as a Watchlist column.
Properties
Section titled “Properties”Alert Position: Allows you to select whether the script references the closest higher alert (Price Crosses Above) or the closest lower alert (Price Crosses Below).
Time Frame: Allows you to overwrite the underlying chart / scan / watchlist time frame and use a different one (Weekly, Monthly ,etc).
Examples
Section titled “Examples”The Closing prices proximity to the closest higher alert displayed as a custom column on a watchlist.
NEARESTALERT() - CLOSE()The range (as a percentage) between the current closing price and the nearest lower alert displayed as a Chart Element value:
P1 = CLOSE() ;P2 = NEARESTALERT(TYPE=Lower);ABS(P2-P1) /P1Your privacy choices
We use cookies and similar technologies to make the site work, see how it's used, and improve it. Analytics and advertising cookies only run with your consent — see our Privacy Policy for details.