Hedging EA

MQL4 Experts

Specification

Develop a MT4 hedging EA that will monitor, alert & response to the account's equity and the floating profit/loss of all open trades. 
There is a maximum of 40 open trades with 10 trades for the EURUSD (Group#1), 10 trades for the GBPUSD(Group#2), 10 trades USDCHF(Group#3) and 10 trades for the USDJPY(Group#4). Each trade will be identified by its magic numbers.   


All profit/loss mention below are in pips and NOT dollars. 

Every tick from MT4, we will monitor the account balance, equity, and floating profit/loss of each group separately.

Check all the open trades of Group#1, calculate balance, equity, profit/loss. Note that profit/loss will be calculated in pips and not dollars.
AccountBalance();
AccountEquity();
Loss (in pips) = convert to pips (AccountEquity() - AccountBalance());

Update the largest loss of 5 minutes of Profit/Loss for group #1
Update the largest loss of the previous 10 ticks of Profit/Loss for group #1
Update the current loss for the present tick of Profit/Loss for group#1


Part 1.
if Option 1 = true (ignore options 2)

Close all winning buy trades if the total of all winning buy trades > Buy_Total_winning_limit
Close all winning sell trades if the total of all winning sell trades > Sell_Total_winning_limit
Close all losing buy trades if the total of all losing buy trade > Buy_Total_losing_limit
Close all losing sell trades if the total of all losing sell trades > Sell_Total_losing_limit

Part 2.   
if Option 2 = true (ignore options 1)
Volume equal example - if there are 5 buy trades, then the volume equal will be 0.5 lot, if there are 7 sell trades, then the volume equal will be 0.7 lot. Each trade is counted as 0.1 lot. 

Open sell trades with volume equal to the total of all winning buy trades > Buy_Total_winning_limit
Open buy trades with volume equal to the total of all winning sell trades > Sell_Total_winning_limit
Open sell trades with volume equal to all losing buy trades > Buy_total_losing_limit
Open buy trades with volume equal to all losing sell trades > Sell_total_losing_limit

Exit sell trades when total of all winning buy trades > (Buy_Total_winning_limit - G_1_hysteresis_buy_constant) 
Exit buy trades when total of all winning sell trades > (Sell_Total_winning_limit - G_1_hysteresis_sell_constant) 
Exit sell trades when total of all losing buy trades > (Buy_total_losing_limit - G_1_hysteresis_buy_constant)

Exit buy trades when total of all losing sell trades > (Sell_total_losing_lmit - - G_1_hysteresis_sell_constant) 

 

#property link      ""
#property version   "1.00"
#property strict

input double BaseLots = 1;


input bool Option_1 = true;
//group1 symbol = EURUSD
input int Group1_Buy_Total_winning_limit = 3000; //300 pips for 5 digits broker
input int Group1_Sell_Total_winning_limit = 3000;//300 pips for 5 digits broker
input int Group1_Buy_Total_losing_limit = 3000;//300 pips for 5 digits broker
input int Group1_Sell_Total_losing_limit = 3000;//300 pips for 5 digits broker
//group2 symbol = GBPUSD
input int Group2_Buy_Total_winning_limit = 3000; //300 pips for 5 digits broker
input int Group2_Sell_Total_winning_limit = 3000;//300 pips for 5 digits broker
input int Group2_Buy_Total_losing_limit = 3000;//300 pips for 5 digits broker
input int Group2_Sell_Total_losing_limit = 3000;//300 pips for 5 digits broker
//group3 symbol = USDJPY
input int Group3_Buy_Total_winning_limit = 3000; //300 pips for 5 digits broker
input int Group3_Sell_Total_winning_limit = 3000;//300 pips for 5 digits broker
input int Group3_Buy_Total_losing_limit = 3000;//300 pips for 5 digits broker
input int Group3_Sell_Total_losing_limit = 3000;//300 pips for 5 digits broker
//group4 symbol = USDCHF
input int Group4_Buy_Total_winning_limit = 3000; //300 pips for 5 digits broker
input int Group4_Sell_Total_winning_limit = 3000;//300 pips for 5 digits broker
input int Group4_Buy_Total_losing_limit = 3000;//300 pips for 5 digits broker
input int Group4_Sell_Total_losing_limit = 3000;//300 pips for 5 digits broker

//group1 symbol = EURUSD
 int Group1_Buy_Total = 0; 
 int Group1_Sell_Total = 0;
 int Group1_Buy_Total = 0;
 int Group1_Sell_Total = 0;
//group2 symbol = GBPUSD
 int Group2_Buy_Total = 0; 
 int Group2_Sell_Total = 0;
 int Group2_Buy_Total = 0;
 int Group2_Sell_Total = 0;
//group3 symbol = USDJPY
 int Group3_Buy_Total = 0; 
 int Group3_Sell_Total = 0;
 int Group3_Buy_Total = 0;
 int Group3_Sell_Total = 0;
//group4 symbol = USDCHF
 int Group4_Buy_Total = 0; 
 int Group4_Sell_Total = 0;
 int Group4_Buy_Total = 0;
 int Group4_Sell_Total = 0;

int btwl = 0;
int stwl = 0;
int btll = 0;
int stll = 0;
input bool Option_2 = false;
input int G_1_hysteresis_buy_constant = 50;
input int G_1_hysteresis_sell_constant = 50;

int Slippage = 100;
//Magic numbers: 1 to 10 will be trading the EURUSD
int Group1_magic1 = 1;
int Group1_magic2 = 2;
int Group1_magic3 = 3;
int Group1_magic4 = 4;
int Group1_magic5 = 5;
int Group1_magic6 = 6;
int Group1_magic7 = 7;
int Group1_magic8 = 8;
int Group1_magic9 = 9;
int Group1_magic10 = 10;
//Magic numbers: 11 to 20 will be trading the GBPUSD
int Group2_magic1 = 11;
int Group2_magic2 = 12;
int Group2_magic3 = 13;
int Group2_magic4 = 14;
int Group2_magic5 = 15;
int Group2_magic6 = 16;
int Group2_magic7 = 17;
int Group2_magic8 = 18;
int Group2_magic9 = 19;
int Group2_magic10 = 20;
//Magic numbers: 21 to 30 will be trading the USDJPY 
int Group3_magic1 = 21;
int Group3_magic2 = 22;
int Group3_magic3 = 23;
int Group3_magic4 = 24;
int Group3_magic5 = 25;
int Group3_magic6 = 26;
int Group3_magic7 = 27;
int Group3_magic8 = 28;
int Group3_magic9 = 29;
int Group3_magic10 = 30;

//Magic numbers: 31 to 40 will be trading the USDCHF 
int Group4_magic1 = 31;
int Group4_magic2 = 32;
int Group4_magic3 = 33;
int Group4_magic4 = 34;
int Group4_magic5 = 35;
int Group4_magic6 = 36;
int Group4_magic7 = 37;
int Group4_magic8 = 38;
int Group4_magic9 = 39;
int Group4_magic10 = 40;

 

 

Responded

1
Developer 1
Rating
(182)
Projects
342
42%
Arbitration
118
12% / 73%
Overdue
104
30%
Free
2
Developer 2
Rating
(54)
Projects
164
43%
Arbitration
43
47% / 16%
Overdue
58
35%
Free
3
Developer 3
Rating
(62)
Projects
140
46%
Arbitration
19
42% / 16%
Overdue
32
23%
Free
Similar orders
Trade methodology based on Red and Green lines entering Overbought / Oversold zone. Using confluence of Higher time frame, Moving Average a trade can enter when there is a strong slope angle. Market Base Line is used to determine overall market sentiment. This is designed to be an established trend scalping strategy on lower time frames. To be used initially on demo then real account when settings have been fine
There are six conditions in total . source code from an existing expert will be provided to aid the completion of this job . - Install the following by the Panel (copy paste form my existing Expert ) 1. Pips Lost : number of pips lost ( monthly reset ) 2. Pips Gained : number of pips gained ( monthly reset ) 3. Have a black background to avoid the
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: function (A) Add Transform combine the 4 Expert Advisors into just 1 Expert Advisor, maintaining the individuality of each one Leave in extern (false) or (true)
Description: I am seeking an experienced MQL5 developer to create a custom Expert Advisor (EA) for MetaTrader 5 based on a specific trend-following strategy. The strategy includes precise risk management, advanced trade management features, and additional risk management tools. The EA should be adaptable to any timeframe on which it is attached. Below are the detailed requirements and parameters for the EA: Strategy
I need an EA trading frequently (HFT or something like), and it sould have some features below: 1、Have a clear trading logic 2、Have a good backtest result 3、Have a demonstrated benefitable result in a live account trading 4、Can avoid the news time period or not sensitive to news
Tenho um EA mql4 que está com funcionalidades funcionando e outras com funcionalidades sem funcionar. Tenho um vídeo do EA funcionando como deve funcionar perfeitamente. O meu não consegue seguir o mesmo programa pois quando coloca os pontos de parada e retirada são bem diferentes. Não tenho pressa para tempo, só queria que conseguisse renovar o EA. O arquivo do grafico anexo é como ele se encontra agora. O certo é
New york session based strategy 9:30 open Price takes out buy side or sell side liquidity Usually using 15min high and lows 5m entry Price takes out that high/low and price must close strongly back into the zone Is price is above price we have a sell bias vis versa for buys Sl is at the high or low with option for “offset” for cushion Tp is usually the opposite High or low. Would like the option for set pips-points &
Hello, I am looking for a skilled developer to create an Expert Advisor (EA) for MT4. The EA should close an open trade automatically when a Golden or Death Cross occurs in the Alligator Indicator. Please let me know if you have experience with similar projects and how we can discuss the details further
Hello there! I have a ATAS bot that would be discussed properly with you once you bid to this project, But majorly what i need is either: An update to my bot that allows it to watch one chart and trade on another within ATAS. Or an add on of some kind that allows it to watch one ATAS chart and then communicate with a bot that can execute trades in MT4/5. Bid now for more proper details
I want have the possibility to increase lotsize not alone by Lot-multiplier rather I want add a fix-lot increase for excample for 0,05 lot. I want have this for buy / sell and hedge-buy and hedge sell

Project information

Budget
45 USD
For the developer
40.5 - 40.5 USD
Deadline
from 5 to 15 day(s)