Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
- // © regi.argamosa
- //@version=4
- strategy('OJ-Bot.v1', overlay = true,format=format.inherit)
- ema10 = ema(close, 10)
- ema20 = ema(close, 20)
- ema50 = ema(close, 50)
- len_adx = input(14, minval = 1, title = "DI Length")
- lensig = input(14, title = "ADX Smoothing", minval = 1, maxval = 50)
- [plus, minus, adx] = dmi(len_adx, lensig)
- rsi14 = rsi(close, 14)
- uptrend = ema10 > ema20 and ema20 > ema50 and adx >= 25
- downtrend = ema10 < ema20 and ema20 < ema50 and adx >= 25
- range = not uptrend and not downtrend
- bcolor = uptrend ? color.green :
- downtrend ? color.red :
- color.white
- barcolor(bcolor)
- plotchar(crossover(rsi14, 80), char='X', location=location.abovebar, color=color.white, size=size.tiny)
- plotchar(crossunder(rsi14,30), char='O', location=location.belowbar, color=color.white, size=size.tiny)
Advertisement
Add Comment
Please, Sign In to add comment