Advertisement
kocurekc

Pine Script - Mansfield Relative Performance indicator

Apr 17th, 2014
488
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. study("Mansfield Relative Performance indicator")
  2. // Mansfield Relative Performance indicator
  3. //
  4. // Source: http://stageanalysis.net/reference/how-to-create-the-mansfield-relative-strength-indicator/558
  5. // Limits - This code is limited to the Daily value of the S&P 500 (SPX)
  6. // Rewrite for Tradingview "Pine Script" by Kocurekc, April 2014
  7. // https://getsatisfaction.com/tradingview/
  8. // https://www.tradingview.com/u/kocurekc/
  9. // Code is provided as public domain, no warranty
  10.  
  11. len = input(title="Lookback Period", type=integer, defval=50, minval=2)
  12. SNP = security("SPX", "D", close)
  13. RP = (close/SNP)*100
  14. MRP = ((RP/sma(RP, len)) - 1 )*100
  15. plot(MRP)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement