pine-script - Pine 脚本 - “内部服务器研究错误” - TradingView
问题描述
每个人!设置时遇到“内部服务器研究错误”错误strategy(close_entries_rule= "ANY")
,并尝试使用strategy.close(id= "EL 2")
.
从kodify.net获取的以下代码似乎对文章作者有效,但是当我复制并保存在我的 TradingView Pine 编辑器中时,它给了我“内部服务器研究错误”
strategy(title="Exit from specific entries", overlay=true,
pyramiding=2, close_entries_rule="ANY")
// Determine trading conditions
newDay = (dayofmonth != dayofmonth[1])
firstEntry = newDay and (dayofweek == dayofweek.monday)
secondEntry = newDay and (dayofweek == dayofweek.tuesday)
firstExit = newDay and (dayofweek == dayofweek.thursday)
secondExit = newDay and (dayofweek == dayofweek.friday)
// Submit entry orders
if (firstEntry)
strategy.entry(id="EL 1", long=true)
if (secondEntry)
strategy.entry(id="EL 2", long=true)
// Generate exit orders
if (firstExit)
strategy.close(id="EL 2")
if (secondExit)
strategy.close(id="EL 1")
提前感谢您的帮助!
解决方案
这一定是因为您在美国市场上运行策略,不允许对冲。应该适用于非美元外汇或加密货币。从refmanstrategy()
看到这个:
推荐阅读
- c++ - MariaDB:SQL 错误您的 SQL 语法有错误,而不是
- python - AttributeError:模块“transformers.modeling_bert”没有属性“gelu”
- c++ - 使用 C++ 时,在 Vim 中括号内的大括号上不需要突出显示
- python - 使用电源查询或 python 将多个表合并到具有相似标题的单个工作表中
- laravel - Laravel:传入模型实例或仅将 id 作为模型函数的参数?
- c - AFL-GCC 的编译方式与 GCC 不同
- reactjs - React Native 上下文函数不是函数
- objective-c - Lua if 语句在 for 循环中使用函数
- ios - IPA 处理失败:无法解析 @executable_path
- yolo - Yolov5 如何找到检测到的对象的像素大小?