当我运行这段代码时,图表中没有发生任何事情


// 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)

当我运行此代码时,此消息打印"脚本研究添加到图表";但是图表上什么也没发生

下面好像多了一个逗号
plot (ema1, title = "EMA20", color = color.blue,)

最新更新