就像图像中一样,我创建了一条趋势线指示器,该指示器连接了当天和前一天的高点和低点(仅持续2天)。但问题是,最高点和最低点正好相反。如何解决? 谢谢。
//@version=4
study("HL", shorttitle="HL", overlay=true)
dayHighHTF = security(syminfo.tickerid, "D", high, lookahead=true)
prev1HighHTF = security(syminfo.tickerid, "D", high[1], lookahead=true)
dayLowHTF = security(syminfo.tickerid, "D", low, lookahead=true)
prev1LowHTF = security(syminfo.tickerid, "D", low[1], lookahead=true)
if (barstate.islast)
line.new(x1=bar_index[24], y1=dayLowHTF, x2=bar_index, y2=dayHighHTF)
line.new(x1=bar_index[49], y1=prev1LowHTF, x2=bar_index[25], y2=prev1HighHTF)