0
xcond = //blabla

我没有指定条件,因为在这种情况下它并不重要

//THIS IS JUST AN EXAMPLE
// how can i make these boxes disappear everytime price goes away from them and make them appear again when price is close enough?

bearish_box= if xcond
    box.new(left=bar_index[3], top=high[1], right=bar_index, bottom=low, border_color=color.red, bgcolor=color.red, border_width=2)

如果满足 xcond,则创建一个框

    
selected_low = if xcond
    low

selected_high = if xcond
    high

制作两个变量来存储盒子的每个顶部和每个底部

range_high = close + ta.atr(14)

range_low = close - ta.atr(14)

我想看到的范围以选择可见框

for i = 1 to 500

    if range_high < selected_low[i] or range_low > selected_high[i]
        bearish_box[i]:=box.new(left=bar_index[3], top=high[1], right=bar_index, bottom=low, border_color=color.red, bgcolor=color.red, border_width=2) //trying to change value only for [i] variable gives "end of line without continuatiom" error
    //box.delete(bear_fvg[i])   with this I'm able to delete boxes when closing price gets to far from the range, but how can i get them back when closing price returns there?

这是为了让您了解我尝试过的内容以及可能有帮助的内容:)

4

0 回答 0