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)

//标记指示

相关内容

热门资讯

免费测试版!边锋老友宁安麻将辅... 免费测试版!边锋老友宁安麻将辅助器功能app,边锋老友宁安麻将一贯存在有辅助器app1、起透看视 边...
避坑细节!白金岛湘潭三打哈辅助... 避坑细节!白金岛湘潭三打哈辅助器功能神器,白金岛湘潭三打哈确实存在有辅助器神器1、首先打开白金岛湘潭...
指导大家!牌九辅助功能教程,牌... 指导大家!牌九辅助功能教程,牌九总是真的有辅助教程1、指导大家!牌九辅助功能教程,牌九总是真的有辅助...
玩家必看科普!中至永丰麻将开挂... 玩家必看科普!中至永丰麻将开挂功能插件,中至永丰麻将原来真的是有开挂插件1、很好的工具软件,可以解锁...
实测发现!吕梁打七透视挂功能技... 实测发现!吕梁打七透视挂功能技巧,吕梁打七其实是有透视挂技巧1、首先打开吕梁打七辅助器下载最新版本,...
必备攻略!四川游戏家园透视功能... 必备攻略!四川游戏家园透视功能工具,四川游戏家园一贯真的是有透视工具1)四川游戏家园免费钻石:进一步...
重大通报!乐鱼辅助器功能工具,... 重大通报!乐鱼辅助器功能工具,乐鱼竟然真的有辅助器工具小薇(辅助器软件下载)致您一封信;亲爱乐鱼辅助...
一分钟揭秘!甬城竞技辅助器功能... 一分钟揭秘!甬城竞技辅助器功能app,甬城竞技原来真的是有辅助器app亲,关键说明,甬城竞技透视脚本...
科技分享!瓜瓜丰城棋牌透视功能... 科技分享!瓜瓜丰城棋牌透视功能软件,瓜瓜丰城棋牌一贯有透视软件所有人都在同一条线上,像星星一样排成一...
盘点十款!新二号开挂功能神器,... 盘点十款!新二号开挂功能神器,新二号确实是真的有开挂神器1、新二号有没有辅助教程、新二号有透视吗等服...