Advertisement
TheLark

Trading View Indicator: LMA

Feb 11th, 2014
1,655
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. study(title = "TheLark LMA (Laguerre)", shorttitle="TheLark LMA", overlay=true)
  2.  
  3. //•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•//
  4. // //
  5. // LAGUERRE MA BY THELARK //
  6. // ~ 2-12-14 ~ //
  7. // //
  8. // •/• //
  9. // //
  10. // https://www.tradingview.com/u/TheLark //
  11. // (please do not remove this heading) //
  12. // //
  13. //•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•//
  14.  
  15. // The Laguerre Average was discovered by John Ehlers.
  16. // It's a newer type of averaging that is meant to take out as much of the
  17. // inherent lag that your typical EMA and SMA's give at the start of a major trend change.
  18. // So what you get is an average that turns more quickly at major trend changes,
  19. // and doesn't get tripped up on the noise (as much).
  20.  
  21. //defs
  22. p = hl2
  23. //inputs
  24. Gamma = input(0.77)
  25. sd = input(true, title="Show dots?")
  26. ccol = input(true,title="Change Color?")
  27. //calc
  28. lag(g) =>
  29. L0 = (1 - g)*p+g*nz(L0[1])
  30. L1 = -g*L0+nz(L0[1])+g*nz(L1[1])
  31. L2 = -g*L1+nz(L1[1])+g*nz(L2[1])
  32. L3 = -g*L2+nz(L2[1])+g*nz(L3[1])
  33. f = (L0 + 2*L1 + 2*L2 + L3)/6
  34. f
  35. //plots
  36. lma = lag(Gamma)
  37. col = ccol ?( lma > lma[1] ? #0094FF : #FF3571) : #0094FF
  38. up = lma > lma[1] ? 1 : 0
  39. down = lma < lma[1] ? 1 : 0
  40. plot(lma,linewidth=2,color=col)
  41. plot(sd and cross(up,down) ? lma : na,style=circles, linewidth=4, color=col )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement