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)

//标记指示

相关内容

热门资讯

免费测试版!hhpoker作弊... 免费测试版!hhpoker作弊实战视频,微扑克辅助,其实有挂(有挂讲解)1、辅助软件下载优化,底牌透...
黑科技技巧!hhpoker的辅... 黑科技技巧!hhpoker的辅助是真的吗,德普之星透视辅助软件是真的吗,都是存在有挂(有挂技术)1、...
研究成果!we poker辅助... 研究成果!we poker辅助器,pokemmo辅助器手机版下载,真是是有挂(有挂功能);破解侠是真...
今日!wepoker轻量版透视... 今日!wepoker轻量版透视,智星德州有脚本吗,其实真的是有挂(有挂解密)智星德州有脚本吗脚本下载...
指导大家!红龙poker有辅助... 指导大家!红龙poker有辅助吗,hhpoker作弊实战视频,好像存在有挂(有挂详情)1、下载好透视...
迎来新发展!hhpoker怎么... 迎来新发展!hhpoker怎么防作弊,德扑之星辅助工具如何打开,真是存在有挂(竟然有挂);1)德扑之...
推荐一款!wepoker透视脚... 推荐一款!wepoker透视脚本免费下载,aapoker怎么拿好牌,一直真的有挂(讲解有挂)小薇(辅...
据报道!德普之星透视免费,德普... 据报道!德普之星透视免费,德普之星怎么开辅助,切实真的是有挂(有挂细节)1、全新机制【德普之星怎么开...
每日必看推荐!pokermas... 每日必看推荐!pokermaster脚本,智星德州插件,果然是真的有挂(有挂方法)1、玩家可以在透视...
受玩家影响!wepoker免费... 受玩家影响!wepoker免费脚本弱密码,德普软件,总是是真的有挂(有挂神器)1、任何德普软件透视是...