xmd79

OJ-Bot.v1

Sep 29th, 2021
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
  2. // © regi.argamosa
  3.  
  4. //@version=4
  5. strategy('OJ-Bot.v1', overlay = true,format=format.inherit)
  6.  
  7. ema10 = ema(close, 10)
  8. ema20 = ema(close, 20)
  9. ema50 = ema(close, 50)
  10. len_adx = input(14, minval = 1, title = "DI Length")
  11. lensig = input(14, title = "ADX Smoothing", minval = 1, maxval = 50)
  12. [plus, minus, adx] = dmi(len_adx, lensig)
  13. rsi14 = rsi(close, 14)
  14.  
  15. uptrend = ema10 > ema20 and ema20 > ema50 and adx >= 25
  16. downtrend = ema10 < ema20 and ema20 < ema50 and adx >= 25
  17. range = not uptrend and not downtrend
  18.  
  19. bcolor = uptrend ? color.green :
  20. downtrend ? color.red :
  21. color.white
  22.  
  23. barcolor(bcolor)
  24. plotchar(crossover(rsi14, 80), char='X', location=location.abovebar, color=color.white, size=size.tiny)
  25. plotchar(crossunder(rsi14,30), char='O', location=location.belowbar, color=color.white, size=size.tiny)
  26.  
Advertisement
Add Comment
Please, Sign In to add comment