pine-script - strategy.close 标准未执行
问题描述
进入是在一根柱线反转上,如果当前柱线低于前一根柱线低点或高于前一根柱线高点,则收盘。进入标准运行正确,但它不运行退出标准。不知道我做错了什么
//@version=4
exitShort = iff(close > open and close > high[1], true, false)
exitLong = iff(close < open and close < low[1], true, false)
strategy("OneBarReversal", overlay=true)
if (low < low[1] and close > high[1])
strategy.entry("RevBarUp", strategy.long)
strategy.close("Elong", when = exitLong)
if (high > high[1] and close < low[1])
strategy.entry("RevBarDn", strategy.short)
strategy.close("Eshort", when = exitShort)
解决方案
推荐阅读
- python - 仅将信息附加到 Python 中的某些行
- html - 边框底部宽度
- python-3.x - 代码覆盖率,函数的单元测试在 Python 中引发异常
- javascript - 我想在 chrome 的新选项卡中阻止 window.location.href
- splunk - 如何计算两个事件之间的持续时间 Splunk
- google-api - 谷歌日历 api 不再发送 exdates
- javascript - JS可以像PHP一样自动分配键吗?
- python - 对 python 非常陌生并且努力使用这个 API
- python - 在需要在导入期间创建文件的 Singularity 容器中安装 Python 包(例如,启用 GPU 渲染的 mujoco_py)
- git - Git:手动编辑整个文件的差异以进行选择性暂存?