Combining 3 Indicators SHORT

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.

0
at https://mozilla.org/MPL/2.0/
// © Username

//@version=5
indicator('Combining 3 indicators SHORT', overlay=true)

fast_ema_L = input.int(defval=9, title='Fast EMA Length')


slow_ema_L = input.int(defval=21, title='Slow EMA Length')

fast_macd_L = input.int(defval=12, title='Fast MACD Length')


slow_macd_L = input.int(defval=26, title='Slow MACD Length')
siglen = input.int(defval=9, title='Signal Smoothing MACD')

rsi_L = input.int(defval=7, title='RSI Length')


rsi_val = input.int(defval=40, title='RSI lesser than')

fast_ema = ta.ema(close, fast_ema_L)


slow_ema = ta.ema(close, slow_ema_L)

[macdLine, signalLine, histLine] = ta.macd(close, fast_macd_L, slow_macd_L, siglen)

rsi = ta.rsi(close, rsi_L)

buy = ta.crossunder(fast_ema, slow_ema) and signalLine < macdLine and rsi < rsi_val
sell = ta.crossover(fast_ema, slow_ema)

alertcondition(buy, 'ENTRY', 'ENTRY')


alertcondition(sell, 'EXIT', 'EXIT')

plot(macdLine, title='MACD Line', color=color.blue)


plot(signalLine, title='MACD Signal Line', color=color.orange)

plot(fast_ema, title='Fast EMA', color=color.aqua)


plot(slow_ema, title='Slow EMA', color=color.yellow)

plotchar(buy, title='ENTRY', char=shape.triangledown, text='ENTRY',


color=color.green)
plotchar(sell, title='EXIT',char=shape.triangleup, text='EXIT', color=color.green)

plot(rsi, title='RSI', color=color.green)

You might also like