Upgrading EA with 2 new variables

MQL4 Experts Forex

Job finished

Execution time 3 days
Feedback from employee
Has been a pleasure working with you, looking forward to work with you again.
Feedback from customer
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!

Specification

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));
  }
  
//+------------------------------------------------------------------+


Responded

1
Developer 1
Rating
(10)
Projects
9
11%
Arbitration
5
0% / 60%
Overdue
1
11%
Free
2
Developer 2
Rating
(63)
Projects
68
25%
Arbitration
12
42% / 42%
Overdue
4
6%
Free
3
Developer 3
Rating
(42)
Projects
62
8%
Arbitration
12
58% / 42%
Overdue
1
2%
Free
4
Developer 4
Rating
(55)
Projects
64
30%
Arbitration
5
0% / 40%
Overdue
1
2%
Working
5
Developer 5
Rating
(568)
Projects
641
41%
Arbitration
21
57% / 29%
Overdue
47
7%
Working
6
Developer 6
Rating
(1)
Projects
2
0%
Arbitration
0
Overdue
0
Free
Similar orders
I want to make a new dashboard using 3 common indicators and the ADX indicator , which you must supply I have a MA dash which you can strip & reuse if it helps you I tried to cover all questions in the attached but i'm sure there'll be more
I want the script in mql5 language for my martingale strategy. The script should open trades in both directions buy and sell and if any trade closes in loss then open new trade in that direction by using the next volume and when trade closes in profit then reset the volume to first from volume list and also maximum consecutive losses limit will apply. If trades closes consecutively in losses and hits the limit then
I installed the E.A. into the Experts folder in MT4. When I double click on it nothing happens. When I right click and "attach to chart" nothing happens. The E.A. is not grayed out, it simply will not attach. Any help would be greatly Appreciated
Lilit ordrer 50+ USD
l doa language that allows creating trading robots and technical indicators. i can do any writing and translation so dont worry i can do what you want ke to do
hi hi there i have an strategy on tradingview and i want to automate it like metatrader EA so i want the strategy to open and close trade automaticlly on tradingview
We are looking for an experienced Expert Advisor Developer who can build a customized MT5 Expert Advisor for us. The Expert Advisor would use two built-in indicators as entry/exit signals and our own risk management strategy with customizable inputs. The goal is to create a reliable and efficient trading tool that can automate our trading process on the MT5 platform. Skills required: - Strong understanding of
The wiper 35 - 48 USD
a ll traders want to find market behavior patterns, which could help identify favorable moments for performing trading operations. They also want to eliminate randomness and influence of external factors, such as rumors, news releases, fatigue, and so on. Traders monitor charts and may formulate some formal rules, which enable objective analysis of price or tick charts. Technical indicators can facilitate such
I need EA that works on MT5 to be able to do the following: - Can recognize Support/Resistance area - Can recognize VWAP direction. - Can recognize RSI. - Can recognize Double Top/bottom, Bullish/Bearish hammer candle, Bullish/bearish engulfing candle. - Ability to set Stoploss below/above support/resistance, but risk must be fixed at a certain price. - Stoploss
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

Project information

Budget
30+ USD
For the developer
27 USD
Deadline
from 1 to 3 day(s)