工作已完成
执行时间7 小时
客户反馈
My order has been fully covered. A successful developer
指定
I want the indicator SQZMOM_LB published in Tradingview (Pine Script) to be edited to MQL5.
The indicator should look the same in both applications, the study results should be the same and should produce the same values.
| SOURCE CODE ( PineScript) | ||||
| // | ||||
| // @author LazyBear | ||||
| // List of all my indicators: | ||||
| // | ||||
| study(shorttitle = "SQZMOM_LB", title="Squeeze Momentum Indicator [LazyBear]", overlay=false) | ||||
| length = input(20, title="BB Length") | ||||
| mult = input(2.0,title="BB MultFactor") | ||||
| lengthKC=input(20, title="KC Length") | ||||
| multKC = input(1.5, title="KC MultFactor") | ||||
| useTrueRange = input(true, title="Use TrueRange (KC)", type=bool) | ||||
| // Calculate BB | ||||
| source = close | ||||
| basis = sma(source, length) | ||||
| dev = multKC * stdev(source, length) | ||||
| upperBB = basis + dev | ||||
| lowerBB = basis - dev | ||||
| // Calculate KC | ||||
| ma = sma(source, lengthKC) | ||||
| range = useTrueRange ? tr : (high - low) | ||||
| rangema = sma(range, lengthKC) | ||||
| upperKC = ma + rangema * multKC | ||||
| lowerKC = ma - rangema * multKC | ||||
| sqzOn = (lowerBB > lowerKC) and (upperBB < upperKC) | ||||
| sqzOff = (lowerBB < lowerKC) and (upperBB > upperKC) | ||||
| noSqz = (sqzOn == false) and (sqzOff == false) | ||||
| val = linreg(source - avg(avg(highest(high, lengthKC), lowest(low, lengthKC)),sma(close,lengthKC)), | ||||
| lengthKC,0) | ||||
| bcolor = iff( val > 0, | ||||
| iff( val > nz(val[1]), lime, green), | ||||
| iff( val < nz(val[1]), red, maroon)) | ||||
| scolor = noSqz ? blue : sqzOn ? black : gray | ||||
| plot(val, color=bcolor, style=histogram, linewidth=4) | ||||
| plot(0, color=scolor, style=cross, linewidth=2) | ||||
反馈
1
等级
项目
18
33%
仲裁
0
逾期
0
空闲
2
等级
项目
624
38%
仲裁
40
23%
/
65%
逾期
93
15%
空闲
发布者: 4 文章, 19 代码
3
等级
项目
0
0%
仲裁
0
逾期
0
空闲
项目信息
预算
40+ USD
截止日期
从 1 到 2 天
