Convert my tradingview indicator script into a MT4 EA or indicator

MQL4 Dönüştürme

İş tamamlandı

Tamamlanma süresi: 12 saat

Şartname

//@version=4
study("Custom", overlay = true)
//Var dec
length = 9
fractionalMult = input(title="Key Value", step=1, defval=1)

tr2() =>
max(high - low, max(abs(high - close[1]), abs(low - close[1])))

//Calc delta
calc1(in1, in2) =>
alpha = in2
sum = 0.0
sum := (in1 + (alpha - 1) * nz(sum[1])) / alpha

value1 = fractionalMult * calc1(tr2(), length)

sigShort = hl2 + value1
sigShortPrev = nz(sigShort[1], sigShort)
sigLong = hl2 - value1
sigLongPrev = nz(sigLong[1], sigLong)

sigLong := close[1] > sigLongPrev ? max(sigLong, sigLongPrev) : sigLong
sigShort := close[1] < sigShortPrev ? min(sigShort, sigShortPrev) : sigShort

dir = 1
dir := nz(dir[1], dir)
//Filter extreme moves
dir := dir == -1 and close > sigShortPrev ? 1 : dir == 1 and close < sigLongPrev ? -1 : dir

alertcondition( dir[1] == -1 and dir == 1 ? sigLong : na, "BUY", "BUY")
alertcondition(dir[1] == 1 and dir == -1 ? sigShort : na, "SELL", "SELL")

//plot
plotshape(dir == 1 and dir[1] == -1 ? sigLong : na, title="LONG", style=shape.labelup, location=location.belowbar, size=size.normal, text="LONG", textcolor = color.white, color=http://color.green)
plotshape(dir == -1 and dir[1] == 1 ? sigShort : na, title="SHORT", style=shape.labeldown, location=location.abovebar, size=size.normal, text="SHORT", textcolor = color.white, color=http://color.red)


Yanıtlandı

1
Geliştirici 1
Derecelendirme
(851)
Projeler
1464
72%
Arabuluculuk
122
29% / 48%
Süresi dolmuş
358
24%
Çalışıyor
Yayınlandı: 3 makale
2
Geliştirici 2
Derecelendirme
(337)
Projeler
624
38%
Arabuluculuk
40
23% / 65%
Süresi dolmuş
93
15%
Serbest
Yayınlandı: 4 makale, 19 kod
3
Geliştirici 3
Derecelendirme
(590)
Projeler
789
71%
Arabuluculuk
9
33% / 33%
Süresi dolmuş
22
3%
Serbest
Yayınlandı: 8 kod
4
Geliştirici 4
Derecelendirme
(4)
Projeler
4
0%
Arabuluculuk
5
0% / 80%
Süresi dolmuş
1
25%
Serbest
5
Geliştirici 5
Derecelendirme
(647)
Projeler
1295
67%
Arabuluculuk
84
26% / 49%
Süresi dolmuş
338
26%
Serbest

Proje bilgisi

Bütçe
30+ USD
Son teslim tarihi
from 1 gün