AlertaScript / 문서
제어 흐름
조건과 제한된 반복.
동작 원리
if는 분기를, 삼항식은 값을 선택합니다. 조건은 현재 봉의 문맥에서 평가합니다.
실전 적용
재사용 시리즈를 일관되게 계산한 뒤 조건을 적용하세요. 반복과 컬렉션의 무제한 증가를 막습니다.
코드 예제
AlertaScript
indicator("Bar direction", overlay=false)direction = close > open ? 1 : close < open ? -1 : 0plot(direction, "Direction", style=plot.style_histogram)