当我运行此代码时,图表中什么都没发生
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © jithuldevaraj01
//@version=5
strategy ("VRD's MA Crossover Strategy v1", overlay = true)
start = timestamp (2007, 1,1,0,0)
end = timestamp (2021,6,1,0,0)
ema1 = ta.ema(close, 20)
ema2 = ta.ema(close, 50)
plot (ema1, title = "EMA20", color = color.blue,)
plot (ema2, title = "EMA50", color = color.green)
//strategy
LongEntry = ta.crossover (ema1, ema2)
LongExit = ta.crossover (ema2, ema1)
ShortEntry = ta.crossover (ema2, ema1)
ShortExit = ta.crossover (ema1, ema2)
if time >= start and time < end
strategy.entry ("Long", strategy.long, 1, when = LongEntry)
strategy.close ("Long", when = LongExit)
strategy.entry ("Short", strategy.short, 1, when = ShortEntry)
strategy.close ("Short", when = ShortExit)
当我运行此代码时,此消息是打印“添加到图表中的脚本研究”,但图表上正在发生。
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © jithuldevaraj01
//@version=5
strategy ("VRD's MA Crossover Strategy v1", overlay = true)
start = timestamp (2007, 1,1,0,0)
end = timestamp (2021,6,1,0,0)
ema1 = ta.ema(close, 20)
ema2 = ta.ema(close, 50)
plot (ema1, title = "EMA20", color = color.blue,)
plot (ema2, title = "EMA50", color = color.green)
//strategy
LongEntry = ta.crossover (ema1, ema2)
LongExit = ta.crossover (ema2, ema1)
ShortEntry = ta.crossover (ema2, ema1)
ShortExit = ta.crossover (ema1, ema2)
if time >= start and time < end
strategy.entry ("Long", strategy.long, 1, when = LongEntry)
strategy.close ("Long", when = LongExit)
strategy.entry ("Short", strategy.short, 1, when = ShortEntry)
strategy.close ("Short", when = ShortExit)
when i run this code this message is printing "Script study added to the chart" but nothin is happening on the chart
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
下线似乎有一个额外的逗号
There appears to be an extra comma in below line