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

MQL4 Experten

Auftrag beendet

Ausführungszeit 1 Tag
Bewertung des Kunden
Fantastic Guy, went above and beyond, stayed with me until 8.30 pm GMT and finally got it sorted.
Bewertung des Entwicklers
Brilliant customer - Looking forward to the next project.

Spezifikation

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());
                                 }
                              }
                            }
                          }

Bewerbungen

1
Entwickler 1
Bewertung
(133)
Projekte
185
30%
Schlichtung
77
9% / 73%
Frist nicht eingehalten
77
42%
Frei
2
Entwickler 2
Bewertung
(169)
Projekte
218
50%
Schlichtung
6
17% / 67%
Frist nicht eingehalten
11
5%
Frei
3
Entwickler 3
Bewertung
(106)
Projekte
314
49%
Schlichtung
42
52% / 19%
Frist nicht eingehalten
22
7%
Frei
4
Entwickler 4
Bewertung
(28)
Projekte
36
17%
Schlichtung
5
20% / 40%
Frist nicht eingehalten
17
47%
Frei
5
Entwickler 5
Bewertung
(69)
Projekte
76
59%
Schlichtung
0
Frist nicht eingehalten
12
16%
Frei
6
Entwickler 6
Bewertung
(103)
Projekte
205
41%
Schlichtung
17
29% / 71%
Frist nicht eingehalten
45
22%
Frei
7
Entwickler 7
Bewertung
(6)
Projekte
5
0%
Schlichtung
2
0% / 100%
Frist nicht eingehalten
1
20%
Frei
8
Entwickler 8
Bewertung
(25)
Projekte
54
37%
Schlichtung
4
0% / 50%
Frist nicht eingehalten
22
41%
Frei
9
Entwickler 9
Bewertung
(121)
Projekte
134
66%
Schlichtung
36
25% / 56%
Frist nicht eingehalten
22
16%
Frei
10
Entwickler 10
Bewertung
(130)
Projekte
210
40%
Schlichtung
90
20% / 43%
Frist nicht eingehalten
85
40%
Frei
11
Entwickler 11
Bewertung
(1127)
Projekte
1429
62%
Schlichtung
21
57% / 10%
Frist nicht eingehalten
43
3%
Frei
12
Entwickler 12
Bewertung
(221)
Projekte
369
66%
Schlichtung
10
50% / 0%
Frist nicht eingehalten
46
12%
Frei
13
Entwickler 13
Bewertung
(1853)
Projekte
3455
88%
Schlichtung
73
40% / 15%
Frist nicht eingehalten
265
8%
Frei
14
Entwickler 14
Bewertung
(14)
Projekte
15
60%
Schlichtung
2
0% / 100%
Frist nicht eingehalten
5
33%
Frei
15
Entwickler 15
Bewertung
(46)
Projekte
73
16%
Schlichtung
13
8% / 92%
Frist nicht eingehalten
37
51%
Frei
16
Entwickler 16
Bewertung
(59)
Projekte
182
55%
Schlichtung
31
45% / 16%
Frist nicht eingehalten
103
57%
Frei
17
Entwickler 17
Bewertung
(52)
Projekte
133
44%
Schlichtung
14
50% / 29%
Frist nicht eingehalten
55
41%
Frei
Ähnliche Aufträge
I have an EA and want to add few new logic to fetch profit taking factors and other values from an external master data and use it in existing EA
Hello Every one, Good day, I want from someone professional to create an EA is working on Mt5, This EA is working by depend on some indicators, and all those indicators must be working on MACD window, not on the chart, for more details please read my attached pdf file carefully. Many Thanks
I'm looking for an expert MQL5 developer that can create an EA that's based on my price action trading strategy with no indicators. The EA must analyze trades based on my price action rules, enter trades based on my price action rules, manage trades based on my price action rules and exit trades based on my price action rules
hi hi there i have an strategy on tradingview and i want to automate it like metatrader EA so i want the strategy to open and close trade automaticlly on tradingview
We are looking for an experienced Expert Advisor Developer who can build a customized MT5 Expert Advisor for us. The Expert Advisor would use two built-in indicators as entry/exit signals and our own risk management strategy with customizable inputs. The goal is to create a reliable and efficient trading tool that can automate our trading process on the MT5 platform. Skills required: - Strong understanding of
I need stochastic div (hidden &regular ea) that should perform task in all tf's ..divergence is a repaint stly so i want to use it with candlestick flips .. so bet for it
Hello, I have an indicator from a friend and I'd like to replicate it on my own TradingView or MT5 platform. Could you assist me with that?. Here is the link
so basically I have an EA(mql5), AI script(python), flask server and socket server both on python. Now this is an experimental script as I am trying to learn. However the EA is not entering any trades. How much would it cost for you to troubleshoot this for me? Thank you in advance
NEW FUNCTION 50+ USD
La idea es la siguiente, sería un EA semi automático. Yo como trader opero en zonas. En adelante las vamos a denominar ``zonas calientes´´. El EA debe que necesito debe operar conforme a 4 zonas calientes que yo configure en el mismo. ¿Qué hará el EA en cada una de esas zonas calientes que yo he configurado? En cada una de estas zonas el EA debe realizar hedging (crear un rango en el cual el EA entrara en sell o en
I have the bot just over half made, from another developer who let me down and decided they no longer wished to finish the project, so I have a basic example of the fundamentals of what it could look like, although multiple functions I require do not work, but I can show this to you on request. There are multiple features that I require, so please read the in depth requirement sheet on the attachment. Function: To

Projektdetails

Budget
50 - 100 USD
Für die Entwickler
45 - 90 USD
Ausführungsfristen
von 3 bis 5 Tag(e)