Conversion of a script to mql4

İş Gereklilikleri

hi, 

Can you convert the scripts below to mql4 please?

With a  monthly pivot indicator drawn on daily chart  such as P,R1,R2, R3andR4 ( for buy order) and  P,S1,S2 and S3(for sell order) as partial take profits

Options also to use10%,30% and 100%  from buy price or sell price as partial take profit also

The EA is designed to include features such as Time Filter with Friday Close, Order Settings, Trailing Stop Loss, Partial Take Profit, Risk Management and General Standard Settings


//@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)//@version=3

Yanıtlandı

1
Geliştirici 1
Derecelendirme
(1)
Projeler
2
100%
Arabuluculuk
1
100% / 0%
Süresi dolmuş
0
Serbest
2
Geliştirici 2
Derecelendirme
(195)
Projeler
395
28%
Arabuluculuk
155
20% / 52%
Süresi dolmuş
112
28%
Serbest
3
Geliştirici 3
Derecelendirme
(1)
Projeler
1
0%
Arabuluculuk
1
0% / 100%
Süresi dolmuş
0
Serbest
4
Geliştirici 4
Derecelendirme
(360)
Projeler
642
26%
Arabuluculuk
92
72% / 14%
Süresi dolmuş
12
2%
Çalışıyor
Yayınlandı: 1 kod
Benzer siparişler
I’m looking for a skilled and experienced MQL developer who can professionally convert an existing MT4 EA (Expert Advisor) into a fully functional MT5 version. The goal is to ensure the same logic, accuracy, and performance as the original MT4 bot, with clean coding and no errors. Please only apply if you have proven experience in MT4 to MT5 conversions and can deliver a stable, optimized MT5 EA
Hello Developers, This is buy side/sell side order for an EA that consist of 3 common indicators with 4 conditions to trigger a buy or sell with added stop loss and take profit. Please send your qualifications for a decision tomorrow. Thanks
Hello , I am looking for a skilled developer who works fast. I need a simply EA which will only open trades when the arrow, notification is being sent by the indicator from mql5.com. The indicator is a paid one, so I will give the developer the access to VPS where it will be downloaded. I have another EAs which will manage the trade so the one I am asking for must only open buy or sell trade in the indicated by me
I'm looking for a highly experienced MQL5 developer (4.5-5.0 stars, solid reputation, and proven track record) to finalize and fully optimize my Expert Advisor, Beging ULTRA v7.9. The EA is already 95% complete and fully functional. It includes a multi-asset scanner, dynamic SL/TP, partial close, breakeven, trailing logic, ATR-based limits, and a full visual overlay panel. ✅ Tasks to be completed: Fix the remaining
Hola, deseo coviertir el siguiente codigo mql5 del indicador RSI con alertas en un robot (expert advisor) 100% automatico. Es decir, que siempre que envie la senal de compra o venta se ejectute la orden de forma automatica. Que tenga encuentas niveles de soporte en temparalidades H1, H4 y D1 para entrar en compras y de resietncias H1, H4 y D1 para entrar en ventas. Que salga de las opereaciones cuando el RSI toque o
What I need: A simple protective bot that monitors the entire trading account and automatically closes all positions at preset profit/loss limits. Required features: Monitor all open positions , regardless of who/what opened them Automatically close ALL positions when: Total profit reaches a set value (e.g., +€30) Total loss reaches a set value (e.g., -€20) Block new trades after closing positions — to prevent other
I’m interested in having you build a NinjaTrader 8 strategy based on a fractal model concept (similar to the TTrades fractal strategy). Before ordering, I want to confirm whether this logic fits within your “10 entry and exit condition” limit. Here’s the logic summary: 1. On the 4H timeframe, detect a Candle 2 or Candle 3 structure formation. 2. On the 15M timeframe, confirm a CISD (change in structure direction). 3
//@version=5 indicator("Enhanced SMA Crossover with RSI Confirmation", shorttitle="SMA Cross RSI", overlay=true) // Define the length of the short-term and long-term moving averages shortLength = input.int(9, title="Short-term Moving Average Length") longLength = input.int(21, title="Long-term Moving Average Length") rsiLength = input.int(14, title="RSI Length") rsiOverbought = input.int(70, title="RSI Overbought
Work on currency , stocks pairs , trade with trend & hedge. trail SL with last low & highs of market with control of lot size daily target.SL i want to control it with Breakeven , trailing on last lows & highs. news filter & time setting to trade. No martingale base
I'm making an EA that combines multiple indicators. The indicators take a long time to complete and I don't know the fixed values. I can send the original files and screenshots for reference. If there are technicians who can help me improve it, the price is negotiable. Thank you. I'm Chinese, so I need Chinese

Proje bilgisi

Bütçe
30 - 100 USD
Geliştirici için
27 - 90 USD
Son teslim tarihi
from 2 to 10 gün