Open Close EMA crossover EA

MQL5 Experts

Specification

Hello,

I came across a favorable EA on tradingview.com and would like it translated to an mt5 EA. 

https://www.tradingview.com/script/o5InDPbl-Open-Close-Cross-Strategy/


EA should mimic trading of the pinescript ea as seen in screen shots 

settings should be as those seen on included screen shots as well as tp and sl. 


this is the pinescripted ea 

best of luck





//@version=2


strategy(title = "Open Close Cross Strategy", shorttitle = "OCC Strategy", overlay = true, pyramiding = 0, default_qty_type = strategy.percent_of_equity, default_qty_value = 10)


// Revision:        1

// Author:          @JayRogers

//

// Description:

//  - Strategy based around Open-Close Crossovers.

// Setup:

//  - I have generally found that setting the strategy resolution to 3-4x that of the chart you are viewing

//    tends to yield the best results, regardless of which MA option you may choose (if any)

//  - Don't aim for perfection. Just aim to get a reasonably snug fit with the O-C band, with good runs of

//    green and red.

//  - Option to either use basic open and close series data, or pick your poison with a wide array of MA types.

//  - Optional trailing stop for damage mitigation if desired (can be toggled on/off)

//  - Positions get taken automagically following a crossover - which is why it's better to set the resolution

//    of the script greater than that of your chart, so that the trades get taken sooner rather than later.

//  - If you make use of the trailing stops, be sure to take your time tweaking the values. Cutting it too fine

//    will cost you profits but keep you safer, while letting them loose could lead to more drawdown than you

//    can handle.


// === INPUTS ===

useRes      = input(defval = true, title = "Use Alternate Resolution? ( recommended )")

stratRes    = input(defval = "120", title = "Set Resolution ( should not be lower than chart )", type = resolution)

useMA       = input(defval = true, title = "Use MA? ( otherwise use simple Open/Close data )")

basisType   = input(defval = "DEMA", title = "MA Type: SMA, EMA, DEMA, TEMA, WMA, VWMA, SMMA, HullMA, LSMA, ALMA ( case sensitive )", type = string)

basisLen    = input(defval = 14, 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)

useStop     = input(defval = true, title = "Use Trailing Stop?")

slPoints    = input(defval = 200, title = "Stop Loss Trail Points", minval = 1)

slOffset    = input(defval = 400, title = "Stop Loss Trail Offset", minval = 1)

// === /INPUTS ===


// === 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 = na(v5[1]) ? sma(src, len) : (v5[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

    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 : v1

// security wrapper for repeat calls

reso(exp, use, res) => use ? security(tickerid, res, exp) : exp

// === /BASE FUNCTIONS ===


// === SERIES SETUP ===

// open/close

closeSeries = useMA ? reso(variant(basisType, close, basisLen, offsetSigma, offsetALMA), useRes, stratRes) : reso(close, useRes, stratRes)

openSeries  = useMA ? reso(variant(basisType, open, basisLen, offsetSigma, offsetALMA), useRes, stratRes) : reso(open, useRes, stratRes)

trendState  = closeSeries > openSeries ? true : closeSeries < openSeries ? false : trendState[1]

// === /SERIES ===


// === PLOTTING ===

