Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Pine script 无法拨打电话';abs&x27;尝试将脚本代码转换为版本4时出现with arguments错误_Pine Script - Fatal编程技术网

Pine script 无法拨打电话';abs&x27;尝试将脚本代码转换为版本4时出现with arguments错误

Pine script 无法拨打电话';abs&x27;尝试将脚本代码转换为版本4时出现with arguments错误,pine-script,Pine Script,我正在尝试将一个脚本代码转换为版本4。代码如下 Early = abs((close[3] > open[3] and close[2] > open[2] and close[1] > open[1] and close < open) or (close[3] > open[3] and close[2] > open[2] and close[1] < open[1] and close > open) or (close[3] > o

我正在尝试将一个脚本代码转换为版本4。代码如下

Early = abs((close[3] > open[3] and close[2] > open[2] and close[1] > open[1] and close < open) or (close[3] > open[3] and close[2] > open[2] and close[1] < open[1] and close > open) or (close[3] > open[3] and close[2] < open[2] and close[1] > open[1] and close > open) or (close[3] < open[3] and close[2] > open[2] and close[1] > open[1] and close > open) or (close[3] > open[3] and close[2] > open[2] and close[1] > open[1] and close > open))*(low*.9999525)
  
EarlyD = abs((close[3] < open[3] and close[2] < open[2] and close[1] < open[1] and close > open) or (close[3] < open[3] and close[2] < open[2] and close[1] > open[1] and close < open) or (close[3] < open[3] and close[2] > open[2] and close[1] < open[1] and close < open) or (close[3] > open[3] and close[2] < open[2] and close[1] < open[1] and close < open) or (close[3] < open[3] and close[2] < open[2] and close[1] < open[1] and close < open))*(high*1.00009525)
 
EarlyTd = abs(close > TL(low, 16) and close < l)*(low*.9999525)
EarlyTu = abs(close < TH(high, 16) and close > h)*(high*1.00009525)

你可能在找更像这样的东西。您不能对带有数值的布尔表达式进行操作,因此我们分两步进行操作:首先定义条件(布尔值),然后使用它们构建价格

// #1: Build boolean conditions.
EarlyU = (close[3] > open[3] and close[2] > open[2] and close[1] > open[1] and close < open) 
  or (close[3] > open[3] and close[2] > open[2] and close[1] < open[1] and close > open) 
  or (close[3] > open[3] and close[2] < open[2] and close[1] > open[1] and close > open) 
  or (close[3] < open[3] and close[2] > open[2] and close[1] > open[1] and close > open) 
  or (close[3] > open[3] and close[2] > open[2] and close[1] > open[1] and close > open)
  
EarlyD = (close[3] < open[3] and close[2] < open[2] and close[1] < open[1] and close > open) 
  or (close[3] < open[3] and close[2] < open[2] and close[1] > open[1] and close < open) 
  or (close[3] < open[3] and close[2] > open[2] and close[1] < open[1] and close < open) 
  or (close[3] > open[3] and close[2] < open[2] and close[1] < open[1] and close < open) 
  or (close[3] < open[3] and close[2] < open[2] and close[1] < open[1] and close < open)
 
EarlyTd = close > TL(low, 16) and close < l
EarlyTu = close < TH(high, 16) and close > h


// #2: Build prices.
EarlyUVal  = EarlyU  ? low  * 0.9999525  : na
EarlyDVal  = EarlyD  ? low  * 0.9999525  : na
EarlyTdVal = EarlyTd ? high * 1.00009525 : na
EarlyTuVal = EarlyTu ? high * 1.00009525 : na
/#1:构建布尔条件。
EarlyU=(关闭[3]>打开[3]和关闭[2]>打开[2]和关闭[1]>打开[1]和关闭<打开)
或(关闭[3]>打开[3]和关闭[2]>打开[2]和关闭[1]<打开[1]和关闭>打开)
或(关闭[3]>打开[3]和关闭[2]<打开[2]和关闭[1]>打开[1]和关闭>打开)
或(关闭[3]<打开[3]和关闭[2]>打开[2]和关闭[1]>打开[1]和关闭>打开)
或(关闭[3]>打开[3]和关闭[2]>打开[2]和关闭[1]>打开[1]和关闭>打开)
EarlyD=(关闭[3]<打开[3]并关闭[2]<打开[2]并关闭[1]<打开[1]并关闭>打开)
或(关闭[3]<打开[3]和关闭[2]<打开[2]和关闭[1]>打开[1]和关闭<打开)
或(关闭[3]<打开[3]和关闭[2]>打开[2]和关闭[1]<打开[1]和关闭<打开)
或(关闭[3]>打开[3]并关闭[2]<打开[2]并关闭[1]<打开[1]并关闭<打开)
或(关闭[3]<打开[3]和关闭[2]<打开[2]和关闭[1]<打开[1]和关闭<打开)
EarlyTd=关闭>TL(低,16)和关闭h
//#2:建筑价格。
EarlyUVal=EarlyU?低*0.9999525:na
EarlyDVal=EarlyD?低*0.9999525:na
EarlyTdVal=EarlyTd?高*1.00009525:na
EarlyTuVal=EarlyTu?高*1.00009525:na

谢谢。可以看看我在哪里试图得到最接近当前价格的价值吗
// #1: Build boolean conditions.
EarlyU = (close[3] > open[3] and close[2] > open[2] and close[1] > open[1] and close < open) 
  or (close[3] > open[3] and close[2] > open[2] and close[1] < open[1] and close > open) 
  or (close[3] > open[3] and close[2] < open[2] and close[1] > open[1] and close > open) 
  or (close[3] < open[3] and close[2] > open[2] and close[1] > open[1] and close > open) 
  or (close[3] > open[3] and close[2] > open[2] and close[1] > open[1] and close > open)
  
EarlyD = (close[3] < open[3] and close[2] < open[2] and close[1] < open[1] and close > open) 
  or (close[3] < open[3] and close[2] < open[2] and close[1] > open[1] and close < open) 
  or (close[3] < open[3] and close[2] > open[2] and close[1] < open[1] and close < open) 
  or (close[3] > open[3] and close[2] < open[2] and close[1] < open[1] and close < open) 
  or (close[3] < open[3] and close[2] < open[2] and close[1] < open[1] and close < open)
 
EarlyTd = close > TL(low, 16) and close < l
EarlyTu = close < TH(high, 16) and close > h


// #2: Build prices.
EarlyUVal  = EarlyU  ? low  * 0.9999525  : na
EarlyDVal  = EarlyD  ? low  * 0.9999525  : na
EarlyTdVal = EarlyTd ? high * 1.00009525 : na
EarlyTuVal = EarlyTu ? high * 1.00009525 : na