Turn this code into an ea

MQL4 Experts

Tâche terminée

Temps d'exécution 14 jours
Commentaires de l'employé
Thanks for the job
Commentaires du client
Best developer I've worked with. Keen to continue with him in future. Thank you

Spécifications

//---- input parameters
extern int MAPeriod = 20;
extern double StopLoss = 10;
extern double TakeProfit = 20;

//---- global variables
int ticket = 0;
double ma = 0.0;

//---- initialization function
int init()
{
    // set up the chart
    SetIndexBuffer(0, ma);
    SetIndexStyle(0, DRAW_LINE);
    SetIndexShift(0, 0);
    SetIndexPeriod(0, MAPeriod);

    return(0);
}

//---- start function
int start()
{
    // identify the trend
    ma = iMA(NULL, 0, MAPeriod, 0, MODE_SMA, PRICE_CLOSE, 0);
    double slope = ma - iMA(NULL, 0, MAPeriod, 0, MODE_SMA, PRICE_CLOSE, 1);
    int trend = 0;
    if (slope > 0) {
        trend = 1; // bullish
    } else if (slope < 0) {
        trend = -1; // bearish
    }

    // look for entry and exit points
    double price = Ask;
    if (trend > 0 && price < ma) {
        ticket = OrderSend(Symbol(), OP_BUY, 0.01, price, 3, Bid - StopLoss * Point, Bid + TakeProfit * Point, "Buy", 0, 0, Green);
    } else if (trend < 0 && price > ma) {
        ticket = OrderSend(Symbol(), OP_SELL, 0.01, price, 3, Ask + StopLoss * Point, Ask - TakeProfit * Point, "Sell", 0, 0, Red);
    }

    // monitor the trade
    if (ticket > 0) {
        if (OrderSelect(ticket, SELECT_BY_TICKET)) {
            if (OrderCloseTime() == 0) {
                if (trend > 0) {
                    double stoploss = Bid - StopLoss * Point;
                    if (OrderStopLoss() < stoploss) {
                        bool modified = OrderModify(ticket, OrderOpenPrice(), stoploss, OrderTakeProfit(), 0, Green);
                        if (!modified) {
                            Alert("Error modifying stop loss: ", GetLastError());
                        }
                    }
                } else if (trend < 0) {
                    double stoploss = Ask + StopLoss * Point;
                    if (OrderStopLoss() > stoploss) {
                        bool modified = OrderModify(ticket, OrderOpenPrice(), stoploss, OrderTakeProfit(), 0, Red);
                        if (!modified) {
                            Alert("Error modifying stop loss: ", GetLastError());
                        }
                    }
                }
            }
        }
    }

    return(0);
}

Répondu

1
Développeur 1
Évaluation
(137)
Projets
162
22%
Arbitrage
7
29% / 43%
En retard
4
2%
Occupé
2
Développeur 2
Évaluation
(41)
Projets
54
4%
Arbitrage
5
0% / 60%
En retard
4
7%
Gratuit
3
Développeur 3
Évaluation
(42)
Projets
62
8%
Arbitrage
12
58% / 42%
En retard
1
2%
Gratuit
4
Développeur 4
Évaluation
(197)
Projets
201
27%
Arbitrage
0
En retard
3
1%
Gratuit
5
Développeur 5
Évaluation
(103)
Projets
160
33%
Arbitrage
11
18% / 36%
En retard
0
Chargé
6
Développeur 6
Évaluation
(97)
Projets
135
52%
Arbitrage
4
50% / 50%
En retard
0
Travail
7
Développeur 7
Évaluation
(455)
Projets
514
33%
Arbitrage
26
38% / 46%
En retard
7
1%
Chargé
8
Développeur 8
Évaluation
(298)
Projets
427
26%
Arbitrage
18
61% / 33%
En retard
26
6%
Gratuit
9
Développeur 9
Évaluation
(68)
Projets
79
9%
Arbitrage
34
9% / 53%
En retard
6
8%
Chargé
10
Développeur 10
Évaluation
(58)
Projets
178
71%
Arbitrage
4
100% / 0%
En retard
1
1%
Travail
11
Développeur 11
Évaluation
(13)
Projets
16
38%
Arbitrage
2
50% / 50%
En retard
0
Gratuit
12
Développeur 12
Évaluation
(4)
Projets
6
0%
Arbitrage
4
25% / 75%
En retard
0
Gratuit
13
Développeur 13
Évaluation
(568)
Projets
641
41%
Arbitrage
21
57% / 29%
En retard
47
7%
Travail
14
Développeur 14
Évaluation
(769)
Projets
1033
44%
Arbitrage
50
8% / 50%
En retard
117
11%
Gratuit
Commandes similaires
I would like to find someone who has already created a trading robot before. Im also looking for someone who can creat a bot that goes with time and structure
I am urgently in need of an expert full time programmer who can code an ea from scratch, Programming a well automated expert advisor from the existing strategy and make it work exactly more details will be provided in chat room thanks
Hello, I have implemented the method how to read the Toolbox Journal in MQL4, but this method does not work in MT5, because in MT5 the listview has LVS_OWNERDATA style. If you know or have a solution for MT5, without reading it from the log file, then please apply to this job. Regards, TradingProFX
I would need a robot that will automatically enter buy and sell positions based on the renko chart. The trend is to be determined on the basis of Elliot Waves. Individual peaks and troughs are determined by the TMA centerband Indicator. The buy position is entered when a higher low appears via the buy signal of the TMA indicator A sell position is entered when a lower high appears via the sell signal of the TMA
hi. I hv a strategy on tradingview need to convert to MT4/MT5 expert advisor for algo trading. would like to add some tradingview strategy setting to the EA(not included in my tradingview code): recalculate after order is filled, order size: xx% of equity
The idea of the trading system is as follows : market entries are performed when MACD's main and signal lines intersect in the current trend direction . 2. Trend is determined based on the Exponential Moving Average with the specified period (InpMATrendPeriod). If the current EMA value is greater than the previous one, the trend is seen as growing (ema_current > ema_previous). Alternatively, if current EMA is
Modify My EA 30+ USD
good day coder i want to add additional indicator to my ea The Coder should be able to code indicator to EA i will only send you source code if you can proof the indicator can be coded into ea all other features will be discussed inside but the major part is this peculiar indicator i am available for discussion My time zone is GMT+1 Source code will be release and tested on live market i trade from monday to sunday
Hello , By slippage control on Take profit and stoploss functions the ea won't implement different results of TP and Stoploss on volatile markets, target is to produce exact numbers of sl and tp on live executions .A coder who has done this type of job will be the choice . lot sizing will be added to EA
Use indicator provided to produce support and resistance levels, and enter trade if price reaches s/r level which user has specified in settings. TP and SL should also come from user settings. TP and SL options should be s/r levels. EA trade should only be opened if there is a trade already open from another EA, based on magic number. EA should check for magic number from other EA, and only enter trade if there is a
1. Idea uruchomienia jest następująca : wejście na rynek ma miejsce, gdy główna linia MACD przecina się z linią sygnałową zgodnie z aktualnym uruchamianiem trendu . 2. Trend jest ustalany na podstawie średniej kroczącej wykładniczej z określonym okresem (InpMATrendPeriod). Jeśli bieżąca wartość EMA jest większa od sieci, trend jest postrzegany jako rosnący (ema_current > ema_previous). Alternatywnie, jeśli

Informations sur le projet

Budget
40+ USD
Pour le développeur
36 USD
Délais
à 1 jour(s)