Hedge to Profit EA

MQL4 Experts

Job finished

Execution time 42 days
Feedback from customer
Developer demonstrated an excellent understanding of trading and coding which was an excellent combination for the job he carried out for me. I recommend him.
Feedback from employee
Good client, clear rules and nice communication. I was glad work for...

Specification

The idea behind this EA is to hedge, take profit on the trades that are making profit and manage the trades that in loss with the aim that overall, the account will end in net profit.

The description is as follows

Opening Buy and Sell at the same time.  I want the EA to trade either of the following trade events and other user inputs:  

string note = "========= EA Trade Events and Other User Inputs =========";

input string Start_time = "01:00", Stop_time = "00:15";//EA will only trade at this time

bool TradeAuto = True;// if true, EA will trade as soon as it is launched on the chart 

Input double TakeProfit = xx;

Input double StopLoss = xx;

STEP 1: TRADE ENTRIES

As soon as this EA’s trade event is triggered, eight entries are automatically generated (Two entries in Step 1a, Three entries in Step 1b and Three entries in Step 1c)  

Step 1a: Open 1 buy and 1 Sell @ market.  Lot size = User input. Take Profit = User Input; StopLoss = 0;  

Step 1b: At the same time open Buy Stop, Buy Stop, Sell Limit. Treat as follows:

     Step 1b(1)  Buy Stop:  Lot = same as in 1a, Take Profit = User Input, Stop Loss = 0;  

     Step 1b(2)  Buy Stop:   Lot = same as in 1a, Take Profit = 0,  StopLoss=User input; 

     Step 1b(3)  Sell Limit;  Lot = same as in 1a, Take Profit = User Input, Stop Loss = 0; 

Note that the price to use for pending orders is market price + TakeProfit Pips         

Step 1c:  At the same time, open 1 Buy Limit, Sell Stop, Sell Stop. Treat as follows:

          Step 1c(1)  Sell Stop:  Lot = same as in 1a, Take Profit = User Input, Stop Loss = 0; 

          Step 1c(2) Sell Stop:   Lot = same as in 1a, Take Profit = 0,Stop Loss = User Input;  

          Step 1c(3) Buy Limit:  Lot = same as in 1a, Take Profit User Input, Stop Loss = 0;  

STEP 2: TRADE MANAGEMENT AND EXITS WHERE BUY TRADE HITS PROFIT FIRST

