Convert PineScript V3 to MQL5

Tarea técnica

//@version=3
//

strategy(title = "JustAmhas 3S2", shorttitle = "JustAmhas 3S1", overlay=true, pyramiding=0, default_qty_value=1, commission_value=0.05)


// === INPUTS ===
useRes      = true
intRes      = input(defval = 2,    title = "Multiplier for Alernate Resolution")
stratRes    = ismonthly? tostring(interval*intRes,"###M") : isweekly? tostring(interval*intRes,"###W") : isdaily?  tostring(interval*intRes,"###D") : isintraday ? tostring(interval*intRes,"####") : '60'
basisType   = input(defval = "TEMA", title = "MA Type: ", options=["DEMA","EMA", "TEMA", "WMA", "VWMA", "HullMA", "LSMA", "ALMA", "TMA", "SSMA"])
basisLen    = input(defval = 8, title = "MA Period", minval = 1)
offsetSigma = input(defval = 6, title = "Offset for LSMA / Sigma for ALMA", minval = 0)
offsetALMA  = input(defval = 0.85, title = "Offset for ALMA", minval = 0, step = 0.01)
delayOffset = 0

// Constants colours that include fully non-transparent option.
green100 = #008000FF
lime100  = #00FF00FF
red100   = #FF0000FF
blue100  = #0000FFFF
aqua100  = #00FFFFFF
darkred100 = #8B0000FF
gray100 = #808080FF

// === BASE FUNCTIONS ===
// Returns MA input selection variant, default to SMA if blank or typo.
variant(type, src, len, offSig, offALMA) =>
    v1 = sma(src, len)                                                  // Simple
    v2 = ema(src, len)                                                  // Exponential
    v3 = 2 * v2 - ema(v2, len)                                          // Double Exponential
    v4 = 3 * (v2 - ema(v2, len)) + ema(ema(v2, len), len)               // Triple Exponential
    v5 = wma(src, len)                                                  // Weighted
    v6 = vwma(src, len)                                                 // Volume Weighted
    v7 = 0.0
    v7 := na(v7[1]) ? sma(src, len) : (v7[1] * (len - 1) + src) / len    // Smoothed
    v8 = wma(2 * wma(src, len / 2) - wma(src, len), round(sqrt(len)))   // Hull
    v9 = linreg(src, len, offSig)                                       // Least Squares
    v10 = alma(src, len, offALMA, offSig)                               // Arnaud Legoux
    v11 = sma(v1,len)                                                   // Triangular (extreme smooth)
    // SuperSmoother filter
    // © 2013  John F. Ehlers
    a1 = exp(-1.414*3.14159 / len)
    b1 = 2*a1*cos(1.414*3.14159 / len)
    c2 = b1
    c3 = (-a1)*a1
    c1 = 1 - c2 - c3
    v12 = 0.0
    v12 := c1*(src + nz(src[1])) / 2 + c2*nz(v12[1]) + c3*nz(v12[2])
    type=="EMA"?v2 : type=="DEMA"?v3 : type=="TEMA"?v4 : type=="WMA"?v5 : type=="VWMA"?v6 : type=="SMMA"?v7 : type=="HullMA"?v8 : type=="LSMA"?v9 : type=="ALMA"?v10 : type=="TMA"?v11: type=="SSMA"?v12: v1

// security wrapper for repeat calls
reso(exp, use, res) => use ? security(tickerid, res, exp, gaps=barmerge.gaps_off, lookahead=barmerge.lookahead_on) : exp


// === SERIES SETUP ===
closeSeries     = variant(basisType, close[delayOffset], basisLen, offsetSigma, offsetALMA)
openSeries      = variant(basisType, open[delayOffset], basisLen, offsetSigma, offsetALMA)


// === PLOTTING ===

// Get Alternate resolution Series if selected.
closeSeriesAlt = reso(closeSeries, useRes, stratRes)
openSeriesAlt = reso(openSeries, useRes, stratRes)
trendColour = (closeSeriesAlt > openSeriesAlt) ? green : red

bcolour     = (closeSeries > openSeriesAlt) ? lime100 : red100
closeP=plot(closeSeriesAlt, title = "Close Series", color = trendColour, linewidth = 2, style = line, transp = 20)
openP=plot(openSeriesAlt, title = "Open Series", color = trendColour, linewidth = 2, style = line, transp = 20)

fill(closeP,openP,color=trendColour,transp=80)


// === ALERT condition 1
xlong       = crossover(closeSeriesAlt, openSeriesAlt)
xshort      = crossunder(closeSeriesAlt, openSeriesAlt)

longCond    = xlong   // alternative: longCond[1]? false : (xlong or xlong[1]) and close>closeSeriesAlt and close>=open
shortCond   = xshort  // alternative: shortCond[1]? false : (xshort or xshort[1]) and close<closeSeriesAlt and close<=open

ebar            = 10000
dummy           = false

