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

MQL4 Experts

Job finished

Execution time 1 day
Feedback from customer
Fantastic Guy, went above and beyond, stayed with me until 8.30 pm GMT and finally got it sorted.
Feedback from employee
Brilliant customer - Looking forward to the next project.

Specification

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

Responded

1
Developer 1
Rating
(133)
Projects
185
30%
Arbitration
77
9% / 73%
Overdue
77
42%
Free
2
Developer 2
Rating
(169)
Projects
218
50%
Arbitration
6
17% / 67%
Overdue
11
5%
Free
3
Developer 3
Rating
(106)
Projects
314
49%
Arbitration
42
52% / 19%
Overdue
22
7%
Free
4
Developer 4
Rating
(28)
Projects
36
17%
Arbitration
5
20% / 40%
Overdue
17
47%
Free
5
Developer 5
Rating
(69)
Projects
76
59%
Arbitration
0
Overdue
12
16%
Free
6
Developer 6
Rating
(103)
Projects
205
41%
Arbitration
17
29% / 71%
Overdue
45
22%
Free
7
Developer 7
Rating
(6)
Projects
5
0%
Arbitration
2
0% / 100%
Overdue
1
20%
Free
8
Developer 8
Rating
(25)
Projects
54
37%
Arbitration
4
0% / 50%
Overdue
22
41%
Free
9
Developer 9
Rating
(121)
Projects
134
66%
Arbitration
36
25% / 56%
Overdue
22
16%
Free
10
Developer 10
Rating
(130)
Projects
210
40%
Arbitration
90
20% / 43%
Overdue
85
40%
Free
11
Developer 11
Rating
(1123)
Projects
1425
62%
Arbitration
21
57% / 10%
Overdue
43
3%
Free
12
Developer 12
Rating
(221)
Projects
369
66%
Arbitration
10
50% / 0%
Overdue
46
12%
Free
13
Developer 13
Rating
(1853)
Projects
3455
88%
Arbitration
73
40% / 15%
Overdue
265
8%
Free
14
Developer 14
Rating
(14)
Projects
15
60%
Arbitration
2
0% / 100%
Overdue
5
33%
Free
15
Developer 15
Rating
(46)
Projects
73
16%
Arbitration
13
8% / 92%
Overdue
37
51%
Free
16
Developer 16
Rating
(59)
Projects
182
55%
Arbitration
31
45% / 16%
Overdue
103
57%
Free
17
Developer 17
Rating
(52)
Projects
133
44%
Arbitration
14
50% / 29%
Overdue
55
41%
Free
Similar orders
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
Hello, I’m looking for a profitable mt4 or mt5 EA that makes 10+% montly. No martingale or grid strategy. No major equity fluctuations. If you have an EA with proven track record please contact me
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
@page { size: 21cm 29.7cm; margin: 2cm } p { line-height: 115%; margin-bottom: 0.25cm; background: transparent } 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
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
I'm looking for a developer who has already working on a HFT tailored to pass prop firm challenges within a short period, maintaining a very low drawdown. Here is a link to a video demonstrating an existing EA executing the same strategy: https://youtu.be/N6NEcIpPzV4 Any developer having already worked on this type of project and able to provide quickly a test version is welcome to contact me

Project information

Budget
50 - 100 USD
For the developer
45 - 90 USD
Deadline
from 3 to 5 day(s)