barcolor(color = closeSeries > openSeries ? #006600 : #990000, title = "Bar Colours")

// channel outline

closePlot   = plot(closeSeries, title = "Close Line", color = #009900, linewidth = 2, style = line, transp = 90)

openPlot    = plot(openSeries, title = "Open Line", color = #CC0000, linewidth = 2, style = line, transp = 90)

// channel fill

closePlotU  = plot(trendState ? closeSeries : na, transp = 100, editable = false)

openPlotU   = plot(trendState ? openSeries : na, transp = 100, editable = false)

closePlotD  = plot(trendState ? na : closeSeries, transp = 100, editable = false)

openPlotD   = plot(trendState ? na : openSeries, transp = 100, editable = false)

fill(openPlotU, closePlotU, title = "Up Trend Fill", color = #009900, transp = 40)

fill(openPlotD, closePlotD, title = "Down Trend Fill", color = #CC0000, transp = 40)

// === /PLOTTING ===


// === STRATEGY ===

// conditions

longCond    = crossover(closeSeries, openSeries)

shortCond   = crossunder(closeSeries, openSeries)

// entries and base exit

strategy.entry("long", strategy.long, when = longCond)

strategy.entry("short", strategy.short, when = shortCond)

// if we're using the trailing stop

if (useStop)

    strategy.exit("XL", from_entry = "long", trail_points = slPoints, trail_offset = slOffset)

    strategy.exit("XS", from_entry = "short", trail_points = slPoints, trail_offset = slOffset)

// not sure needed, but just incase..

strategy.exit("XL", from_entry = "long", when = shortCond)

strategy.exit("XS", from_entry = "short", when = longCond)

// === /STRATEGY ===

Files:

JPG
Capture.JPG
205.9 Kb
JPG
Capture2.JPG
201.1 Kb

Responded

1
Developer 1
Rating
(414)
Projects
670
33%
Arbitration
60
17% / 32%
Overdue
114
17%
Working
2
Developer 2
Rating
(53)
Projects
79
18%
Arbitration
13
15% / 54%
Overdue
5
6%
Free
3
Developer 3
Rating
(1)
Projects
1
0%
Arbitration
1
0% / 100%
Overdue
0
Free
Similar orders
I NEED AN EXPERT ADVISOR THAT IS BASED ON SMOOTHED MOVING AVARAGE INPUT/ PERIOD-55/ METHOD-SMOOTHED/APPLY TO HIGH.WHEN A BULLISH CANDDLE CLOSED AND OPEN ABOVE THIS MOVING AVARAGE IT MUST OPEN A BUY ORDER AND WHEN A BEARISH CANDDLE CLOSED AND OPEN BELOW MOVING AVARAGE MOVING AVARAGE PERIOD -55/ METHOD- SMOOTHED/APPLY-LOW IT MUST OPEN SELL ORDER IT MUST ALSO SCAN CHART IN ALL TIME FRAMES AND WITH TAKE PROFIT AND STOP
1. Combination of Market Profiles on daily basis a) this should be combined if the bell curve is similar to the previous day. Rotational day (volume - standard deviation). b) If breakout, new range should be drawn Conclusion: Market profile should be combined on daily after the market is closed 2. Use Vwap indicator, with 0.5 - slow trend, 1.0 - normal trend, 1.5 fast trend. The stop loss should be under the trend
I currently download multiple Metatrader 4 profiles onto a Windows 11 pc on a regular basis. In order to speed up the process of uploading those profiles to my MetaTrader 4 account I have a "profile updater" MQL4 script that will do that automatically with just a couple of clicks. I also have a Linux pc that runs MetaTrader 4 through Codeweaver's Crossover program but the "profile updater" doesn't work in that
Creating a customized Forex/Index Rob Bot based on price actions and candlestick formations requires advanced programming and algorithmic trading knowledge. Here is a high-level outline of the steps involved in developing such a bot: 1. Define Trading Strategy: Specify the specific price action and candlestick formations you want the bot to trade upon. This could include setups like engulfing patterns, doji
This is a Ready Made grid Automatic EA 1.Need some bug fixing and little modification. This EA has some bug like -Place Random Trade after MT4 Restart . Also not follow custom parameter grid distance, grid slippage . like if i set 300pips grid distance, some time it place trade at 400 pips distance . fix this bug 2.first trade open by RSI logic if rsi30 open buy trade
Hello developers, I need a trading robot that works on martingale and antimartingale (functions that can be activated or deactivated, so the robot can work both as a martingale and as an antimartingale together). Initially the robot will work as an entry strategy on RSI, but it must be an open project as new entry strategies will be implemented in the future
HEDGING EA 70+ USD
LET ME KNOW IF YOU CAN DO THE JOB SERIOUS PROGRAMMER TO DO EA WITH STRICT DETAILS I HAVE A PICTURE OF THE STRATEGY I DO NOT WANT TO POST IT HERE
Requiero un EA basado en un indicador con las siguientes caracteristicas 1. Abra operacion con una señal que da el indicador, despues que la vela toque el indicador y cierre por encima del indicador 2. Que cierre operacion con SL y TP en % de perdida y ganancia 3, Que en cada señal abra un maximo de X operaciones y si pierde en la siguiente señal haga el doble operaciones y todas seran con el mismo lotaje Todos los
Biro7 Freedom 60 - 120 USD
Looking for someone to build an EA for MT5 terminal using the following indicators. 4 supertrend indicators 1 TSI 1 MACD 1 Bollinger Band as well as candlesticks I will describe how I want trade entry, and trade management to work after I have pick the developer. I want the EA to be a multi currency EA, with an optional freeze trading during news events. AS I only want the EA to trade during certain times of the day
More details when you apply I do not want to share all the details here. After your application, I will show all the details. Only serious experience developers with good reviews should apply. I take that into consideration

Project information

Budget
50+ USD
For the developer
45 USD
Deadline
from 2 to 14 day(s)