variable_name- Pine Script中允许的用户变量的任何名称(可以包含大写和小写的拉丁字符,数字和下划线(_),但不能以数字开头)。 expression- 任何算术表达式,就像定义常规变量一样。 将计算表达式并将其分配给变量一次。 例子 // Var keyword example var a = close var b = 0.0 var c = 0.0 var green_bars_c...
In this pine script tutorial I’ll be showing you how to get started with TradingView scripting for technical analysis and trading strategy development. We will start by looking at how pine script works and a simple example. From there we will move on to inputs and indicators before creating...
pine // Switch using an expression string i_maType = input.string("EMA", "MA type", options = ["EMA", "SMA", "RMA", "WMA"]) float ma = switch i_maType "EMA" => ta.ema(close, 10) "SMA" => ta.sma(close, 10) "RMA" => ta.rma(close, 10) // Default used when the ...
array.concat该函数用于合并两个阵列。它将所有元素从第二个阵列推送到第一个阵列,然后返回第一个阵列。array.concat(id1, id2) 例子// array.concat example a = array.new_float(0,0) b = array.new_float(0,0) for i = 0 to 4 array.push(a, high[i]) array.push(b, low[i]) c = ...