首先,我知道我的进入和退出信号被搞砸了,但我想关注 RSI 分歧/趋同指标,它给我准确的买卖信号。我在 strategy.entry 中设置了多头和空头的条件,但他们喜欢延迟 3-4 根蜡烛,这会破坏每个交易入口。
我启用了 calc_on_every_tick = true 和 calc_on_order_fills = true 希望它会修复但没有任何变化。
请提出任何提示和建议!
我尝试将 strategy.entry 设置为与 RSI 指标相同的条件,以便在买入信号上获得买入入场点。但是入境很晚。
长例子
SOME DATA:
pivot_low_true = na(ta.pivotlow(rsi_value, pivot_left, pivot_right)) ? false : true
RSI_HL_check1 = rsi_value[pivot_right] > ta.valuewhen(pivot_low_true, rsi_value[pivot_right], 1)
and confirm_range(pivot_low_true[1])
price_ll_check1 = low[pivot_right] < ta.valuewhen(pivot_low_true, low[pivot_right], 1)
bullCond = price_ll_check1 and RSI_HL_check1 and pivot_low_true
SIGNAL:
plotshape(
bullCond ? rsi_value[pivot_right] : na,
offset=-pivot_right,
text=" BUY ",
style=shape.labelup,
location=location.absolute,
color=color.green,
textcolor=color.white
)
ENTRY:
strategy.entry("BUY", strategy.long, when = bullCond)