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)

//标记指示

相关内容

热门资讯

透视能赢!wejoker辅助脚... 透视能赢!wejoker辅助脚本,we poker辅助器v3.3(透视)AA德州教程(有挂工具)1、...
透视教学!wepoker有辅助... 透视教学!wepoker有辅助功能吗,wepoker辅助是真的吗(透视)wpk教程(有挂解密);1、...
透视科技!wejoker透视方... 透视科技!wejoker透视方法,wepoker软件靠谱么(透视)细节方法(有挂脚本);1、实时we...
透视工具!竞技联盟破解版最新版... 透视工具!竞技联盟破解版最新版,wepoker游戏安装教程,揭秘教程(有挂规律)1、在竞技联盟破解版...
透视安卓版!wepoker游戏... 透视安卓版!wepoker游戏安装教程,wepoker轻量版透视方法(透视)揭秘教程(有挂教程)1、...
透视脚本!hhpoker透视脚... 透视脚本!hhpoker透视脚本视频,德普之星透视,细节方法(有挂技巧);1、金币登录送、破产送、升...
透视辅助!德普之星辅助工具如何... 透视辅助!德普之星辅助工具如何设置,aapoker怎么设置提高好牌几率,安装教程(有挂详情);在进入...
透视能赢!wepoker作弊辅... 透视能赢!wepoker作弊辅助,wepoker作弊方法(透视)透明挂教程(有挂解密)1)wepok...
透视辅助!wepoker有没有... 透视辅助!wepoker有没有透视方法,wejoker内置辅助,2025新版(有挂秘籍)1、操作简单...
透视软件!wepoker钻石怎... 透视软件!wepoker钻石怎么看底牌,wepoker有人用过吗(透视)黑科技教程(有挂细节)wep...