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)

//标记指示

相关内容

热门资讯

玩家必看教程!闲逸辅助软件下载... 玩家必看教程!闲逸辅助软件下载苹果,智星德州插件最新版本更新内容详解,实用技巧(新版有挂);一、闲逸...
总算了解!四川辅助软件,wep... 【福星临门,好运相随】;总算了解!四川辅助软件,wepoker透视版下载,AI教程(有挂技术);暗藏...
最新技巧!微信小程序修改器,哈... 最新技巧!微信小程序修改器,哈糖大菠萝有挂吗,揭秘教程(有挂实锤);亲,有的,ai轻松简单,又可以获...
热点讨论!杭州都莱大菠萝辅助器... 热点讨论!杭州都莱大菠萝辅助器,wepoker怎么看牌型,必赢方法(有挂规律);咨询k服杭州都莱大菠...
如何分辨真伪!四川途游小程序辅... 如何分辨真伪!四川途游小程序辅助软件,newpoker怎么安装脚本,透视教程(有挂总结);AI辅助机...
推荐攻略!微信西楚辅助,pok... 推荐攻略!微信西楚辅助,pokemmo辅助器脚本下载,辅助教程(今日头条);是一款可以让一直输的玩家...
终于知道!吉安中至小程序微信辅... 终于知道!吉安中至小程序微信辅助,wepoker作弊方法,透明挂教程(有挂实锤);吉安中至小程序微信...
最新研发!福建天天开心辅助网,... 最新研发!福建天天开心辅助网,wpk辅助器,详细教程(讲解有挂);亲,有的,ai轻松简单,又可以获得...
我来向大家传授!四川麻将口诀顺... 我来向大家传授!四川麻将口诀顺口溜,hhpoker怎么破解,必胜教程(确实有挂);1、很好的四川麻将...
每日必备!相约十三水破解,破解... 您好:相约十三水破解这款游戏可以开挂的,确实是有挂的,很多玩家在这款游戏中打牌都会发现很多用户的牌特...