参考入场蜡烛的低点

Referencing the low of the entry candle

我想做的是参考入场蜡烛的低点:

if (longCondition1)
    strategy.entry("long", strategy.long)
strategy.exit("exit", "long", stop = low) //this refrences the low of the current candle ↓
//but i want it to be like *stop = entry candle's low*

我遇到过这个 strategy.opentrades.entry_bar_index 但我不知道如何利用它来获得 low

因此,当您下单时,将低价存储在一个变量中,并使用该变量计算止损。

var float entry_low = 0.0
if (longCondition1)
    strategy.entry("long", strategy.long)
    entry_low := low
strategy.exit("exit", "long", stop = entry_low)

关于您的第二个问题,默认情况下,您的订单将在下一个柱线开盘时执行。因此,如果价格上下波动太大,您可以将其过滤掉并在确认信号的情况下进行交易。