TradingView Pine Script to MT4 Indicator

MQL4 Converting

Job finished

Execution time 1 hour
Feedback from customer
I have been thoroughly impressed by your responsiveness and promptness in addressing my requirements
Feedback from employee
Thank you

Specification

Please convert the Pine Script below into MQL4 Indicator, an indicator of ADX and DI, 2 day period max:


//@version=4

study("ADX and DI for v4")
len = input(20)

TrueRange = max(max(high-low, abs(high-nz(close[1]))), abs(low-nz(close[1])))
DirectionalMovementPlus = high-nz(high[1]) > nz(low[1])-low ? max(high-nz(high[1]), 0): 0
DirectionalMovementMinus = nz(low[1])-low > high-nz(high[1]) ? max(nz(low[1])-low, 0): 0

SmoothedTrueRange = 0.0
SmoothedTrueRange := nz(SmoothedTrueRange[1]) - (nz(SmoothedTrueRange[1])/len) + TrueRange

SmoothedDirectionalMovementPlus = 0.0
SmoothedDirectionalMovementPlus := nz(SmoothedDirectionalMovementPlus[1]) - (nz(SmoothedDirectionalMovementPlus[1])/len) + DirectionalMovementPlus

SmoothedDirectionalMovementMinus = 0.0
SmoothedDirectionalMovementMinus := nz(SmoothedDirectionalMovementMinus[1]) - (nz(SmoothedDirectionalMovementMinus[1])/len) + DirectionalMovementMinus

DIPlus = SmoothedDirectionalMovementPlus / SmoothedTrueRange * 100
DIMinus = SmoothedDirectionalMovementMinus / SmoothedTrueRange * 100
DX = abs(DIPlus-DIMinus) / (DIPlus+DIMinus)*100
ADX = sma(DX, len)

plot(DIPlus, color=color.green, title="DI+")
plot(DIMinus, color=color.red, title="DI-")
plot(ADX, color=color.yellow, title="ADX")


Responded

1
Developer 1
Rating
(35)
Projects
50
42%
Arbitration
3
33% / 33%
Overdue
4
8%
Free
2
Developer 2
Rating
(268)
Projects
603
34%
Arbitration
65
22% / 57%
Overdue
147
24%
Working
Published: 1 article, 22 codes
3
Developer 3
Rating
(12)
Projects
14
43%
Arbitration
3
33% / 33%
Overdue
2
14%
Free
4
Developer 4
Rating
(171)
Projects
195
42%
Arbitration
13
8% / 54%
Overdue
9
5%
Free
Published: 3 codes
5
Developer 5
Rating
(12)
Projects
12
25%
Arbitration
0
Overdue
1
8%
Free
6
Developer 6
Rating
(13)
Projects
18
44%
Arbitration
2
50% / 50%
Overdue
0
Free
7
Developer 7
Rating
(574)
Projects
945
47%
Arbitration
309
58% / 27%
Overdue
125
13%
Free

Project information

Budget
35+ USD
Deadline
to 2 day(s)