Professional Documents
Culture Documents
Deux Indicteur
Deux Indicteur
//---------------------------------------------------------------------------------
--------------------------------------------------------------------------------
// Indicateur 1 : Range Filter - B&S Signals
//---------------------------------------------------------------------------------
--------------------------------------------------------------------------------
// Direction Conditions
var fdir = 0.0
fdir := filt > filt[1] ? 1 : filt < filt[1] ? -1 : fdir
upward = fdir == 1 ? 1 : 0
downward = fdir == -1 ? 1 : 0
// Trading Conditions
longCond = (rng_src > filt and rng_src > rng_src[1] and upward > 0) or (rng_src >
filt and rng_src < rng_src[1] and upward > 0)
shortCond = (rng_src < filt and rng_src < rng_src[1] and downward > 0) or (rng_src
< filt and rng_src > rng_src[1] and downward > 0)
CondIni = 0
CondIni := longCond ? 1 : shortCond ? -1 : CondIni[1]
longCondition = longCond and CondIni[1] == -1
shortCondition = shortCond and CondIni[1] == 1
// Alerts
alertcondition(longCondition, title="Buy Alert", message="BUY")
alertcondition(shortCondition, title="Sell Alert", message="SELL")
//---------------------------------------------------------------------------------
--------------------------------------------------------------------------------
// Indicateur 2 : Multi-Spectral RSI Deviations [AlgoAlpha]
//---------------------------------------------------------------------------------
--------------------------------------------------------------------------------
// RSI values
v1 = ta.rsi(close, len)
v2 = ta.rsi(close, len1)
v3 = ta.rsi(close, len2)
x = v1 - v2
x1 = v2 - v3
f = ta.hma(math.avg(x, x1), slen)
//@version=5
indicator("Combined Indicator", shorttitle="Combined Ind", overlay=true)
//---------------------------------------------------------------------------------
--------------------------------------------------------------------------------
// Indicateur 1 : Range Filter - B&S Signals
//---------------------------------------------------------------------------------
--------------------------------------------------------------------------------
// Direction Conditions
var fdir = 0.0
fdir := filt > filt[1] ? 1 : filt < filt[1] ? -1 : fdir
upward = fdir == 1 ? 1 : 0
downward = fdir == -1 ? 1 : 0
// Trading Conditions
longCond = (rng_src > filt and rng_src > rng_src[1] and upward > 0) or (rng_src >
filt and rng_src < rng_src[1] and upward > 0)
shortCond = (rng_src < filt and rng_src < rng_src[1] and downward > 0) or (rng_src
< filt and rng_src > rng_src[1] and downward > 0)
CondIni = 0
CondIni := longCond ? 1 : shortCond ? -1 : CondIni[1]
longCondition = longCond and CondIni[1] == -1
shortCondition = shortCond and CondIni[1] == 1
// Alerts
alertcondition(longCondition, title="Buy Alert", message="BUY")
alertcondition(shortCondition, title="Sell Alert", message="SELL")
//---------------------------------------------------------------------------------
--------------------------------------------------------------------------------
// Indicateur 2 : Multi-Spectral RSI Deviations [AlgoAlpha]
//---------------------------------------------------------------------------------
--------------------------------------------------------------------------------
// RSI values
v1 = ta.rsi(close, len)
v2 = ta.rsi(close, len1)
v3 = ta.rsi(close, len2)
x = v1 - v2
x1 = v2 - v3
f = ta.hma(math.avg(x, x1), slen)