AlertaScript / 文件
語法與型別
明確宣告與傳遞參數。
運作方式
= 宣告變數,:= 重新賦值。int、float、bool、string、color 區分不同數值類型。
實際應用
使用 na 初始化時明確指定型別。依函數簽章傳參數,並使用 input.int 等有型別的輸入。
程式範例
AlertaScript
indicator("Typed inputs", overlay=true)int length = input.int(20, "Length", minval=1)float source = closebool rising = close > openplot(ta.ema(source, length), "EMA", color=rising ? color.green : color.red)