【问题标题】:How to add a break between orders如何在订单之间添加中断
【发布时间】:2021-11-06 16:22:29
【问题描述】:

是否可以在 pinescript 策略的交易之间添加中断?

我可以确保只有一个交易处于活动状态,但是一旦满足条件就会开始新的交易,我想添加延迟,例如在交易完成后,我不想开始新的交易交易一个小时。

【问题讨论】:

    标签: pine-script


    【解决方案1】:

    您可以尝试使用strategy.closedtrades.exit_time() 查找交易结束的时间,然后添加 1 小时延迟。

    您也可以使用ta.barssince() 函数。

    conditionFilter = not ta.barssince(ta.change(strategy.closedtrades)) == 5 
    //this will skip trades for 5 bars after each closed trade, just add it to your long/short conditions
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-06-16
      • 2022-08-16
      • 1970-01-01
      • 1970-01-01
      • 2021-09-27
      • 2020-08-21
      • 1970-01-01
      • 2012-10-14
      相关资源
      最近更新 更多