• 產品
  • 社群
  • 市場
  • 經紀商
  • 更多
立即開始
  • 社群
  • /指標和策略
  • /User-defined

User-defined

WelcomeUDT█  OVERVIEW This is a simplest example of user-defined types (UDT) or objects , which simplify as alternative to hello world. █  CREDITS Tradingview █  USAGE These are the types used during initializations, commonly variables. export type Settings int bar float price string phrase ... Example of library function to print out label. export printLabel(Settings setup) => if setup.variable var label lab = na label.delete(lab) lab := label.new(setup.bar, setup.price, setup.phrase, color = setup.bg) else label.new(setup.bar, setup.price, setup.phrase, color = setup.bg) Usage of types Settings setup = Settings.new(bar_index , priceInput, phraseInput, colorInput, variableInput) Alternative way to write types Settings setup = Settings.new( bar = bar_index , price = priceInput, phrase = phraseInput, variable = variableInput) Usage of types into custom function / library function. printLabel(setup) printLabel(Settings)   Print out label   Parameters:      Settings : types   Returns: Label object Settings   Initialize type values   Fields:      bar : X position for label      price : Y position for label      phrase : Text for label      bg : Color for label      variable : Boolean for enable new line and delete line
Pine Script®腳本庫
由RozaniGhani-RG提供

選擇由ICE Data提供的市場數據。選擇由FactSet提供的參考數據。版權所有©2025FactSet Research Systems Inc.©2025TradingView, Inc.

不僅是產品
  • 超級圖表
篩選器
  • 股票
  • ETF
  • 債券
  • 加密貨幣
  • 加密貨幣對
  • CEX對
  • DEX對
  • Pine
熱圖
  • 股票
  • ETF
  • 加密貨幣
日曆
  • 經濟
  • 收益
  • 股息
更多產品
  • 殖利率曲線
  • 期權
  • 新聞流
  • Pine Script®
  • 精選股
App
  • 行動裝置
  • 電腦版
工具與訂閱
  • 功能特色
  • 價格
  • 市場數據
特別優惠
  • CME期貨
  • Eurex期貨
  • 美國股票包
關於公司
  • 我們是誰
  • 宣言
  • 運動員
  • 部落格
  • 職涯
  • 媒體工具包
商品
  • TradingView商店
  • 交易者塔羅牌
政策與安全
  • 使用條款
  • 免責聲明
  • 隱私政策
  • Cookies政策
  • 無障礙聲明
  • 安全漏洞
  • 狀態頁面
社群
  • 社交網路
  • 愛心牆
  • 推薦朋友
  • 網站規則
  • 版主
投資想法
  • 交易
  • 教育
  • 編輯精選
Pine腳本
  • 指標與策略
  • 大師
  • 自由開發人員
企業解決方案
  • 小工具
  • 圖表庫
  • Lightweight Charts™
  • 高級圖表
  • 交易平台
成長機會
  • 廣告
  • 經紀商整合
  • 夥伴計畫
  • 教育計劃
Look FirstLook First