Advertisement
Guest User

Untitled

a guest
Apr 19th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.88 KB | None | 0 0
  1. study(title="GHOST Indicator [@Bkawk]", shorttitle="GHOST Indicator [@bkawk]", overlay=true)
  2.  
  3. slime = #B7ED0A
  4. blood = #FF4167
  5.  
  6. inputBigTrend1 = input(850, minval=1, title="EMA1")
  7. inputBigTrend2 = input(200, minval=1, title="EMA2")
  8. inputEma = input(50, minval=1, title="EMA3")
  9. inputConversion = input(9, minval=1, title="Conversion")
  10. inputBase = input(26, minval=1, title="Base")
  11. inputTinyTrend1 = input(8, minval=1, title="EMA4")
  12. inputTinyTrend2 = input(41, minval=1, title="EMA5")
  13. inputLong = input(3, minval=1, title="LAST CHANCE LONG")
  14. inputShort = input(6, minval=1, title="LAST CHANCE SHORT")
  15.  
  16.  
  17. bigTrend1 = ema(close, inputBigTrend1)
  18. bigTrend2 = ema(close, inputBigTrend2)
  19. tinyTrend1 = ema(close, inputTinyTrend1)
  20. tinyTrend2 = ema(close, inputTinyTrend2)
  21.  
  22. averageLength(len) => avg(lowest(len), highest(len))
  23. smallTrendCalc1 = averageLength(inputConversion)
  24. smallTrendCalc2 = averageLength(inputBase)
  25. smallTrendMiddle = ema(close, inputEma)
  26. goLong=close[1]>goLong[1]? max(hl2-(inputLong*atr(inputShort)),goLong[1]) : hl2-(inputLong*atr(inputShort))
  27. goShort=close[1]<goShort[1]? min(hl2+(inputLong*atr(inputShort)),goShort[1]) : hl2+(inputLong*atr(inputShort))
  28. go = close > goShort[1] ? 1: close< goLong[1]? -1: nz(go[1],1)
  29.  
  30.  
  31. bigTrendLine1 = plot(bigTrend1, style = cross, color = black, transp = 100)
  32. tinyTrendLine1 = plot(tinyTrend1, style = cross, color = black, transp = 100)
  33. smallTrendLine1 = plot(smallTrendCalc1, style = cross, color = black, transp = 100)
  34. bigAbove = plot(bigTrend2 >= bigTrend1 ? bigTrend2 : na, color = black, transp = 100)
  35. bigBelow = plot(bigTrend2 < bigTrend1 ? bigTrend2 : na, color = black, transp = 100)
  36. tinyAbove = plot(tinyTrend2 >= tinyTrend1 ? tinyTrend2 : na, color = black, transp = 100)
  37. tinyBelow = plot(tinyTrend2 < tinyTrend1 ? tinyTrend2 : na, color = black, transp = 100)
  38. smallAbove = plot(smallTrendCalc2 >= smallTrendCalc1 ? smallTrendCalc2 : na, color = black, transp = 100)
  39. smallBelow = plot(smallTrendCalc2 <= smallTrendCalc1 ? smallTrendCalc2 : na, color = black, transp = 100)
  40.  
  41. plot(smallTrendMiddle, linewidth = 2, color = white)
  42. fill(bigTrendLine1, bigBelow, blood, transp = 90)
  43. fill(bigTrendLine1, bigAbove, slime, transp = 90)
  44. fill(tinyTrendLine1, tinyBelow, slime, transp = 70)
  45. fill(tinyTrendLine1, tinyAbove, blood, transp = 70)
  46. fill(smallTrendLine1, smallBelow, slime, transp = 70)
  47. fill(smallTrendLine1, smallAbove, blood, transp = 70)
  48.  
  49. plotshape(go == -1 and go[1] == 1 ? go : na, style=shape.labeldown, location=location.abovebar, color=blood)
  50. plotshape(go == 1 and go[1] == -1 ? go : na, style=shape.labelup, location=location.belowbar, color=slime)
  51.  
  52. plotarrow(go == 1 and go[1] == -1 ? go : na, title="Last chance for a long entry", colorup=slime, maxheight=1000, minheight=980, transp=0)
  53. plotarrow(go == -1 and go[1] == 1 ? go : na, title="Last Chance for a short entry", colordown=blood, maxheight=1000, minheight=980, transp=0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement