在最后一次卖出后等待 5 根蜡烛被抽出后再买入
Wait for 5 candles to be drawn before buying after the last sell
看图片中的第一个卖单。我想让它不在每次卖出订单后购买接下来的 5 支蜡烛。这可能吗?
常用的方法是设置您的条件,您将使用它来 entry/exit 一些变量的位置,然后将最后一个条目存储在一些 var
变量中。
//@version=4
strategy("strategy", process_orders_on_close = true)
var lastentry = -4 // var stores its value between bars
condition = bar_index%2==0 ? true : false // some condition to enter / exit. enter at even bars.
if (condition and bar_index-lastentry>=5) // if there is 5 bars after last entry
strategy.entry("EN", strategy.long)
lastentry := bar_index //store bar_index
strategy.close("EN", when = bar_index%3==0) //close at bars which %3 == 0
看图片中的第一个卖单。我想让它不在每次卖出订单后购买接下来的 5 支蜡烛。这可能吗?
常用的方法是设置您的条件,您将使用它来 entry/exit 一些变量的位置,然后将最后一个条目存储在一些 var
变量中。
//@version=4
strategy("strategy", process_orders_on_close = true)
var lastentry = -4 // var stores its value between bars
condition = bar_index%2==0 ? true : false // some condition to enter / exit. enter at even bars.
if (condition and bar_index-lastentry>=5) // if there is 5 bars after last entry
strategy.entry("EN", strategy.long)
lastentry := bar_index //store bar_index
strategy.close("EN", when = bar_index%3==0) //close at bars which %3 == 0