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)

//标记指示

相关内容

热门资讯

2026版辅助挂!wepoke... 2026版辅助挂!wepoker亲友圈有用吗,德普之星有透视辅助吗,其实存在有挂(有挂教学)1、德普...
据文件显示!epoker免费透... 据文件显示!epoker免费透视脚本,德扑之星辅助器,总是真的是有挂(有挂教程)德扑之星辅助器脚本下...
最终!hhpoker视频巡查真... 最终!hhpoker视频巡查真的假的,德扑之星透视辅助插件,确实真的是有挂(有挂细节)1、德扑之星透...
刚刚!大菠萝免费辅助,德扑之星... 刚刚!大菠萝免费辅助,德扑之星透视软件免费入口官网,其实真的是有挂(有挂技术)暗藏猫腻,小编详细说明...
今天下午!we-poker辅助... 今天下午!we-poker辅助器,德普之星辅助工具如何打开,确实存在有挂(有挂神器)1、每一步都需要...
更值得关注的是!德州局透视脚本... 更值得关注的是!德州局透视脚本免费版下载手机版,如何下载德普之星辅助软件,原来确实有挂(有挂分享)1...
据统计!德州局hhpoker,... 据统计!德州局hhpoker,德扑之星透视免费,果然存在有挂(确实有挂)1、德扑之星透视免费公共底牌...
2026版软件!约局吧能不能开... 2026版软件!约局吧能不能开挂,德普之星辅助工具如何打开,竟然存在有挂(果真有挂)1、让任何用户在...
于此同时!xpoker辅助怎么... 于此同时!xpoker辅助怎么用,德普辅助器怎么用,果然真的是有挂(有挂秘籍)进入游戏-大厅左侧-新...
在玩家背景下!wepoker透... 在玩家背景下!wepoker透视功能下载,德扑之星辅助器怎么用,本来存在有挂(确实有挂)1、每一步都...