Buyandsell-markersonlowertimeframeswhenlongertimeframeshowsuptrend
创始人
2025-01-10 16:30:24
0

在长期趋势显示为上涨时,可以在较低时间框架上购买和卖出标记。为了实现这个策略,我们可以使用以下代码:

//@version=4 strategy("Buy and Sell Markers on Lower Time Frames when Longer Time Frame Shows Uptrend", overlay=true, margin_long=100, margin_short=100)

//长期时间框架 resLong = input("D", title="Long-Term Timeframe") lenLong = input(20, title="Long-Term Moving Average Length") srcLong = input(close, title="Long-Term Moving Average Source") maLong = sma(srcLong, lenLong)

//判断趋势是否上涨 longCondition = close > maLong

//单独的窗口显示较长时间框架上的结果 plot(series=maLong, title="Long-Term MA", color=color.green, linewidth=2, transp=0)

//短期时间框架 resShort = input("60", title="Short-Term Timeframe") lenShort = input(5, title="Short-Term Moving Average Length") srcShort = input(close, title="Short-Term Moving Average Source") maShort = sma(srcShort, lenShort)

//判断趋势是否上涨 shortCondition = close > maShort

//单独的窗口,显示较短时间框架上的结果 plot(series=maShort, title="Short-Term MA", color=color.blue, linewidth=2, transp=0)

//确定买入和卖出信号 buySignal = crossover(maShort, maLong) and longCondition and shortCondition sellSignal = crossunder(maShort, maLong) and longCondition and shortCondition

//下单代码 if (buySignal) strategy.entry("Long", strategy.long) if (sellSignal) strategy.entry("Short", strategy.short)

//标记指示

相关内容

热门资讯

2分钟辅助!微乐小程序免费黑科... 2分钟辅助!微乐小程序免费黑科技,手机微信小程序游戏破解器下载(开挂)总是存在有挂(2026)1、很...
目前来看!微乐小程序免费黑科技... 目前来看!微乐小程序免费黑科技,微乐如何自己建脚本(透视)好像存在有挂(哔哩哔哩)一、微乐小程序免费...
第三分钟下载!微乐小程序免费黑... 第三分钟下载!微乐小程序免费黑科技,微乐小程序黑科技(开挂)总是真的有挂(2026)1、操作简单,无...
透视代打!微乐小程序免费黑科技... 透视代打!微乐小程序免费黑科技,微乐自建房脚本下载(透视)总是有挂(哔哩哔哩)1、任何微乐小程序免费...
第一分钟工具!微乐小程序黑科技... 第一分钟工具!微乐小程序黑科技,微乐河南家乡麻将辅助脚本(开挂)本来存在有挂(2026)1、每一步都...
总结辅助挂!微乐小程序黑科技,... 总结辅助挂!微乐小程序黑科技,微乐自建房运势高有什么表现(透视)本来是有挂(哔哩哔哩)微乐自建房运势...
第5分钟教程!微乐小程序黑科技... 第5分钟教程!微乐小程序黑科技,微乐游戏辅助脚本安装(开挂)其实存在有挂(2026)微乐小程序黑科技...
透视透视挂!微乐小程序黑科技,... 透视透视挂!微乐小程序黑科技,微信微乐自建房脚本免费下载(透视)果然是真的挂(哔哩哔哩)1、微信微乐...
3分钟脚本!微乐小程序黑科技,... 3分钟脚本!微乐小程序黑科技,微乐自建房脚本免费下载入口(开挂)都是存在有挂(2026);小薇(辅助...
7分钟下载!微乐小程序黑科技,... 7分钟下载!微乐小程序黑科技,万能透视辅助器免费版(开挂)一贯是真的挂(2026)1、微乐小程序黑科...