Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.00 KB | None | 0 0
  1. // By @Oberisk (Twitter)
  2.  
  3. study("ObeliskTDS",overlay=true)
  4. transp=input(0)
  5. Numbers=input(true)
  6. SR=input(true)
  7. Barcolor=input(true)
  8. TD = close > close[4] ?nz(TD[1])+1:0
  9. TS = close < close[4] ?nz(TS[1])+1:0
  10.  
  11. TDUp = TD - valuewhen(TD < TD[1], TD , 1 )
  12. TDDn = TS - valuewhen(TS < TS[1], TS , 1 )
  13. plotshape(Numbers?(TDUp==1?true:na):na,style=shape.triangledown,text="1",color=green,location=location.abovebar,transp=transp)
  14. plotshape(Numbers?(TDUp==2?true:na):na,style=shape.triangledown,text="2",color=green,location=location.abovebar,transp=transp)
  15. plotshape(Numbers?(TDUp==3?true:na):na,style=shape.triangledown,text="3",color=green,location=location.abovebar,transp=transp)
  16. plotshape(Numbers?(TDUp==4?true:na):na,style=shape.triangledown,text="4",color=green,location=location.abovebar,transp=transp)
  17. plotshape(Numbers?(TDUp==5?true:na):na,style=shape.triangledown,text="5",color=green,location=location.abovebar,transp=transp)
  18. plotshape(Numbers?(TDUp==6?true:na):na,style=shape.triangledown,text="6",color=green,location=location.abovebar,transp=transp)
  19. plotshape(Numbers?(TDUp==7?true:na):na,style=shape.triangledown,text="7",color=green,location=location.abovebar,transp=transp)
  20. plotshape(Numbers?(TDUp==8?true:na):na,style=shape.triangledown,text="8",color=green,location=location.abovebar,transp=transp)
  21. plotshape(Numbers?(TDUp==9?true:na):na,style=shape.triangledown,text="9",color=green,location=location.abovebar,transp=transp)
  22. plotshape(Numbers?(TDUp==13?true:na):na,style=shape.triangledown,text="A13",color=black,location=location.abovebar,transp=transp)
  23.  
  24. plotshape(Numbers?(TDDn==1?true:na):na,style=shape.triangleup,text="1",color=red,location=location.belowbar,transp=transp)
  25. plotshape(Numbers?(TDDn==2?true:na):na,style=shape.triangleup,text="2",color=red,location=location.belowbar,transp=transp)
  26. plotshape(Numbers?(TDDn==3?true:na):na,style=shape.triangleup,text="3",color=red,location=location.belowbar,transp=transp)
  27. plotshape(Numbers?(TDDn==4?true:na):na,style=shape.triangleup,text="4",color=red,location=location.belowbar,transp=transp)
  28. plotshape(Numbers?(TDDn==5?true:na):na,style=shape.triangleup,text="5",color=red,location=location.belowbar,transp=transp)
  29. plotshape(Numbers?(TDDn==6?true:na):na,style=shape.triangleup,text="6",color=red,location=location.belowbar,transp=transp)
  30. plotshape(Numbers?(TDDn==7?true:na):na,style=shape.triangleup,text="7",color=red,location=location.belowbar,transp=transp)
  31. plotshape(Numbers?(TDDn==8?true:na):na,style=shape.triangleup,text="8",color=red,location=location.belowbar,transp=transp)
  32. plotshape(Numbers?(TDDn==9?true:na):na,style=shape.triangleup,text="9",color=red,location=location.belowbar,transp=transp)
  33. plotshape(Numbers?(TDDn==13?true:na):na,style=shape.triangleup,text="A13",color=black,location=location.belowbar,transp=transp)
  34.  
  35.  
  36. priceflip = barssince(close<close[4])
  37. sellsetup = close>close[4] and priceflip
  38. sell = sellsetup and barssince(priceflip!=9)
  39. sellovershoot = sellsetup and barssince(priceflip!=13)
  40. sellovershoot1 = sellsetup and barssince(priceflip!=14)
  41. sellovershoot2 = sellsetup and barssince(priceflip!=15)
  42. sellovershoot3 = sellsetup and barssince(priceflip!=16)
  43.  
  44.  
  45. priceflip1 = barssince(close>close[4])
  46. buysetup = close<close[4] and priceflip1
  47. buy = buysetup and barssince(priceflip1!=9)
  48. buyovershoot = barssince(priceflip1!=13) and buysetup
  49. buyovershoot1 = barssince(priceflip1!=14) and buysetup
  50. buyovershoot2 = barssince(priceflip1!=15) and buysetup
  51. buyovershoot3 = barssince(priceflip1!=16) and buysetup
  52.  
  53.  
  54. TDbuyh = valuewhen(buy,high,0)
  55. TDbuyl = valuewhen(buy,low,0)
  56. TDsellh = valuewhen(sell,high,0)
  57. TDselll = valuewhen(sell,low,0)
  58.  
  59.  
  60. plot(SR?(TDbuyh ? TDbuyl: na):na,style=circles, linewidth=1, color=red)
  61. plot(SR?(TDselll ? TDsellh : na):na,style=circles, linewidth=1, color=green)
  62. barcolor(Barcolor?(sell? #FF0000 : buy? #00FF00 : sellovershoot? #FF66A3 : sellovershoot1? #FF3385 : sellovershoot2? #FF0066 : sellovershoot3? #CC0052 : buyovershoot? #D6FF5C : buyovershoot1? #D1FF47 : buyovershoot2? #B8E62E : buyovershoot3? #8FB224 : na):na)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement