AnthonyAlexander

vhwr .v2

Oct 1st, 2021
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. //@version=3
  2. strategy("VPLS v.1",overlay=false)
  3.  
  4. k = sma(stoch(close, high, low, 5), 1)
  5. d = sma(k, 1)
  6. stochbullish = (k > k[1])
  7. stockbearish = (k < k[1])
  8. maa = input(28)
  9. rsii = input(5)
  10. lowr = input(1)
  11. x1 = close > sma(close,200)
  12. x2 = close < close[1]
  13. //x3 = rsi(close,2)[1] < rsii and rsi(close,2) > lowr
  14. x3 = rsi(close,2) < 2
  15. x4 = close > sma(close,maa)
  16.  
  17.  
  18.  
  19. BodyTop = max(open,close)
  20. BodyBot = min(open,close)
  21. BodySize = BodyTop - BodyBot
  22.  
  23. BodyAvg = ema(BodySize,20) * 2
  24.  
  25.  
  26. long = x1 and x2 and x3 and x4 and stochbullish and volume < volume[1] //and BodySize > BodyAvg
  27.  
  28. bgcolor(long ? green:na,transp=0)
  29.  
  30. z1 = close < sma(close,200)
  31. z2 = close > close[1]
  32. //z3 = rsi(close,2)[1] > 95 and rsi(close,2) < 99
  33. z3 = rsi(close,2) > 98
  34. z4 = close < sma(close,maa)
  35. short = z1 and z2 and z3 and z4 and stockbearish and volume < volume[1] //and BodySize > BodyAvg
  36.  
  37. bgcolor(short ? red:na,transp=0)
  38.  
  39. //bgcolor(short ? red:na,transp=0)
  40.  
  41. //plot(sma(close,200),color=orange,linewidth=3,transp=0)
  42. //plot(sma(close,3),color=green,linewidth=1,transp=0)
  43.  
  44. sell = (close > sma(close,3) or close > open)
  45. //strategy.entry("buy", true, when = long)
  46. //strategy.close("buy", when = sell)
  47.  
  48. strategy.order("long", true, 1000,when = long )
  49. strategy.order("long", true, 3000,when = long[1] and open > close)
  50. //strategy.exit("exit", "long",when = close > sma(close,3))
  51. //strategy.close_all(when = close > sma(close,3))
  52.  
  53. //strategy.entry("buy", true, when = open > close)
  54. //strategy.close("buy", when = open < close)
  55.  
  56.  
  57. //////////strategy.close_all( (long[1] or (long[1] and open > close)[1] ) and close > sma(close,3))
  58.  
  59. strategy.close("long" , when = close > sma(close,3))
  60.  
  61. strategy.entry("short", false,1000, when = short )
  62. strategy.entry("short", false,3000, when = short[1] and open < close)
  63.  
  64. strategy.close("short" , when = close < sma(close,3))
  65.  
  66.  
  67. //strategy.close("short", when = short[1] and open > close)
  68.  
  69. ///////strategy.close_all( (short[2] or (short[1] and open < close)[1] ) and close < sma(close,3))
  70.  
  71.  
  72. plot(strategy.equity)
  73.  
  74.  
Advertisement
Add Comment
Please, Sign In to add comment