Need Help with adding additional functions to this EA

Trabalho concluído

Tempo de execução 6 dias
Comentário do cliente
GOOD JOB
Comentário do desenvolvedor
I enjoyed working on the Project. The work ahead is explained properly. Very patient to explain gray areas around the project. Highly Recommend. Will love to work with Again 🙌🏾

Termos de Referência

I want to add

  • Maximum trades per day
  • trailing stops
  • close partials
  • Break even 

I want to be able to manually set how much trades to be taken on each day Eg:

  • Monday 2 trades     
  • Tuesday 3 trades
  • Wednesday 4 trades
  • Thursday 3 trades
  • Friday 2 trades

I also want to be able to manually set a time when each trade are taken on each day Eg:

  • Monday          2 trades      10:00am
  • Tuesday         3 trades        05:00am
  • Wednesday    4 trades         07:00pm
  • Thursday       3 trades          03:00pm
  • Friday           2 trades          01:00pm


CODE TO BE EDITED

//+------------------------------------------------------------------+

//|                                                      ProjectName |

//|                                      Copyright 2020, CompanyName |

//|                                       http://www.companyname.net |

//+------------------------------------------------------------------+


#property copyright "Copyright 2023, MetaQuotes Ltd."

#property link      "https://www.mql5.com"

#property version   "1.00"

#include <Trade\Trade.mqh>

CTrade trade;



//DYNAMIC LOTSIZING INPUT

double PositionSize(){

double lot;

double lot_min = SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_MIN);

double lot_max = SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_MAX);

double AcctEquity = AccountInfoDouble(ACCOUNT_EQUITY);


lot = 3.00/50*AcctEquity;

if(lot<=lot_min){

lot=lot_min;

}

if(lot>=lot_max){

lot=lot_max;

}

return(lot);

}




//static input long inpMagicnumber =54321;

input int inpBars=20; //bars for high/low

static input double inpLots=1.00;

input int inpStopLoss=400;

input int inpTakeProfit=1500;



///GLOBAL VARIBLES

double high=0;

double low=0;

MqlTick currentTick, previousTick;


//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+




datetime Expire_Time = D'2024.01.15 12:59:00';

int OnInit()

  {



 trade.SetExpertMagicNumber(5243);

        if(TimeCurrent() > Expire_Time)

        {

         Alert("The EA has expired...");

         ExpertRemove();

        }

        


  

//set magicnumber

//trade.SetExpertMagicNumber(inpMagicnumber);


   return(INIT_SUCCEEDED);

  }



//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void OnDeinit(const int reason)

  {


  }

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+11                                                                                                                                                                                                                                    11 11111111111111111111111111111111111111111111111111

void OnTick()

  {

   double Lotsize = NormalizeDouble(PositionSize(),2); 

  //Get tick

  previousTick=currentTick;

  if(!SymbolInfoTick(_Symbol,currentTick)){Print("fail to get currenttick");return;}

  

  ///count open positions

  int cntBuy, cntSell;

  if(!CountOpenPositions(cntBuy,cntSell)){return;}

  

  //check for buy position

  if(cntBuy==0 && high!=0 && previousTick.ask>high && currentTick.ask<=high){

  

  

  

  // calculte stoploss /take profit

  double sl=inpStopLoss==0?0:currentTick.ask+inpStopLoss*_Point;

  double tp=inpTakeProfit==0?0:currentTick.ask-inpTakeProfit*_Point;

  if(!NormalizePrice(sl)){return;}

  if(!NormalizePrice(tp)){return;}

  

  trade.PositionOpen(_Symbol,ORDER_TYPE_SELL,Lotsize,currentTick.ask,sl,tp,"highbreakout");

  

  }

  

  

   //check for sell position

 if(cntSell==0 && low!=0 && previousTick.bid>low && currentTick.bid<=low){

  

  // calculte stoploss /take profit

  double sl=inpStopLoss==0?0:currentTick.ask+inpStopLoss*_Point;

  double tp=inpTakeProfit==0?0:currentTick.ask-inpTakeProfit*_Point;

  if(!NormalizePrice(sl)){return;}

  if(!NormalizePrice(tp)){return;}

  

  trade.PositionOpen(_Symbol,ORDER_TYPE_SELL,Lotsize,currentTick.bid,sl,tp,"highbreakout");

  

  Print("open sell position");

  }

  

  

  

  

//CALCULATE HIGH AND LOW

   high =iHigh(_Symbol,PERIOD_CURRENT,iHighest(_Symbol,PERIOD_CURRENT,MODE_HIGH,inpBars,0));

   low =iLow(_Symbol,PERIOD_CURRENT,iLowest(_Symbol,PERIOD_CURRENT,MODE_LOW,inpBars,0));

  // DrawObjects();

}

void DrawObjects(){

 


datetime time =iTime(_Symbol,PERIOD_CURRENT,inpBars);


//RESISTANCE/HIGH LEVELS

ObjectDelete(NULL,"high");

ObjectCreate(NULL,"high",OBJ_TREND,0,time,high,TimeCurrent(),high);

ObjectSetInteger(NULL,"high",OBJPROP_WIDTH,2);

ObjectSetInteger(NULL,"high",OBJPROP_COLOR,clrBlack);


//SUPPORTS/LOW LEVELS

ObjectDelete(NULL,"low");

ObjectCreate(NULL,"low",OBJ_TREND,0,time,low,TimeCurrent(),low);

ObjectSetInteger(NULL,"low",OBJPROP_COLOR,clrRed);


}


 bool CountOpenPositions(int &cntBuy,int &cntSell){

ObjectSetInteger(NULL,"low",OBJPROP_WIDTH,2);

  

  cntBuy=0;

  cntSell=0;

  int total= PositionsTotal();

  for (int i=total-1; i>=0; i--){

  ulong ticket = PositionGetTicket(1);

  if(ticket<=0){Print("failed to get position ticket");return false;}

  if(!PositionSelectByTicket(ticket)){Print("failed to select position");return false;}

  long magic;

  if(!PositionGetInteger(POSITION_MAGIC,magic)){Print("failed to get position magicnumber");return false;}

  if(magic==5243){

  long type;

  if(!PositionGetInteger(POSITION_TYPE,type)){Print("failed to get position type");return false;}

  if(type==POSITION_TYPE_BUY){cntBuy++;}

  if(type==POSITION_TYPE_SELL){cntSell++;}

  }

  }

  return true;

  }

  

