Need Help with adding additional functions to this EA

Tâche terminée

Temps d'exécution 6 jours
Commentaires du client
GOOD JOB
Commentaires de l'employé
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 🙌🏾

Spécifications

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;


}











Répondu

1
Développeur 1
Évaluation
(137)
Projets
160
23%
Arbitrage
7
0% / 43%
En retard
4
3%
Chargé
2
Développeur 2
Évaluation
(196)
Projets
318
35%
Arbitrage
64
13% / 56%
En retard
82
26%
Gratuit
3
Développeur 3
Évaluation
(21)
Projets
24
38%
Arbitrage
1
100% / 0%
En retard
2
8%
Travail
4
Développeur 4
Évaluation
(1)
Projets
5
0%
Arbitrage
1
100% / 0%
En retard
2
40%
Gratuit
5
Développeur 5
Évaluation
(13)
Projets
18
6%
Arbitrage
1
0% / 0%
En retard
1
6%
Travail
6
Développeur 6
Évaluation
(9)
Projets
8
38%
Arbitrage
2
0% / 100%
En retard
2
25%
Travail
7
Développeur 7
Évaluation
(130)
Projets
184
32%
Arbitrage
17
29% / 59%
En retard
27
15%
Travail
8
Développeur 8
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
9
Développeur 9
Évaluation
(63)
Projets
99
29%
Arbitrage
1
100% / 0%
En retard
2
2%
Gratuit
10
Développeur 10
Évaluation
(196)
Projets
200
28%
Arbitrage
0
En retard
3
2%
Gratuit
11
Développeur 11
Évaluation
(61)
Projets
68
29%
Arbitrage
2
0% / 0%
En retard
1
1%
Travail
12
Développeur 12
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
13
Développeur 13
Évaluation
(96)
Projets
143
76%
Arbitrage
0
En retard
2
1%
Gratuit
14
Développeur 14
Évaluation
(66)
Projets
143
34%
Arbitrage
10
10% / 60%
En retard
26
18%
Gratuit
Commandes similaires
I want a program that will help calculate and enter the market on full margin for me. I just need to put in the price for entry, Stop loss and TP then it will calculate the lot sizes for entering the trade on full margin on Mt5
I am seeking a highly skilled and experienced developer to assist with an important project. I need a development of an automated trading bot for NinjaTrader, utilizing a 4 SMA (Simple Moving Average) crossing strategy, with additional custom diversions for trade entries. The bot needs to be based on a strategy involving the crossing of four different SMAs. The exact periods for these SMAs and the conditions for
So i have copier EA. The idea is the EA will triggered through manual OP by user via mobile or whatever platform. Let's say 0.01 lot to trigger it. After the EA takes master's position, the EA will be standby mode. If the master take more OP, the EA still not take the master's position (OP) until the user input manually once again via mobile for another 0.01 lot. Since this is a MT4 EA, Whenever user want to close
preciso de um robô com duas médias móveis, uma exponencial high e uma exponencial low. preciso também ter a opção de utilizar e todos os tempos gráficos e alterar os parâmetros das médias. entrada de compra será feita quando um candle de alta romper e fechar a cima da média high e fechará a posição quando um candle de baixa romper e fechar a baixo da média low. a venda será feita quando o candle de baixa romper e
I need a chart to replicate/track my equity + Balance Curve into my mt4. Also this chart i need to be able to add Stochastic / Bollingerband / Moving average on the equity/balance curve. Besides the equity curve i would like the indicator to show the Line-chart of my win + 1 and my loss -1 which results in a win-loss curve. ( i will discuss this with the choosen developer in depth. ) More information on what i want
Greetings great developer, I am in search of a highly skilled developer to assist with an exciting project. I need to convert two open-source TradingView indicators to NinjaTrader 8 and implement a usage restriction based on computer IDs. If you have experience with NinjaTrader 8 coding please let me know. I’d be happy to discuss the details further
Greetings great developer, I am in search of a highly skilled MQL5 developer to assist with an exciting project. I need to convert two open-source TradingView indicators to NinjaTrader 8 and implement a usage restriction based on computer IDs. If you have experience with NinjaTrader 8 coding please let me know. I’d be happy to discuss the details further
Trading bot 300+ USD
We need bot that trades when medium and low impact news hits It will release pending order both directions few min prior to news impact And will have certain risk management strategy attached Example If Monday and Tuesday news successful clears profits It will reduce risk for next news events until new week starts each week message on tg: Dstatewealthtrading NOTE: 4 YAERS OF EXPERIENCE UPWORD, YOU MUST BE A
I need someone the create a supertrend indicator based on Heikin Ashi candles instead of normal candles. Needs to be exactly the same as the supertrend (original one) + ha from tradingview. In m1,m5,m15 the indicator must have the same values ​​found with the tradingview. Work that meets this requirement will be accepted ( depending on the broker and spread, however, a few pips of difference will be accepted)
Here is a detailed instruction for the coder to implement the vertical lines based on the BrainTrainSignalAlert indicator: --- **Task: Implement Vertical Lines for Alerts from BrainTrainSignalAlert Indicator** **Objective:** Create a system that adds vertical lines on specified timeframes (M5 or M30) whenever an alert is generated by the BrainTrainSignalAlert indicator on the H1, H4, and D1 timeframes. The lines

Informations sur le projet

Budget
30+ USD
Pour le développeur
27 USD
Délais
de 1 à 10 jour(s)