AlertaScript / 文件
自訂型別與方法
整合相關資料和操作。
運作方式
type 定義欄位,建構子建立實例。方法以第一個有型別的參數作為接收者。
實際應用
可用於價位區域或交易狀態。chart.point 是內建型別,不是價格序列變數。
程式範例
AlertaScript
indicator("Price range", overlay=false)type PriceRange float hi float lomethod width(PriceRange this) => this.hi - this.lorange = PriceRange.new(high, low)plot(range.width(), "Range")