INNER CODE UNIT · TypeScript

high24h

alexanderwanyoike/the0 · example-bots/typescript-price-alerts/main.ts:194

  const high24h = Math.max(...state.priceHistory, newPrice);
  const low24h = Math.min(...state.priceHistory, newPrice);

  return {
    symbol,
    value: Math.round(newPrice * 100) / 100,
    change_pct: Math.round(changePct * 1000) / 1000,
    high_24h: Math.round(high24h * 100) / 100,
    low_24h: Math.round(low24h * 100) / 100,
  };
}

/**
 * Check if alert conditions are met
 */
function checkAlertConditions(
  state: BotState,
  priceData: { value: number; change_pct: number },

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…