【发布时间】:2020-11-28 15:15:08
【问题描述】:
-
我正在尝试按照以下代码删除一个区域(包含 2 行)
-
删除功能应该是有条件的:: 只有在区域创建后的任何时间点价格突破区域的下线时才删除区域(2条线)
//@version=4
study("zones", overlay=true)
// define a basing and explosive candles
basing_candle = ((abs(close - open)/abs(high - low)) < 0.5)
explosive_candle = (abs(close-open) / abs(high - low)) >= 0.5 and tr>tr[1]
// functions
bc_r = basing_candle and close < open
ex_g = explosive_candle and close > open
// demand zone
demand_zone = bc_r[1] and ex_g and low>=low[1] and close>open[1]
dz = if demand_zone
line.new(x1 = bar_index[1] ,y1=open[1], x2=bar_index, y2= open[1], style=line.style_solid, extend=extend.right, color=color.green, width=2)
line.new(x1 = bar_index[1] ,y1=low[1], x2=bar_index, y2= low[1], style=line.style_solid, extend=extend.right, color=color.green, width= 2)
【问题讨论】:
标签: line pine-script