//
// Calculate how many mars since last bar
tdays       = (timenow-time)/60000.0  // number of minutes since last bar
tdays       := ismonthly? tdays/1440.0/5.0/4.3/interval : isweekly? tdays/1440.0/5.0/interval : isdaily? tdays/1440.0/interval : tdays/interval // number of bars since last bar

//set up exit parameters
TP = 200
SL = 200

// Make sure we are within the bar range, Set up entries and exit conditions
if (ebar==0 or tdays<=ebar)
    strategy.entry("long", strategy.long, when=longCond==true)
    strategy.entry("short", strategy.short, when=shortCond==true)
    strategy.close("long", when = shortCond==true)
    strategy.close("short", when = longCond==true)
    strategy.exit("exit", from_entry = "long", profit = TP, loss = SL)
    strategy.exit("exit", from_entry = "short", profit = TP, loss = SL)



Han respondido

1
Desarrollador 1
Evaluación
(301)
Proyectos
451
65%
Arbitraje
5
40% / 0%
Caducado
4
1%
Trabaja
2
Desarrollador 2
Evaluación
(30)
Proyectos
55
22%
Arbitraje
12
67% / 8%
Caducado
2
4%
Libre
3
Desarrollador 3
Evaluación
(409)
Proyectos
540
75%
Arbitraje
9
44% / 0%
Caducado
24
4%
Libre
4
Desarrollador 4
Evaluación
(4)
Proyectos
6
0%
Arbitraje
4
25% / 75%
Caducado
0
Libre
5
Desarrollador 5
Evaluación
(4)
Proyectos
4
0%
Arbitraje
2
0% / 100%
Caducado
1
25%
Libre
6
Desarrollador 6
Evaluación
(564)
Proyectos
933
47%
Arbitraje
303
59% / 25%
Caducado
125
13%
Trabajando
Solicitudes similares
Fintech robots 30+ USD
Specification I need a grid ea that puts buy stops and sell stops on the chart (only stops no limits). See image Example: if the price moves up filling the buy stops. The ea should place new sell stops below the price for the set parameters. And vice versa. Also if price moves up it should place new buy stops above the last buy stop. So if the parameter is set to 50 buy stops. There should always be 50 buy stops in
Develop a multi-strategies EA that makes entries based on selectable indicator-based criteria. Each can be toggled on/off, and trades can also be placed using a selectable combination of signals. Each trade position shall be entered on the bar and managed as a modified martingale. Position management will include partial close, variable grid increase as grid number increases, News stops, and a Dashboard for manual
Hello, In need an expert advisor that can copy my CFD (GBPUSD) into Futures 6B, along with AUDUSD. & that whenever I close the position, it closes it aswell. Also if there is limited broker API access, I don't mind getting a broker recommendation
I need an EA that opens trades according to the crossover of Moving Averages. The EA is based on two Moving Averages MA1 and MA2: For every new candle the EA attempts to open a new position, according to the MA crossover direction: If MA1>MA2, open a BUY position If MA1<MA2, open a SELL position There is a limit for current open trades which is also set in the settings. If the number of open trades reaches that
The job is simple, I want a custom indicator which consist of a combination of 3 indicators in separate window as I will show you in the screenshot of my mt5 trading platform. The indicators are RSI(period 14, Apply to close) Level 10 Buy, Level 50 Take profit, level 90 Sell) MA( Period 200, Method Exponential, Apply to Median price, Shift 0) BB (Period 25, Apply to close, Deviation 0.035, Shift 0) Ideally on a 1
the code wasn't mine, i have got it somewhere on the web, but i like the performance of the EA, so i want to use it on mt5 platform. the given code based on price movements with ladder entry concept
Good Day I would like to order a trading robot. Pairs: XAUUSD (GOLD) EUR/USD USD/JPY The robot should be trading daily with TP/SL build in, would like to have trailing and stop loss, should execute up to 5 trades (preffarable setting choice) up to 10 trades Los sizes to be choise setting, must also trade major US vews events Like:US- PPI, CPI, NFP, Sales m/m and so on Must also show/display alert when opening
Hello Guys, I need a trading bot for the MT5 to place order based on my trading strategy which is based on - >> entry based on EMA with rejection from specific levels like support and resistance area - levels and time frame i will apply into the robot manually on daily basis. also need - trailing stoploss , shift to breakeven after gaining some points. need a highly expert developer
I have a full strategy based on indicator and candle based on . i would like to make it into a robot which will trade for me on a specific time and specific rules. i need a person who can do this project for me. If you have done this type of job . you are most welcome for this. Apply only if you know binary trading option and binomo trading platform well and how it works
I want to make AI based on Attached Picture Swing High low. If you have experience can share demo first. Stop loss, take profit, trailing , break even ,DD etc. also amiable

Información sobre el proyecto

Presupuesto
75+ USD
Para el ejecutor
67.5 USD