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)

//标记指示

相关内容

热门资讯

8分钟实锤!智星德州菠萝外挂(... 8分钟实锤!智星德州菠萝外挂(云扑克德州)其实真的有挂(详细辅助新版2025教程)智星德州菠萝外挂软...
4分钟实锤!德州ai辅助软件(... 4分钟实锤!德州ai辅助软件(德州wpk)好像是有挂(详细辅助详细教程)1、打开软件启动之后找到中间...
第二分钟实锤!德扑之星作弊(w... 第二分钟实锤!德扑之星作弊(wepower德州)竟然有挂(详细辅助第三方教程);1、游戏颠覆性的策略...
3分钟实锤!德州之星有辅助挂(... 3分钟实锤!德州之星有辅助挂(nzt德州)一直真的有挂(详细辅助新2025教程)1、任何德州之星有辅...
第1分钟实锤!德州之星插件(手... 第1分钟实锤!德州之星插件(手机德州)总是真的有挂(详细辅助攻略教程);德州之星插件是一种具有地方特...
第5分钟实锤!德州ai辅助有用... 第5分钟实锤!德州ai辅助有用(德州之星)其实真的有挂(详细辅助攻略教程);德州ai辅助有用辅助器中...
第九分钟实锤!德扑之星辅助器购... 第九分钟实锤!德扑之星辅助器购买(德扑ai)其实真的有挂(详细辅助解密教程)1、在德扑之星辅助器购买...
9分钟实锤!德州之星有外挂(德... 9分钟实锤!德州之星有外挂(德州)切实是有挂(详细辅助系统教程)1、完成德州之星有外挂的残局,帮助玩...
第八分钟实锤!德州之星有外挂(... 第八分钟实锤!德州之星有外挂(云扑克德州)果然真的有挂(详细辅助攻略教程)一、德州之星有外挂软件透明...
第1分钟实锤!德州ai辅助软件... 第1分钟实锤!德州ai辅助软件(wepower德州)本来真的有挂(详细辅助大神讲解)德州ai辅助软件...