在多个时间范围内寻找警报

问题描述

在30分钟图表上RSI14突破60时发出警告,如果1小时图表上RSI14高于60,并且在1日图表上RSI14超过60,则发出警告

基本上可以找到确认的看涨趋势,请帮助我实现这一目标。

解决方法

在这里,您是我的兄弟,下次再试一试,但以为我会帮助您。实际上,这非常简单,我也做到了,因此您可以分别调整每个RSI的长度。通读它,以便您了解它是如何工作的。我本人还是新手,但这应该可以正常工作。

//@version=4
study("MTF RSI",overlay=false)

//custom input for rsi lengths and timeframes
rsilen=input(14,minval=1,title="1st RSI Length",type=input.integer)
rsilen2=input(14,title="2nd RSI Length",type=input.integer)
rsilen3=input(14,title="3rd RSI Length",type=input.integer)
rsires=input("30",title="1st RSI Timeframe",type=input.resolution)
rsires2=input("60",title="2nd RSI Timeframe",type=input.resolution)
rsires3=input("1D",title="3rd RSI Timeframe",type=input.resolution)

//variables for each rsi
RSI1=rsi(close,rsilen)
RSI2=rsi(close,rsilen2)
RSI3=rsi(close,rsilen3)

//different timeframes for rsi
rsi1=security(syminfo.tickerid,rsires,RSI1)
rsi2=security(syminfo.tickerid,rsires2,RSI2)
rsi3=security(syminfo.tickerid,rsires3,RSI3)

//plots all 3 RSIs
plot(rsi1,title="1st RSI",color=color.red)
plot(rsi2,title="2nd RSI",color=color.green)
plot(rsi3,title="3rd RSI",color=color.blue)

//alert condition
alertcondition(rsi1 > 60 and rsi2 > 60 and rsi3 > 60,title="3 RSI Bullish",message="All 3 RSIs Bullish")

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...