Who this is for: anyone who thinks in percentages, not price levels — "tell me if it drops 15% from its recent high" is a moving target a fixed threshold can't express, especially on a token whose price you don't check daily.
The base price alert workflow compares the current price against a fixed number you set once. This variant keeps a running high-water mark for the token in workflow state and alerts when the current price falls a percentage below that peak — the reference point moves up with the token instead of staying fixed.
SOGLIA_PREZZO/DIREZIONE with a DROP_PERCENT env var (e.g. 15 for 15%).$getWorkflowStaticData('global').high (default to the current price on first run), update it to Math.max(high, currentPrice), then compute drop = (high - currentPrice) / high * 100 and set the alert flag when drop >= DROP_PERCENT and it wasn't already flagged for this high-water mark.Tracking a high-water mark in $getWorkflowStaticData (instead of a fixed number) is what turns a static threshold into a trailing one — the same mechanism trading tools call a "trailing stop," done here with a public price API and no paid data feed.