Renko 收盘价

Renko Close Price

我正在为 Pine 脚本中的 TradingView 制定策略。它只是高于或低于价格的移动平均线。我的问题是,当回测时,我得到一个绿色条、红色条、绿色条,反之亦然,它以中间条的开盘价而不是初始条的收盘价进入交易。有什么办法可以把strategy.entry()改成收盘价吗?

Chart Screenshot

Is there any way to change the strategy.entry() to the close?

不幸的是,这是不可能的。来自 TradingView wiki:

There is a broker emulator on TradingView for testing strategies. Unlike real trading, the emulator fills orders only at chart prices, that is why an order can be filled only on next tick in forwardtesting and on next bar in backtesting (or later) after strategy calculated.

从逻辑角度来看这也是有道理的:如果您的脚本在柱关闭时生成订单,则它不再有空间在该柱中执行交易。毕竟,酒吧关闭,那个时间段的交易停止了。