Upgrading EA with 2 new variables

MQL4 Experts Forex

Tâche terminée

Temps d'exécution 3 jours
Commentaires de l'employé
Has been a pleasure working with you, looking forward to work with you again.
Commentaires du client
Hany is the best developer I've subcontracted for his programming skills but also for suggesting improvements to the initial specs but also for timely execution of all tasks. I highly recommend him!

Spécifications

Hi everyone!
I have a working EA based on SMAs and need someone to code the following,

A. Conditions
- The programmer must allow me to do backtesting before making the payment.
- Upon payment, the programmer must provide the .mq4 file.
- The .mq4 file must compile without any "Warning".
- The EA will be tested and used on ICMarkets raw account using MetaTrader 4.
- The intellectual property of the EA belongs to the contractor.
- The programmer has no responsibility for the effectiveness of the EA.
- The EA must only place one order (BUY or SELL) at a time.
- The EA must be capable of backtesting on the following pairs - EURUSD,GBPUSD,USDCAD,EURGBP,EURAUD,AUDCAD,AUDUSD,EURCAD,NZDUSD,AUDNZD.

B. Required Coding (please adapt as required)
1. When placing a BUY order, I wish to retain the price at which the order was placed - variable "initial_price_buy" (e.g. using iOpen);
2. When placing a SELL order, I wish to retain the price at which the order was placed - variable "initial_price_sell" (e.g. using iOpen);
3. When closing a BUY, besides the provided SMA logic, the order will only close if "close_buy" is ABOVE " initial_price_buy ";
4. When closing a SELL, besides the provided SMA logic, the order will only close if "close_sell" is BELOW " initial_price_sell ";

NOTE
I've attempted to code items 1,2 and 3 above but could not manage. My code is commented in the sample code I'm attaching and is provided in the following lines..
24;25;26;27;63;64;65;66;88;93;99 and 108.

//+------------------------------------------------------------------+
//|                                            droid_top_sma_v00.mq4 |
//|                                Copyright 2022, Mario Vasconcelos |
//|                                             https://www.none.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2022, Mario Vasconcelos"
#property link      "https://www.none.com"
#property version   "1.00"
#property strict

input string  iNote_1    = " --== EA Settings ==-- ";
input ENUM_TIMEFRAMES      iTF                     = PERIOD_CURRENT; //TimeFrame)
input int                  iRC                     = 60;             //RANGING_CANDLES
input int                  iRL                     = 150;            //RANGING_LIMIT
input double               iLot                    = 0.01;           //Lot
input int                  iMagic                  = 201159;         //Mag

double sma_7;   //magenta
double sma_14;  //cyan
double sma_25;  //green
double sma_75;  //dash white
double sma_200; //dash orange

//static initial_price_sell;
//static initial_price_buy;
//double close_buy;
//double close_sell;

int Ranging;
int ticket;

datetime gBarTime;

string _PR = "EAO_";
int _ae[4] = {6,136,138,129};
datetime _TimeInit = 0;

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
      sma_7  = iMA (_Symbol,_Period,7,0,MODE_SMA,PRICE_OPEN,0);   //magenta
      sma_14 = iMA (_Symbol,_Period,14,0,MODE_SMA,PRICE_OPEN,0);  //cyan
      sma_25 = iMA (_Symbol,_Period,25,0,MODE_SMA,PRICE_OPEN,0);  //green
      sma_75 = iMA (_Symbol,_Period,75,0,MODE_SMA,PRICE_OPEN,0);  //dash white
      sma_200 = iMA (_Symbol,_Period,200,0,MODE_SMA,PRICE_OPEN,0);  //dash orange

//      initial_price_buy = iOpen(NULL,0,0);
//      initial_price_sell = iOpen(NULL,0,0);
//      close_buy = iOpen(NULL,0,0);
//      close_sell = iOpen(NULL,0,0);
    
      int HighestCandle = iHighest(_Symbol,iTF,MODE_CLOSE,iRC,0);
      ObjectDelete(_PR+"LH");
      ObjectCreate(_PR+"LH",OBJ_HLINE,0,_Time(0),_High(HighestCandle));
      int LowestCandle = iLowest(_Symbol,iTF,MODE_CLOSE,iRC,0);
      ObjectDelete(_PR+"LL");
      ObjectCreate(_PR+"LL",OBJ_HLINE,0,_Time(0),_Low(LowestCandle));

      Ranging = 0;
      double diff = _High(HighestCandle)-_Low(LowestCandle);
      if(diff<=iRL*_Point)
      {
      Ranging = 1;
      }

    if(Ranging == 0){
        if(ticket <= 0){
        
        // placing SELL
          if((sma_75 > sma_200) && (sma_7 > sma_75) && (sma_7 < sma_14) && (sma_7 < sma_25))
             ticket = OrderSend(Symbol(),OP_SELL,iLot,Bid,10,0,0,NULL,iMagic,0,clrRed);
//           initial_price_sell = iOpen(NULL,0,0);
                 
        // placing BUY
          if((sma_75 > sma_200) && (sma_7 < sma_75) && (sma_7 < sma_25) && (sma_14 < sma_75))
             ticket = OrderSend(Symbol(),OP_BUY,iLot,Ask,10,0,0,NULL,iMagic,0,clrGreen);
//           initial_price_buy = iOpen(NULL,0,0);

        }     
    }
      // exit SELL //
        if((sma_75 < sma_200) && (sma_7 < sma_75) && (sma_14 < sma_75) && (sma_14 < sma_25)) 
