Need Help with adding additional functions to this EA

Lavoro terminato

Tempo di esecuzione 6 giorni
Feedback del cliente
GOOD JOB
Feedback del dipendente
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 🙌🏾

Specifiche

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;


}











Con risposta

1
Sviluppatore 1
Valutazioni
(137)
Progetti
160
23%
Arbitraggio
7
0% / 43%
In ritardo
4
3%
Caricato
2
Sviluppatore 2
Valutazioni
(196)
Progetti
318
35%
Arbitraggio
64
13% / 56%
In ritardo
82
26%
Gratuito
3
Sviluppatore 3
Valutazioni
(21)
Progetti
24
38%
Arbitraggio
1
100% / 0%
In ritardo
2
8%
In elaborazione
4
Sviluppatore 4
Valutazioni
(1)
Progetti
5
0%
Arbitraggio
1
100% / 0%
In ritardo
2
40%
Gratuito
5
Sviluppatore 5
Valutazioni
(13)
Progetti
18
6%
Arbitraggio
1
0% / 0%
In ritardo
1
6%
In elaborazione
6
Sviluppatore 6
Valutazioni
(9)
Progetti
8
38%
Arbitraggio
2
0% / 100%
In ritardo
2
25%
In elaborazione
7
Sviluppatore 7
Valutazioni
(130)
Progetti
184
32%
Arbitraggio
17
29% / 59%
In ritardo
27
15%
In elaborazione
8
Sviluppatore 8
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
9
Sviluppatore 9
Valutazioni
(63)
Progetti
99
29%
Arbitraggio
1
100% / 0%
In ritardo
2
2%
Gratuito
10
Sviluppatore 10
Valutazioni
(196)
Progetti
200
28%
Arbitraggio
0
In ritardo
3
2%
Gratuito
11
Sviluppatore 11
Valutazioni
(61)
Progetti
68
29%
Arbitraggio
2
0% / 0%
In ritardo
1
1%
In elaborazione
12
Sviluppatore 12
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
13
Sviluppatore 13
Valutazioni
(96)
Progetti
143
76%
Arbitraggio
0
In ritardo
2
1%
Gratuito
14
Sviluppatore 14
Valutazioni
(66)
Progetti
143
34%
Arbitraggio
10
10% / 60%
In ritardo
26
18%
Gratuito
Ordini simili
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
Description - An expert advisor(s), placing sell trades in EUR/USD, based on the close price of the previous two candles, as shown in the figure below. The trades would be made in the 5 minute, 1 hour, and 1 day timeframes. In the 5 minute and 1 hour timeframes the market orders would be placed at the start of a new candle, at specific times EST. The order would be cancelled at the close of that candle, i.e after 5
Greetings, As the title suggests, I am trying to convert an indicator that calls itself via an iCustom call like this. iMAArray_Buffer[loop_1] = iCustom ( NULL , Selected_TF, MQLInfoString ( MQL_PROGRAM_NAME ), "calculate" , RPeriod, MType, MPeriod, 1 , shift); Full code will not be provided, only the position that needs fixing. I cannot get this working in MQL5 but the original code runs smoothly in MQL4. Please
Hi, I have an indicator from my friend, I want to copy it to my own Traidingview or MT5 can you do that for me. Here is the link
Hi, I have an indicator from my friend, I want to copy it to my own Traidingview or MT5 can you do that for me. Here is the link
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

Informazioni sul progetto

Budget
30+ USD
Per lo sviluppatore
27 USD
Scadenze
da 1 a 10 giorno(i)