Convert Prorealtime code to mt4

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

Convert Prorealtime code to mt4

Postby Jose Luis » Wed Jan 08, 2020 4:48 pm

Hi all,
Could someone convert Prorealtime indicator code to mt4?
ProRealtime language is easy to understand.

Thanks in advance.
User avatar
Jose Luis
 
Posts: 2
Joined: Wed Jan 08, 2020 4:43 pm


Re: Convert Prorealtime code to mt4

Postby Jose Luis » Thu Jan 09, 2020 6:01 am

Here is the code and I've attached an indicator screenshot:


Code: Select all
ClaridadGrafico=1
Infovelaavela=1
valorEntrCierr = 14

Rge = averagetruerange[14](close)
aAdx= ADX[14]
once shifttext=ClaridadGrafico
sto8=stochastic[8,3]
if Infovelaavela= 1 then

if aADX > aADX[1] then
Drawtext ("B", barindex,Low-0.3*Rge/Shifttext /0.2,SansSerif,boldItalic,10) coloured (055,0,155)
elsif  aADX < aADX[1] then
Drawtext ("F", barindex,Low-0.3*Rge/Shifttext /0.2,SansSerif,boldItalic,10) coloured (155,0,0)
endif
endif

if aAdx crosses over 20 and sto8 < sto8[3]  then
Drawtext ("TRADE", barindex,high+3*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (100,100,255)
elsif aAdx crosses over 20 and sto8 > sto8[3]  then
Drawtext ("TRADE", barindex,low-3*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (100,100,255)
endif
if aAdx crosses under 20 and sto8 < sto8[3] then
Drawtext ("DUDAS", barindex,high+2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (150,0,0)
elsif aAdx crosses under 20 and sto8 > sto8[3] then
Drawtext ("DUDAS", barindex,low-2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (150,0,0)
endif

if aAdx crosses over 55 and sto8 < sto8[3] then
Drawtext ("DANGER", barindex,high+2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (0,0,0)
elsif aAdx crosses over 55 and sto8 > sto8[3] then
Drawtext ("DANGER", barindex,low-2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (0,0,0)
endif
if aAdx crosses over 58 and sto8 < sto8[3] then
Drawtext ("BOOM", barindex,high+3*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (0,0,0)
elsif aAdx crosses over 58 and sto8 > sto8[3] then
Drawtext ("BOOM", barindex,low-3*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (0,0,0)
endif
if aAdx crosses over 68 and sto8 < sto8[3] then
Drawtext ("MEGABOOM", barindex,high+3*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (0,0,0)
elsif aAdx crosses over 68 and sto8 > sto8[3] then
Drawtext ("MEGABOOM", barindex,low-3*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (0,0,0)
endif
if aAdx crosses over 78 and sto8 < sto8[3] then
Drawtext ("DESASTRE", barindex,high+3*Rge/Shifttext /1,SansSerif,boldItalic,14) coloured (0,0,0)
elsif aAdx crosses over 78 and sto8 > sto8[3] then
Drawtext ("DESASTRE", barindex,low-3*Rge/Shifttext /1,SansSerif,boldItalic,14) coloured (0,0,0)
endif
if aAdx crosses over 22 and sto8 < sto8[3]  then
Drawtext ("F2", barindex,high+2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (100,100,255)
elsif aAdx crosses over 22 and sto8 > sto8[3]  then
Drawtext ("F2", barindex,low-2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (100,100,255)
endif
if aAdx crosses over 24 and sto8 < sto8[3]  then
Drawtext ("F4", barindex,high+3*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (100,100,255)
elsif aAdx crosses over 24 and sto8 > sto8[3]  then
Drawtext ("F4", barindex,low-3*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (100,100,255)
endif
if aAdx crosses over 26 and sto8 < sto8[3]  then
Drawtext ("F6", barindex,high+2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (100,100,255)
elsif aAdx crosses over 26 and sto8 > sto8[3]  then
Drawtext ("F6", barindex,low-2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (100,100,255)
endif
if aAdx crosses over 28 and sto8 < sto8[3]  then
Drawtext ("F8", barindex,high+3*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (100,100,255)
elsif aAdx crosses over 28 and sto8 > sto8[3]  then
Drawtext ("F8", barindex,low-3*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (100,100,255)
endif
if aAdx crosses over 30 and sto8 < sto8[3]  then
Drawtext ("F30", barindex,high+2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (100,100,255)
elsif aAdx crosses over 30 and sto8 > sto8[3]  then
Drawtext ("F30", barindex,low-2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (100,100,255)
endif
if aAdx crosses over 35 and sto8 < sto8[3]  then
Drawtext ("FF35", barindex,high+3*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (100,100,255)
elsif aAdx crosses over 35 and sto8 > sto8[3]  then
Drawtext ("FF35", barindex,low-3*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (100,100,255)
endif
if aAdx crosses over 40 and sto8 < sto8[3]  then
Drawtext ("FF40", barindex,high+2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (100,100,255)
elsif aAdx crosses over 40 and sto8 > sto8[3]  then
Drawtext ("FF40", barindex,low-2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (100,100,255)
endif
if aAdx crosses over 50 and sto8 < sto8[3] then
Drawtext ("PELIGRO", barindex,high+3*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (0,0,150)
elsif  aAdx crosses over 50 and sto8 > sto8[3] then
Drawtext ("PELIGRO", barindex,low-3*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (0,0,150)
endif
if aAdx crosses over 17 and sto8 < sto8[3] then
Drawtext ("BUENCAM", barindex,high+2.5*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (0,0,150)
elsif aAdx crosses over 17 and sto8 > sto8[3] then
Drawtext ("BUENCAM", barindex,low-2.5*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (0,0,150)
endif
if aAdx crosses over 15 and sto8 < sto8[3] then
Drawtext ("SALUCI", barindex,high+3*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (0,0,150)
elsif aAdx crosses over 15 and sto8 > sto8[3] then
Drawtext ("SALUCI", barindex,low-3*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (0,0,150)
endif
if aAdx crosses over 13 and sto8 < sto8[3] then
Drawtext ("SOPLO", barindex,high+1.5*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (0,0,150)
elsif aAdx crosses over 13 and sto8 > sto8[3] then
Drawtext ("SOPLO", barindex,low-1.5*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (0,0,150)
endif
if aAdx crosses over 10 and sto8 < sto8[3] then
Drawtext ("RESURR", barindex,high+2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (0,0,150)
elsif aAdx crosses over 10 and sto8 > sto8[3] then
Drawtext ("RESURR", barindex,low-2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (0,0,150)
endif
if aAdx crosses under 22 and sto8 < sto8[3] then
Drawtext ("F2", barindex,high+2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (155,0,0)
elsif aAdx crosses under 22 and sto8 > sto8[3] then
Drawtext ("F2", barindex,low-2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (155,0,0)
endif
if aAdx crosses under 24 and sto8 < sto8[3] then
Drawtext ("F4", barindex,high+2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (155,0,0)
elsif aAdx crosses under 24 and sto8 > sto8[3] then
Drawtext ("F4", barindex,low-2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (155,0,0)
endif
if aAdx crosses under 26 and sto8 < sto8[3] then
Drawtext ("F6", barindex,high+2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (155,0,0)
elsif aAdx crosses under 26 and sto8 > sto8[3] then
Drawtext ("F6", barindex,low-2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (155,0,0)
endif
if aAdx crosses under 28 and sto8 < sto8[3] then
Drawtext ("F8", barindex,high+2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (155,0,0)
elsif aAdx crosses under 28 and sto8 > sto8[3] then
Drawtext ("F8", barindex,low-2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (155,0,0)
endif
if aAdx crosses under 30 and sto8 < sto8[3] then
Drawtext ("F30", barindex,high+2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (155,0,0)
elsif aAdx crosses under 30 and sto8 > sto8[3] then
Drawtext ("F30", barindex,low-2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (155,0,0)
endif
if aAdx crosses under 35 and sto8 < sto8[3] then
Drawtext ("FF35", barindex,high+2*Rge/Shifttext /1,SansSerif,boldItalic,14) coloured (155,0,0)
elsif aAdx crosses under 35 and sto8 > sto8[3] then
Drawtext ("FF35", barindex,low-2*Rge/Shifttext /1,SansSerif,boldItalic,14) coloured (155,0,0)
endif
if aAdx crosses under 15 and sto8 < sto8[3] then
Drawtext ("EXTREM", barindex,high+2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (155,0,0)
elsif aAdx crosses under 15 and sto8 > sto8[3] then
Drawtext ("EXTREM", barindex,low-2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (155,0,0)
endif
if aAdx crosses under 10 and sto8 < sto8[3] then
Drawtext ("DEATH", barindex,high+2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (155,0,0)
elsif aAdx crosses under 10 and sto8 > sto8[3] then
Drawtext ("DEATH", barindex,low-2*Rge/Shifttext /1,SansSerif,boldItalic,11) coloured (155,0,0)
endif



REM Determinamos +DM y -DM
p= valorEntrCierr
masDM = max(high-high[1], 0)
menosDM = max(low[1]-low, 0)

if masDM > menosDM then
menosDM = 0
endif

if masDM < menosDM then
masDM = 0
endif

if masDM = menosDM then
masDM = 0
menosDM = 0
endif

REM Calculamos los indicadores direccionales

masDI = wilderAverage[p](masDM)
menosDI = wilderAverage[p](menosDM)

REM Calculamos el ADX

DX = ABS(masDI - menosDI) / (masDI + menosDI) * 100
miADX = wilderAverage[p](DX)
miadx=miadx
//willy=Williams[40](close)
sto76=stochastic[76,3]
if  miadx>15 and  sto76 > sto76[1] then

if miADX > miadx[1] and miADX[1]<miADX[2] then

Drawtext ("E", barindex,low-3*rge/shifttext /1,SansSerif,boldItalic,10) coloured (0,155,0)

elsif miADX < miadx[1] and miADX[1] > miADX[2]  then
Drawtext ("C", barindex,low-3*Rge/Shifttext /1,SansSerif,boldItalic,10) coloured (255,0,0)
endif
endif

if  miadx>15 and sto76 < sto76[1] then

if miADX > miadx[1] and miADX[1]<miADX[2] then

Drawtext ("E", barindex,high+3*Rge/shifttext /1,SansSerif,boldItalic,10) coloured (0,155,0)


elsif miADX < miadx[1] and miADX[1] > miADX[2]  then
Drawtext ("C", barindex,high+3*Rge/shifttext /1,SansSerif,boldItalic,10) coloured (255,0,0)
endif
endif


return


https://ibb.co/hWb26yM

Thx
User avatar
Jose Luis
 
Posts: 2
Joined: Wed Jan 08, 2020 4:43 pm

Re: Convert Prorealtime code to mt4

Postby Apprentice » Thu Jan 09, 2020 9:29 am

Your request is added to the development list.
Development reference 535.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36476
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia



Return to Indicator and Signal Requests

Who is online

Users browsing this forum: No registered users and 29 guests