Advertisement
AnthonyAlexander

True Volume Strength source

Feb 14th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. //@version=2
  2. study("True Volume Strength")
  3.  
  4. pressure_function(Singlevariable, Multivariable)=>
  5. _length_adjusted = Multivariable < 1 ? 1 : Multivariable
  6. _sum = 0
  7. for _i = 0 to (_length_adjusted - 1)
  8. _sum := _sum + Singlevariable[_i]
  9. _return = _sum / _length_adjusted
  10.  
  11. UpperLim = highest(high,10)
  12. LowerLim = lowest(low,10)
  13. lowerlim1 = LowerLim[1]
  14. at10dayhi = high == UpperLim
  15. at10daylo = low == LowerLim
  16. loisarisin = LowerLim > lowerlim1
  17. trade = at10dayhi + at10daylo
  18. var21 = highest(volume,5)
  19. var22 = lowest(volume,5)
  20. var23 = volume-var22
  21. var24 = var21-var22
  22. var25 = var23/var24
  23.  
  24. VOLK = var25*100
  25. VOLD = pressure_function(VOLK,5)
  26.  
  27. var1 = highest(high,5)
  28. lo5 = lowest(low,5)
  29.  
  30. var3 = close-lo5
  31. var4 = var1-lo5
  32. var5 = var3/var4
  33.  
  34. PRICEK = var5*100
  35. PRICED = pressure_function(PRICEK,5)
  36.  
  37. bear = crossover(VOLD,PRICED)
  38. bull = crossover(PRICED,VOLD)
  39.  
  40. alertcondition(bull, title='Buyers Overweigh Sellers', message='Bullish Volume!')
  41. alertcondition(bear, title='Sellers Overweigh Buyers', message='Bearish Volume!')
  42.  
  43. plot(VOLD,color=red,style=histogram,title="Sell Pressure",linewidth=4,transp=0)
  44. plot(PRICED,color=green,style=histogram,title="Buy Pressure",linewidth=4,transp=0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement