EA Built from EMA Crossover

MQL5 Experts

Specification

Hello all,

Open Close Cross EA -  place an appropriate order in the direction of the crossover/under of the open and close.

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

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


EA should mimic entries and exits seen in attached images.  Settings should include those seen in screen shots as well as tp and sl. 


This is the Pine script used 






//@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
(320)
Projects
466
42%
Arbitration
77
12% / 64%
Overdue
75
16%
Free
2
Developer 2
Rating
(1)
Projects
1
0%
Arbitration
1
0% / 100%
Overdue
0
Free
Similar orders
I am wanting a robot that will trade an index (primarily AUS200) using 5 minute bars (changeable to other time frames). If the market breaks above or below a specific bar at a specified time then either a long or short trade is entered ( the distance above or below the break to enter the trade needs to be adjustable). A setting is required to specify the maximum distance the price can move above or below the
I need an EA that will copy automaticcally my signals from Telegram to mt4 and i need to be able to set the % of the account that will be applied as a risk for each trades the signals can be seen https://t.me/TMHTTFREEFXBOSIGNALS on my channel
I want to develop a NinjaTrader automated strategy that has a high win rate for trading futures. So the strategy will automatically enter and exit for an account. Do you have any experience with this? If so, can you please share some past results
I need a developer that can fix a indicator i have, I have a table that looks at emas and display bullish/bearish, I have spy on the table but its not always updating and need help fixing this I have this table and the first 6 rows looks at the chart symbol and if price is above 12 ema it will sows bullish under the 5/12 ema coulmn and bullish if its above, and same under the 34/50 colmun, if price is below 50 ema
Mt5 EA 30+ USD
Hey, I would like to find out if you can assist in developing and EA that I can use for my trading system for MT5 My system is very basic, it just a hedging system. Taking two trades buy and sell exactly at 14:00 (UCT+2). Risking 1% on each trade on a 1 : 2,5 Risk Reward ratio and stop loss of 2500 points since I am only trading GER30(Dax Index) for now, please make these inputs changeable. Once the trade is on 1 : 2
A DEVELOPER HAD MADE MISTAKE IN PUTTING ONLY SELL IN MY ROBOT INSTEAD OF BUY AND SELL. i HAVE THE SOURCE CODES FOR THE FOUR ROBOTS. I want a good developer that will help me fix the mistake in the robots
Important note- We only have the .ex4 file for the EA and need to create an exact replica of that EA, along with the mql4 file which is compatible with the 1420 Mt4 version, all the functionalities, inputs, and trade entry parameters should be exactly same. Key Requirements: - - The current EA runs on 1415 MT4 version and I need it to be adapted to the current 1420 MT4 version as it is. - The new EA should open
I need an EA in MT5 that trades based on volatility with market orders. It must check and correctly process possible errors in trading operations. Entry and exits based on volatility threshold
Modificar EA 30+ USD
Es posible descompilar un EA de mt4? Tengo uno y me gustaría descompilarlo y poder tener el archivo haber como funciona de verdad. Saludos amigos programadores. espero tenga solución este problema
Required back-test specifications on XAUSD between 2003 & 2024 on 30M and between 2011 - 2024 on M5 timeframe: 1. Recovery factor >= 2 2. Profit factor >= 2 3. Win Rate above 96% 4. 120 trades minimum per year on the 30 minute timeframe. 5. 170 trades minimum per year on M5 timeframe. 6. No martingale & grid 7. Every position must have a stoploss. 8. Use a customizable Trailing Stop (customizable point of activation

Project information

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