Step 2a. If the trade moves up 100 pips (depending on the user input for TakeProfit), the buy trade will close in profit of 100 pips (depending on the user input for TakeProfit). At that same point, a sell trade will still be open at this stage. The floating loss on this trade will be 100 (depending on the user input for StopLoss. Also, at the point, the pending orders (2 Nos Buy Stops and 1 No Sell Limit) created in 1b above will trigger and four open trades will float. 

The four open trades will be as follows:

1.     Sell trade that will be now 100 pip loss. At this point, adjust Take profit to zero

2.     New buy trade triggered from the previous Buy Limit

3.     New buy trade triggered from the previous Buy Limit

4.     New Sell trade triggered from the previous Sell Stop

Step 2b. The pending trades opened in step 1c above, should now be deleted and another three pending trades to replace them at a distance equal to the StopLoss/Takeprofit. The trades are as follows:

          Step 2b(1)  Sell Stop:  Lot = same as in 1a, Take Profit = User Input, Stop Loss = 0;  

          Step 2b(2) Sell Stop:   Lot = same as in 1a, Take Profit = 0,Stop Loss = User Input;  

          Step 2b(3) Buy Limit:  Lot = same as in 1a, Take Profit User Input, Stop Loss = 0;  

STEP 2: TRADE MANAGEMENT AND EXITS WHERE SELL TRADE HITS PROFIT FIRST

Step 2a. If the trade moves down 100 pips (depending on the user input for TakeProfit), the sell trade will close in profit of 100 pips (depending on the user input for TakeProfit). At that same point, a buy trade will still be open at this stage. The floating loss on this trade will be 100 (depending on the user input for StopLoss. Also, at the point, the pending orders (2 Nos Sell Stops and 1 No Buy Limit) created in 1b above will trigger and four open trades will float. 

The four open trades will be as follows:

1.     Buy trade that will be now 100 pip loss. At this point, adjust Take profit to zero

2.     New Sell trade triggered from the previous Sell Limit

3.     New Sell trade triggered from the previous Sell Limit

4.     New Buy trade triggered from the previous Buy Stop

Step 2b. The pending trades opened in step 1c above, should now be deleted and another three pending trades to replace them at a distance equivalent to the StopLoss/Takeprofit. The trades are as follows:

          Step 2b(1)  Buy Stop:  Lot = same as in 1a, Take Profit = User Input, Stop Loss = 0;  

          Step 2b(2) Buy Stop:   Lot = same as in 1a, Take Profit = 0,Stop Loss = User Input;  

          Step 2b(3) Sell Limit:  Lot = same as in 1a, Take Profit User Input, Stop Loss = 0;  

 

Either of the two scenarios will continue forever.  Each time a Take Profit level is reached, profit is taken at that level and existing pending orders will be deleted and new ones placed.   

Note, it is the entry (Buy or sell) that has Take Profit that will have profit adjusted to zero.  This is to ensure that when the trade starts reversing, such trades will be taken out at zero

 

DEMONSTRATION

In the following example EURUSD is used to demonstrate how the EA should work

Assumptions are as follows:

TakeProfit = 100;

StopLoss = 100;

TradeAuto = True;

Current Price of EURUSD = 1.14194

Since our trade event is chosen as Auto, the EA will launch trades as soon as it is attached to the EURUSD chart.    

1a. The following entries are generated

1a(1) Buy EURUSD @ 1.14194 Stop Loss = 0, Take Profit =1.15194

1a(2) Sell EURUSD @ 1.14194   Stop Loss  = 0, Take Profit = 1.13194

1bPending orders as follows BBS above market price

1b(1). BuyStop EURUSD @ 1.15194,  Stop Loss = 0, Take Profit = 1.16194

1b(2). BuyStop EURUSD @ 1.15194,  Stop Loss = 1.14194, Take Profit = 0

1b(3). SellLimit EURUSD @ 1.15194 Stop Loss = 0, Take Profit = 1.14194

1c. Pending orders as follows SSB below market price

1c(1). SellStop EURUSD @ 1.13194, Stop Loss = 0, Take Profit =  1.12194

1c(2). SellStop EURUSD @ 1.13194, Stop Loss = 1.14194, Take Profit = 0;

1c(3). BuyLimit EURUSD @ 1.13194,Stop Loss = 0, Take Profit = 1.14194

When price moves upward and reaches EURUSD = 1.15194, the following will happen,

1.     Buy EURUSD @ 1.14194 will hit take profit at 1.15194 and be closed at 100 pips profit   

2.     Sell EURUSD @ 1.14194 will have open loss of 100 pips and TP will move to 1.14194

3.     Pending BuyStop orders (2 Nos) will trigger at market at the price 1.15194   

4.      Pending SellLimit order (1 No) will trigger at market at the price  1.15194   

5.     The 3 Nos pending orders SellStop EURUSD @ 1.13194, SellStop EURUSD @ 1.13194, BuyLimit EURUSD @ 1.13194 will be deleted.  

6.     New Pending orders (6 Nos) will be opened to replace them as follows:

a.     SellStop EURUSD @ 1.14194, SellStop EURUSD @ 1.14194, BuyLimit EURUSD @ 1.14194   

b.     BuyStop EURUSD @ 1.16194, BuyStop EURUSD @ 1.16194, SellLimit EURUSD @ 1.16194 

 

7.     This process will continue to repeat each time price reaches a new Take Profit level.

The above process will be reversed if price starts to go down.

Once the trade cycles repeats to the level where the accumulated profit per trade is up to twice the take profit level, all open trades should be closed and the cycle started all over again.

In the above case, once the open and closed profit is up to 200 pips, all trades related to the trade cycle should be closed and a new cycle started.


Responded

1
Developer 1
Rating
(620)
Projects
680
57%
Arbitration
25
16% / 60%
Overdue
228
34%
Free
2
Developer 2
Rating
(349)
Projects
463
51%
Arbitration
41
24% / 49%
Overdue
149
32%
Free
3
Developer 3
Rating
(94)
Projects
148
59%
Arbitration
16
38% / 13%
Overdue
25
17%
Free
4
Developer 4
Rating
(646)
Projects
1294
67%
Arbitration
84
26% / 49%
Overdue
338
26%
Free
5
Developer 5
Rating
Projects
1
0%
Arbitration
0
Overdue
1
100%
Free
6
Developer 6
Rating
(258)
Projects
395
28%
Arbitration
69
19% / 49%
Overdue
120
30%
Free
7
Developer 7
Rating
(4)
Projects
6
0%
Arbitration
2
0% / 50%
Overdue
4
67%
Free
8
Developer 8
Rating
(27)
Projects
43
7%
Arbitration
18
6% / 78%
Overdue
26
60%
Free
9
Developer 9
Rating
(95)
Projects
141
75%
Arbitration
0
Overdue
2
1%
Working
10
Developer 10
Rating
(90)
Projects
118
17%
Arbitration
44
23% / 39%
Overdue
20
17%
Free
11
Developer 11
Rating
(259)
Projects
533
50%
Arbitration
54
41% / 37%
Overdue
224
42%
Working
12
Developer 12
Rating
(62)
Projects
84
26%
Arbitration
22
23% / 45%
Overdue
23
27%
Working
13
Developer 13
Rating
(586)
Projects
1044
49%
Arbitration
39
28% / 41%
Overdue
49
5%
Working
14
Developer 14
Rating
(5)
Projects
7
0%
Arbitration
1
100% / 0%
Overdue
5
71%
Free
15
Developer 15
Rating
(66)
Projects
143
34%
Arbitration
10
10% / 60%
Overdue
26
18%
Working
16
Developer 16
Rating
(43)
Projects
72
49%
Arbitration
4
0% / 50%
Overdue
19
26%
Free
Similar orders
Create Order Block Indictor same as the indicator i attached. 1. Buy and Sell order block with arrow 2. indicator must not repaint 3. indicator must have setting to manage order block. Order must appear in the same places as our order block indicator.... if you have workable send to me let test it
Hello, you can work with me for sure, but here's to work with an experience coder who already know the concept of xBest EA, I think if I am opportune to discuss my trading needs with him or her that already knows how xBest strategy work, that will make the process more faster and saved me from time waster, because if you know how xBest EA works as a coder, that mean you are the best fit for my project, I have this EA
i am currently in need of a multi currency EA.i want the EA to be able to read data from different symbols whenever a trade occur on that symbol,the EA will be able to read the direction of the trade and the profit or loss of that particular pair and display it on my panel.the EA must be able to to combine all the trades that were taken from different symbols and display it on the panel,if you are capable of such it
I have an EA which i got from a friend of mine and it is a fantastic tool i use to trade the markets. It's fully automatic opens, closes trades etc. My only issue is that to run strategy testing and optimizations MT4 is so frkn slow! MT5 is leaps and bounds better for testing so would like to literally convert this EA from MT4 installable exe to MT5 installable exe so i can run it on MT5. Obviously i do not have the
Modification 30+ USD
dear developers.i want to modify my custom indicator by adding new rules for alerts and arrows,the previous alerts and rules for alerts will be removed and new rules will apply.what i want is simple and straight forward...thank you
Hello, you can work with me for sure, but here's to work with an experience coder who already know the concept of xBest EA, I think if I am opportune to discuss my trading needs with him or her that already knows how xBest strategy work, that will make the process more faster and saved me from time waster, because if you know how xBest EA works as a coder, that mean you are the best fit for my project, I have this EA
I would like to make a simple EA. INDICATOR FOR ENTRY I have an indicator signal for Buy and Sell Multiple Entry True/False Maximum Open Order ____ Risk Percentage ___ FILTER 50 MA our Filter for Buying and Selling. EXITS TP and SL, Trail Stop, MACD Exit FILTER FEATURE I am looking for: Can you make a condition that the EA wont enter on consolidation or sideways movement- not uptrend or downtrend
I am seeking an experienced and proficient MQL5 developer to collaborate on an exciting project involving the enhancement of an existing EA, specifically an elaborate version of xBest v3.47. The xBest v3.47 EA is publicly available and serves as the foundation for our project. The goal is to incorporate a series of compelling features into the existing EA, leveraging its grid/hedging strategy while introducing
Hello, I am looking for someone that can build me an EA preferably expanding on an existing code you probably know as the xBest Ea series. I have the source code and detailed list of everything that needs to be coded in ready to go. please let's discuss more better on my strategy
PROP FIRM EA 4500 - 7000 USD
Hi, i need a Expert Advisor, that can pass prop firm Challenges. A bit of martingale is OK (max. 8 levels) Profit 10% Max Drawdown (DD) 10% Max Daily Loss 4% All trades with SL NO trades during and after high impact news NO trades during Weekend Profitable backtest from eentire history Trades Forex (If you already have a finished EA, send me the BACKTEST I will only ENTERTAIN people with sample ea from previous

Project information

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