AnthonyAlexander

True Trend Strength -Completed

Jan 5th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. //@version=3
  2. study("True Trend Strength",overlay=false)
  3. //
  4. bc = input(false,title="Enable Bar Color")
  5. len = input(15,title="Period")
  6. //
  7. buyPower1 = highest(high,len)
  8. buyPower2 = lowest(low,len)[len]
  9. x_15dayBuyPower = buyPower1-buyPower2
  10.  
  11. sellPower1 = highest(high,len)[len]
  12. sellPower2 = lowest(low,len)
  13. x_15daySellPower = sellPower1 - sellPower2
  14.  
  15. plot(x_15dayBuyPower,color=blue,title="Buyer Strength",transp=0,style=histogram,linewidth=3)
  16. plot(x_15daySellPower,color=red,title="Seller Strength",transp=0,style=histogram,linewidth=3)
  17. barcolor(not bc ? na: x_15dayBuyPower > x_15daySellPower ? green :red,title="barcolor")
  18.  
  19. alertcondition(x_15dayBuyPower, title='Buyer Strength', message='Buyer Strength!')
  20. alertcondition(x_15daySellPower, title='Seller Strength', message='Seller Strength!')
Advertisement
Add Comment
Please, Sign In to add comment