Code Needed to Move Market Positions to Breakeven | MQL4 for Metatrader

MQL4 Experts

Tâche terminée

Temps d'exécution 1 jour
Commentaires du client
Fantastic Guy, went above and beyond, stayed with me until 8.30 pm GMT and finally got it sorted.
Commentaires de l'employé
Brilliant customer - Looking forward to the next project.

Spécifications

Hello,

I'm looking for an developer to implement a coding strategy to modify any market order positions to beak even when I profit 100 pips, the current code I have so far is below. However, I'm having trouble getting this to actually modify any orders. There are no errors in the journal so there shouldn't be anything wrong specifically with the code, but clearly one or more conditions are not being met without my knowledge.

If any developer could alter the code to so as my market positions move to breakeven,. this would be much appreciated. 

			for(int s=OrdersTotal()-1;s>=0;s--)
                        {
                        if(OrderSelect(s,SELECT_BY_POS,MODE_TRADES)==true)
                           {
                           double   anAskPrice  =  MarketInfo(Symbol(),MODE_ASK);
                           double   tick        =  MarketInfo(Symbol(),MODE_TICKSIZE);
                           double   anOpenPrice =  OrderOpenPrice();
                           double   aCurrentSL  =  OrderStopLoss();
                           double   aNewSLPrice =  OrderOpenPrice();
                           double   tp          =  OrderTakeProfit();
                           int      pnlPoints   =  int((anOpenPrice - anAskPrice)/_Point);
                           int      stopPoints  =  int((aNewSLPrice - anAskPrice)/_Point);
                           int      stopLevel   =  int(MarketInfo(Symbol(),MODE_STOPLEVEL)+MarketInfo(Symbol(),MODE_SPREAD));
                           int      aTicket     =  OrderTicket();
                           int      breakeven   =  100;   
                           if(OrderType()==OP_SELL)
                           if(pnlPoints>breakeven)
                           if(stopPoints >stopLevel)
                           if(pnlPoints>breakeven)
                           if(anOpenPrice-anAskPrice>breakeven*_Point)
                           if(aNewSLPrice!=aCurrentSL)
                              {
                              SellMod = OrderModify(aTicket,anOpenPrice,anOpenPrice,tp,0,sellcolor);
                              PrintFormat("OrderOpenPrice %7.5f CurrentPrice %7.5f",anOpenPrice,anAskPrice);
                              SendMail("Notification of Order Modification for Ticket#"+IntegerToString(OrderTicket(),10),"Good news! Order Ticket#"+IntegerToString(OrderTicket(),10)+"has been changed to breakeven");
                              SendNotification("Ticket# "+IntegerToString(aTicket,10)+" has been modified to breakeven");
                              if(!SellMod)
                                 {
                                 PrintFormat("OrderOpenPrice %7.5f CurrentPrice %7.5f",anOpenPrice,anAskPrice);
                                 PrintFormat("Order modification for ticket %10d has failed to modify the order under the Error Code# %5d. Check MQL4 Documentation",aTicket,GetLastError());
                                 }
                              }
                            }
                          }
                         
                      for(int b=OrdersTotal()-1;b>=0;b--)
                        {
                        if(OrderSelect(b,SELECT_BY_POS,MODE_TRADES)==true)
                           {
                           double   anBidPrice  =  MarketInfo(Symbol(),MODE_BID);
                           double   anOpenPrice =  OrderOpenPrice();
                           double   aCurrentSL  =  NormalizeDouble(OrderStopLoss(),Digits);
                           double   aNewSLPrice =  NormalizeDouble(OrderOpenPrice(),Digits);
                           double   tp          =  OrderTakeProfit();
                           int      pnlPoints   =  int((anBidPrice - anOpenPrice)/_Point);
                           int      stopPoints  =  int((anBidPrice - aNewSLPrice)/_Point);
                           int      stopLevel   =  int(MarketInfo(Symbol(),MODE_STOPLEVEL)+MarketInfo(Symbol(),MODE_SPREAD));
                           int      aTicket     =  OrderTicket();
                           int      breakeven   =  100;   
                           if(OrderType()==OP_SELL)
                           if(pnlPoints>breakeven)
                           if(stopPoints >stopLevel)
                           if(pnlPoints > breakeven)
                           if(anBidPrice-anOpenPrice>breakeven*_Point)
                           if(aNewSLPrice!=aCurrentSL)
                              {
                              SellMod = OrderModify(aTicket,anOpenPrice,aNewSLPrice,tp,0,sellcolor);
                              SendMail("Notification of Order Modification for Ticket#"+IntegerToString(OrderTicket(),10),"Good news! Order Ticket#"+IntegerToString(OrderTicket(),10)+"has been changed to breakeven");
                              SendNotification("Ticket# "+IntegerToString(aTicket,10)+" has been modified to breakeven");
                              if(!SellMod)
                                 {
                                 PrintFormat("Order modification for ticket %10d has failed to modify the order under the Error Code# %5d. Check MQL4 Documentation",aTicket,GetLastError());
                                 }
                              }
                            }
                          }

Répondu

