Last active
July 19, 2019 22:54
-
-
Save StefanKrecher/5888c7d74a308ee8bf236db1409653cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//@version=2 | |
study("RSI+MA", overlay=true) | |
// data series for RSI with length 14 | |
rsi = rsi(close, 14) | |
// data series for Moving Average with length 9 | |
ma = sma(close, 9) | |
// data series for buy signals: | |
//price should be below the moving average and RSI should be smaller than 40 | |
buy_signals = close < ma and rsi < 30 | |
// data series for sell signals: | |
//price should be above the moving average and RSI should be above 60 | |
sell_signals = close > ma and rsi > 70 | |
// draw some shapes on the chart if conditions are met | |
plotshape(buy_signals, style=shape.triangleup, text="up") | |
plotshape(sell_signals, style=shape.triangledown, text="down") | |
// create alert conditions so that alerts can be create via the add alerts dialog | |
alertcondition(buy_signals, title='Buy-Signal', message='price is below the MA and RSI is below 40') | |
alertcondition(sell_signals, title='Sell-Signal', message='price is above the MA and RSI is above 60') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks so good !