您注意到在TradingView
中创建的策略的结果会随时间变化。
在23H时间范围内表现出色
在1H时间范围内效果不佳
即使我更改当前时间范围图表,我也正在寻找在特定时间范围运行的策略。
//Long entry
if (longCondition5_13 and longCondition5_01 and longCondition5_02 and longCondition20 and longCondition20_01 or longCondition2_02)
strategy.entry ("Long", strategy.long, when = window())
strategy.exit ("Long exit", "Long", when = window(), profit = highestAtr * 2, loss = lowestAtr)
//Short entry
if (shortCondition5_13 and shortCondition5_01 and shortCondition5_02 and shortCondition20_01 or shortCondition20_02)`
strategy.entry("Short", strategy.short, when = window())
strategy.exit("Short exit", "Short", when = window(), profit = lowestAtr * 2, loss = highestAtr)