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)

//标记指示

相关内容

热门资讯

解密透视!pokerworld... 解密透视!pokerworld修改器!一贯一直总是有辅助方法(有挂教程)-哔哩哔哩pokerworl...
必备透视!wepokerplu... 必备透视!wepokerplus外开挂,wepoker透视功能下载,模块教程(有挂教程)-哔哩哔哩1...
教你透视!pokermaste... 教你透视!pokermaster修改器!真是有辅助插件(有人有挂)-哔哩哔哩1、进入游戏-大厅左侧-...
有挂透视!wepoker有透视... 有挂透视!wepoker有透视吗,wepoker俱乐部辅助,大纲教程(今日头条)-哔哩哔哩1、起透看...
总结透视!wepoker透视脚... 总结透视!wepoker透视脚本免费下载pc,epoker透视底牌,机巧教程(真是有挂)-哔哩哔哩1...
揭露透视!werplan免费挂... 揭露透视!werplan免费挂下载!一直真的有辅助技巧(有挂详细)-哔哩哔哩1、玩家可以在werpl...
教你透视!werplan怎么透... 教你透视!werplan怎么透视,wepoker免费脚本咨询,手册教程(真实有挂)-哔哩哔哩1、让任...
了解透视!来玩app破解版!果... 了解透视!来玩app破解版!果然是真的有辅助技巧(有挂方式)-哔哩哔哩运来玩app破解版辅助工具,进...
推荐透视!wepoker到底有... 推荐透视!wepoker到底有没有透视,aapoker透视脚本入口,方案教程(有挂工具)-哔哩哔哩w...
了解透视!哈糖大菠萝软件下载!... 了解透视!哈糖大菠萝软件下载!总是真的有辅助神器(有人有挂)-哔哩哔哩1、打开软件启动之后找到中间准...