//         if(close_sell < initial_price_sell) "close_sell" is the price at the moment the SMA logic above is met.
           if(OrderSelect(ticket, SELECT_BY_TICKET) && OrderType() == OP_SELL){ 
             if(OrderClose(OrderTicket(),OrderLots(),Ask,10,clrOrange)){
                ticket = 0;
             }
           }
           
      // exit BUY //
        if((sma_75 > sma_200) && (sma_7 > sma_75) && (sma_14 > sma_75) && (sma_7 < sma_25)) 
//         if(close_buy > initial_price_buy) "close_buy" is the price at the moment the SMA logic above is met.
          if(OrderSelect(ticket, SELECT_BY_TICKET) && OrderType() == OP_BUY){ 
            if(OrderClose(OrderTicket(),OrderLots(),Bid,10,clrWhite)){
              ticket = 0;
            }
          }   
  }
  
double _Close(int i)
  {
   return(iClose(_Symbol,iTF,i));
  }
double _Open(int i)
  {
   return(iOpen(_Symbol,iTF,i));
  }
double _High(int i)
  {
   return(iHigh(_Symbol,iTF,i));
  }
double _Low(int i)
  {
   return(iLow(_Symbol,iTF,i));
  }
datetime _Time(int i)
  {
   return(iTime(_Symbol,iTF,i));
  }
  
//+------------------------------------------------------------------+


Répondu

1
Développeur 1
Évaluation
(10)
Projets
9
11%
Arbitrage
5
0% / 60%
En retard
1
11%
Gratuit
2
Développeur 2
Évaluation
(64)
Projets
68
25%
Arbitrage
12
42% / 42%
En retard
4
6%
Gratuit
3
Développeur 3
Évaluation
(42)
Projets
62
8%
Arbitrage
12
58% / 42%
En retard
1
2%
Gratuit
4
Développeur 4
Évaluation
(58)
Projets
67
28%
Arbitrage
6
0% / 67%
En retard
2
3%
Gratuit
5
Développeur 5
Évaluation
(568)
Projets
641
41%
Arbitrage
22
55% / 32%
En retard
47
7%
Travail
6
Développeur 6
Évaluation
(1)
Projets
2
0%
Arbitrage
0
En retard
0
Gratuit
Commandes similaires
Hello Devs. I need someone who can make for me full Working traders dashboard on MT5. Dashboard functions: Few TPs levels based on pips in profit and/or %. Fixed lot position calculator so i can put for example 40pips SL and ea will calculate Lot size based on my account size. Plus few other features. Need to looks professional not a Old bios program. Please only apply if You have experience in this
Fintech robots 30+ USD
Specification I need a grid ea that puts buy stops and sell stops on the chart (only stops no limits). See image Example: if the price moves up filling the buy stops. The ea should place new sell stops below the price for the set parameters. And vice versa. Also if price moves up it should place new buy stops above the last buy stop. So if the parameter is set to 50 buy stops. There should always be 50 buy stops in
Develop a multi-strategies EA that makes entries based on selectable indicator-based criteria. Each can be toggled on/off, and trades can also be placed using a selectable combination of signals. Each trade position shall be entered on the bar and managed as a modified martingale. Position management will include partial close, variable grid increase as grid number increases, News stops, and a Dashboard for manual
Hello, In need an expert advisor that can copy my CFD (GBPUSD) into Futures 6B, along with AUDUSD. & that whenever I close the position, it closes it aswell. Also if there is limited broker API access, I don't mind getting a broker recommendation
I need an EA that opens trades according to the crossover of Moving Averages. The EA is based on two Moving Averages MA1 and MA2: For every new candle the EA attempts to open a new position, according to the MA crossover direction: If MA1>MA2, open a BUY position If MA1<MA2, open a SELL position There is a limit for current open trades which is also set in the settings. If the number of open trades reaches that
Good day to you sir. Please can you help me with converting an options trading platform to MT4? I am talking about Pocket Options OTC Markets. Please kindly read the WORD DOCUMENT attached to this chat below! Tbh I want a 100% OTC accuracy. I thought of the possibility of converting a chart beyond the live display/execution? Is it possible to display a market on MT4 2 to 3 minutes faster than the live charts? I mean
the code wasn't mine, i have got it somewhere on the web, but i like the performance of the EA, so i want to use it on mt5 platform. the given code based on price movements with ladder entry concept
Preciso de um EA, que faça o fecho automático de operações abertas no final da sessão e nas notícias de alto impacto. Um EA simples com apenas 1 função. Fecho das operações abertas
I want to make AI based on Attached Picture Swing High low. If you have experience can share demo first. Stop loss, take profit, trailing , break even ,DD etc. also amiable
Hello, I’m looking for a TradingView indicator that fits my forex trading needs. If you can create or customize one for me, please reach out. I'd appreciate your help! Thanks in advance."

Informations sur le projet

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