//Normalize price

bool NormalizePrice(double &price){

double tickSize=0;

if(!SymbolInfoDouble(_Symbol,SYMBOL_TRADE_TICK_SIZE,tickSize)){

Print("failed to get tick size");

}

return true;



price= NormalizeDouble(MathRound(price/tickSize)*tickSize,_Digits);

return true;


}











Respondido

1
Desenvolvedor 1
Classificação
(146)
Projetos
172
23%
Arbitragem
7
29% / 43%
Expirado
4
2%
Trabalhando
2
Desenvolvedor 2
Classificação
(196)
Projetos
318
35%
Arbitragem
64
13% / 56%
Expirado
82
26%
Livre
3
Desenvolvedor 3
Classificação
(21)
Projetos
24
38%
Arbitragem
1
100% / 0%
Expirado
2
8%
Trabalhando
4
Desenvolvedor 4
Classificação
(1)
Projetos
5
0%
Arbitragem
1
100% / 0%
Expirado
2
40%
Livre
5
Desenvolvedor 5
Classificação
(16)
Projetos
21
14%
Arbitragem
0
Expirado
1
5%
Trabalhando
6
Desenvolvedor 6
Classificação
(9)
Projetos
8
38%
Arbitragem
2
0% / 100%
Expirado
2
25%
Trabalhando
7
Desenvolvedor 7
Classificação
(130)
Projetos
184
32%
Arbitragem
16
31% / 63%
Expirado
27
15%
Livre
8
Desenvolvedor 8
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
9
Desenvolvedor 9
Classificação
(63)
Projetos
101
31%
Arbitragem
1
100% / 0%
Expirado
2
2%
Livre
10
Desenvolvedor 10
Classificação
(202)
Projetos
206
27%
Arbitragem
0
Expirado
3
1%
Livre
11
Desenvolvedor 11
Classificação
(76)
Projetos
85
34%
Arbitragem
2
0% / 0%
Expirado
1
1%
Trabalhando
12
Desenvolvedor 12
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
13
Desenvolvedor 13
Classificação
(96)
Projetos
143
76%
Arbitragem
0
Expirado
2
1%
Livre
14
Desenvolvedor 14
Classificação
(66)
Projetos
143
34%
Arbitragem
10
10% / 60%
Expirado
26
18%
Livre
Pedidos semelhantes
Hello I need a very simple indicator This indicator should show the highest floating or history drawdown of the account It means that it can display the highest number that the account drawdown to be displayed on the chart in this format max drawdown account(xxxx$$) ...date(00/00/00)time:(00:00) max drawdown currency ..( currency name with max drwadown) . (xxxx$$) date(00/00/00)time:(00:00) thanks
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
Hello, I‘m interested in an indicator to predict the next candles probability (bullish or bearish). But honestly I have no idea how to do this. Would be interested in your opinion how we can create such an indicator. Please let me know if you‘ve done similar work
Profitable EA HFT 50 - 300 USD
From a long time i am searching for a profitable EA i have lost a lot , and now i have only 300$ to buy a profitable EA , i wish to say with 0 losses but some or most traders they don't want to hear this i am really tired of searching for a programmer to just create me a profitable EA with the least losses or zero losses maybe nearly 1 year i am searching i just need an HFT EA that can work very well on MT4,MT5
у нас есть стратегия, нам нужно написать mql5-код ​​для тестера стратегий МТ5,Цена договорная. Мой контакт @abbosaliyev из Telegram Программист должен знать РУССКИЙ ИЛИ УЗБЕКСКИЙ язык. Задание: разработать тестер, который использует шаблон условий на открытие и проверит весь исторический график на всех доступных таймфреймах. Остальная информация будет предоставлена ​​после согласования цены
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 &
Utilizing the MQL5 MetaEditor Wizard, I created an Expert Advisor, having the following Signal indicators: I was able to optimize the EA and reached a backtest with the following specifications: I was able to reach a profit level of 30K, as indicated below. However, the Bot is not without faults and following the backtest, I started a forward test with real live data and the results were not so great. The EA took a
Hey greetings. Am in need of a developer that has already made profitable MT4 or MT5 EA that I can buy with the backtesting and proven result. How is the draw down ? What is the winning rate ? Kindly reply and let proceed
I will buy your EA for MT5, in case that on distance it is able to make a profit of 10% per month. - Martingale methods and grid strategies should not be used as the basis of a trading strategy. - Excellent win rate (>80%) - High risk/loss management - Option to select direction of trading (long, short or both) - News filter - Editable Trading Hours I will need to test in the strategy tester and on live market (on
Looking for an experienced developer to modify my existing TDI strategy , want to add filter for Buy and Sell Signals, Arrows are displayed on chart and what only to leave high accurate arrows Source code to be provided

Informações sobre o projeto

Orçamento
30+ USD
Desenvolvedor
27 USD
Prazo
de 1 para 10 dias