1
Développeur 1
Évaluation
(133)
Projets
185
30%
Arbitrage
77
9% / 73%
En retard
77
42%
Gratuit
2
Développeur 2
Évaluation
(169)
Projets
218
50%
Arbitrage
6
17% / 67%
En retard
11
5%
Gratuit
3
Développeur 3
Évaluation
(106)
Projets
314
49%
Arbitrage
42
52% / 19%
En retard
22
7%
Gratuit
4
Développeur 4
Évaluation
(28)
Projets
36
17%
Arbitrage
5
20% / 40%
En retard
17
47%
Gratuit
5
Développeur 5
Évaluation
(69)
Projets
76
59%
Arbitrage
0
En retard
12
16%
Gratuit
6
Développeur 6
Évaluation
(103)
Projets
205
41%
Arbitrage
17
29% / 71%
En retard
45
22%
Gratuit
7
Développeur 7
Évaluation
(6)
Projets
5
0%
Arbitrage
2
0% / 100%
En retard
1
20%
Gratuit
8
Développeur 8
Évaluation
(25)
Projets
54
37%
Arbitrage
4
0% / 50%
En retard
22
41%
Gratuit
9
Développeur 9
Évaluation
(121)
Projets
134
66%
Arbitrage
36
25% / 56%
En retard
22
16%
Gratuit
10
Développeur 10
Évaluation
(130)
Projets
210
40%
Arbitrage
90
20% / 43%
En retard
85
40%
Gratuit
11
Développeur 11
Évaluation
(1123)
Projets
1425
62%
Arbitrage
21
57% / 10%
En retard
43
3%
Gratuit
12
Développeur 12
Évaluation
(221)
Projets
369
66%
Arbitrage
10
50% / 0%
En retard
46
12%
Gratuit
13
Développeur 13
Évaluation
(1853)
Projets
3455
88%
Arbitrage
73
40% / 15%
En retard
265
8%
Gratuit
14
Développeur 14
Évaluation
(14)
Projets
15
60%
Arbitrage
2
0% / 100%
En retard
5
33%
Gratuit
15
Développeur 15
Évaluation
(46)
Projets
73
16%
Arbitrage
13
8% / 92%
En retard
37
51%
Gratuit
16
Développeur 16
Évaluation
(59)
Projets
182
55%
Arbitrage
31
45% / 16%
En retard
103
57%
Gratuit
17
Développeur 17
Évaluation
(52)
Projets
133
44%
Arbitrage
14
50% / 29%
En retard
55
41%
Gratuit
Commandes similaires
HELLO DEAR DEV'S. I'VE AN EA BUT IT STOP WORKING WHEN MT4 HAS BEEN UPDATED TO THE LATEST VERSION (1420). SO I NEED A GOOD DEVELOPPER THAT COULD UPDATE THIS EA TO THE LATEST VERSION OF MT4 SO I CAN USE IT. NB: IT'S A SINGLE FILE (.EX4) AND THE PRICE CAN BE NEGOCIATED TO BE SUITABLE FOR BOTH PARTIES. THANK YOU
hey friends, I am looking to build a smart trading robot, for the capital market. He knew how to trade in all the different types of trade. Example - in shares, currencies, index, indices, ETFs, funds, commodities, options, futures and so on. Suitable for trading on all stock exchanges in the world. It will be possible to install the trading robot in the MetaTrader 5 trading software. But it will also be possible to
STI EA 30 USD
I need to convert this MT4 indicator into MT5 EA/indicator. The problem is I only have the .ex4 file bt not .mq4 file and it is also a repainting indicator. I need preliminary assessment if the conversion can be done based on .ex4 file first before exploring the EA details further. Attached is the indicator Budget below is just indicative for the assessment. We can discuss further once the conversion can be done and
i want you to help me it mq4 source code and insure it will work on mt4 and mt5 optimally basically i want the source code and that dll if its important to crack it .. regards
This mql4 got entry blue line and exit red line and pips inside also calculated it uses haiken Ashi and murray Math settings if you this you up for this job let's discuss it we will talk more when you are chosen thanks in advance
Hi, The task involves adding functions to an existing EA and correcting an error. The developer must have a thorough understanding of the following: Trailing Take Profit function Calculating a decreasing distance between orders Ability to code a function for Global Profit decrement/increment size in percentage Ability to correct error 10015 Thank you in advance
The first section will describe the EAs trading strategy logic and features. The second section is an outline of the inputs that the EA should contain. 1. The idea of the trading system is as follows : This EA enters trades based on fibonacci retracement levels when other (MACD, RSI) conditions are met. It will use a MACD from a particular time frame to establish the swing high and swing lows which the fibonacci
Expert Advisor (EA) will provide automatic entry and exit using Black Dragon indicator as per the description below. Long (entry): on the first blue candle. Long (exit): on the first red candle, stop loss or take profit/break-even. Whatever happens first. Short (entry): on the first red candle. Short (exit): on the first blue candle, stop loss or take profit/break-even. Whatever happens first. Long (stop loss value)
1. **Timeframe and Liquidity:** Focus on the 5-minute timeframe for liquidity analysis.(timeframe for liquidity should be editble) 2. **Candlestick MSS:** Monitor 1-minute candlestick patterns for entry signals.(should be editble) 3. **Swing Points:** Identify swing points using the high and low of the last three candles.(ict swimg high and low) 4. **Sell Setup:** - Wait for a 5-minute candle to take out the swing
Hello Greetings. I have a custom tradingview strategy I would like to convert to Metatrader 5 ( mt5 ) . I have the source code a and with me. Kindly bid if it is what you can do for me and let discuss about the project. Thanks

Informations sur le projet

Budget
50 - 100 USD
Pour le développeur
45 - 90 USD
Délais
de 3 à 5 jour(s)