TheLark

TheLark LMA (Laguerre) v2 - multi timeframe

What's new?
v2 has added multi timeframe support.
Blatantly stole Chris Moody's code for multi timeframe, because why re-invent the wheel? Thanks Chris ;P
BUT -- modified the coloring to work correctly with higher timeframes, just another Lark hack, so it's a give and take :)
_____________________________
The Laguerre Average (filter) was discovered by John Ehlers.
It's a newer type of averaging that is meant to take out as much of the
inherent lag that your typical EMA and SMA's give at the start of a major trend change.
So what you get is an average that turns more quickly at major trend changes,
and doesn't get tripped up on the noise (as much).
_____________________________
Please thumbs up/ star/ whatever this script if you like it & use it!
See my profile for more scripts, & be sure to follow for future releases.
Sorry for my hiatus, extremely busy these days working on both my own and client work.
This script was a user request.
สคริปต์โอเพนซอร์ซ

ด้วยจิตวิญญาณของ TradingView อย่างแท้จริง ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้ผู้ค้าสามารถเข้าใจและตรวจสอบได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ได้ฟรี แต่การใช้รหัสนี้ซ้ำในสิ่งพิมพ์อยู่ภายใต้กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?
study(title = "TheLark LMA v2 (Laguerre)", shorttitle="TheLark LMAv2", overlay=true)

//•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•//   
//                                             //
//         LAGUERRE MA v2 BY THELARK           //
//                 ~ 3-4-15 ~                  //
//                                             //
//                     •/•                     //
//                                             //
//    https://www.tradingview.com/u/TheLark    //
//                                             //
//•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•//

// The Laguerre Average (filter) was discovered by John Ehlers.
// It's a newer type of averaging that is meant to take out as much of the
// inherent lag that your typical EMA and SMA's give at the start of a major trend change.
// So what you get is an average that turns more quickly at major trend changes,
// and doesn't get tripped up on the noise (as much). 
// V2 has added multi timeframe support.
// Blatantly stole Chris Moody's code for multi timeframe, because why re-invent the wheel? Thanks Chris ;P
// BUT -- modified the coloring to work correctly with higher timeframes, just another Lark hack, so it's a give and take :)

//defs
p = hl2
//inputs
Gamma = input(0.77)
useCurrentRes = input(true, title="Use Current Chart Resolution?")
resCustom = input(title="Use Different Timeframe? (Uncheck Box Above).", type=resolution, defval="D")
res = useCurrentRes ? period : resCustom
sd = input(true, title="Show dots?")
ccol = input(true,title="Change Color?")
//calc
lag(g) =>
    L0 = (1 - g)*p+g*nz(L0[1])
    L1 = -g*L0+nz(L0[1])+g*nz(L1[1])
    L2 = -g*L1+nz(L1[1])+g*nz(L2[1])
    L3 = -g*L2+nz(L2[1])+g*nz(L3[1])
    f = (L0 + 2*L1 + 2*L2 + L3)/6
    f
//plots
lma = security(tickerid, res, lag(Gamma))
//col = ccol ? (lma > lma[1]?1:2):2
col = ccol ? ( lma == lma[1] and col[1] == 1 ? 1 : lma == lma[1] and col[1] == 2 ? 2 : lma > lma[1] ? 1 : 2) : 2
col2 = col < 2 ? #0094FF : #FF3571
up = col < col[1] ? 1 : 0
down = col > col[1] ? 1 : 0
plot(lma,linewidth=2,color=col2)
plot(sd and cross(up,down) ? lma : na,style=circles, linewidth=4, color=col2 )

ไอเดียที่เกี่ยวข้อง