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)

//标记指示

相关内容

热门资讯

受玩家影响"poke... 受玩家影响"pokemmo辅助器手机版下载"wepoker永久免费脚本(其实有辅助神器)-哔哩哔哩1...
透视普及"wepok... 您好,wepoker线上大神这款游戏可以开挂的,确实是有挂的,需要了解加去威信【485275054】...
透视app"hhpo... 透视app"hhpoker有作必弊的吗"aapoker免费透视脚本(原来是有辅助安装)-哔哩哔哩1、...
透视推荐"hhpok... 透视推荐"hhpoker智能辅助插件"本来是有辅助攻略(哔哩哔哩)透视推荐"hhpoker智能辅助插...
透视辅助"wepok... 透视辅助"wepoker开脚本视频"we poker辅助器v3.3(果然真的有辅助安装)-哔哩哔哩所...
透视了解"hhpok... 透视了解"hhpoker有没有作必弊挂"切实是有辅助神器(哔哩哔哩)1、hhpoker有没有作必弊挂...
透视ai"德普之星怎... 透视ai"德普之星怎么开辅助"wpk作必弊最怕三个东西(其实存在有辅助修改器)-哔哩哔哩1、在wpk...
透视解迷"aapok... 透视解迷"aapoker怎么设置提高好牌几率"确实是有辅助器(哔哩哔哩)aapoker怎么设置提高好...
现场直击"菠萝辅助器... 现场直击"菠萝辅助器免费版的特点"aapoker透视脚本(竟然是真的辅助修改器)-哔哩哔哩1、下载好...
透视曝光"pokem... 透视曝光"pokemmo手机脚本辅助器"切实真的是有辅助挂(哔哩哔哩)1、超多福利:超高返利,海量正...