Need a small modification of my EA

MQL4 Experts C++

Trabalho concluído

Tempo de execução 1 minuto
Comentário do cliente
Perfect thank you :)
Comentário do desenvolvedor
Once again, another job with a great customer. Thank you so much

Termos de Referência

Hello,
the problem is that my order is triggered too precisely.

Example
When I want an order to be triggered at 1.3542 and it is triggered exactly at 1.35420.
What I would like is that it is triggered between 1.35420 and 1.35429 that only the fourth
decimal place is taken into account.


Complete Code


//+------------------------------------------------------------------+
//|                                                       test35.mq4 |
//|                                                              xxx |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "xxx"
#property link      "http://www.mql5.com"
#property version   "1.00"
#property strict
extern double lots=0.50;
extern int TakeProfit=50;
extern int StopLoss=3000;
extern int magic=123456;
extern double Level = 1.3542;


bool RunOnce=false;


int last_order_check = false;

datetime EaStartTime=TimeCurrent();
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   RunOnce=false;
   MathSrand(GetTickCount());
   if(Digits==5 || Digits==3)
     {
      TakeProfit  *=10;
      StopLoss    *=10;
     }
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnTimer()
{
OnTick();        
}
void OnDeinit(const int reason)
  {
//---
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
{

  if(IsLastOrderCloseManual())
    {
    OnInit();
    Print("Ea Closed Manually ");
    EaStartTime=TimeCurrent();
    }

   int ticet;
   int t=MathRand();
  
   if(CountVsego()==0)
        {
      if(t>16384)
        {
         if(RunOnce || (Ask ==Level && Level !=0))
         {
            ticet=OrderSend(Symbol(),OP_BUY,lots,Ask,3,Bid-StopLoss*Point,Ask+TakeProfit*Point,"1",magic,0,clrGreen);
            if(ticet>0)
            {
               RunOnce=true;
            }
         }
        } 
     else if(t<16384)
        {
         if(RunOnce || (Bid ==Level && Level !=0))
         {
            ticet=OrderSend(Symbol(),OP_SELL,lots,Bid,3,Ask+StopLoss*Point,Bid-TakeProfit*Point,"1",magic,0,clrRed);
            if(ticet>0)
            {
               RunOnce=true;
            }
         }
        }
     }
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int CountSELL()
  {
   int count=0;
   int i;
   for(i=OrdersTotal()-1;i>=0;i--)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
        {
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==magic && OrderType()==OP_SELL)
            count++;
        }
     }
   return(count);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int CountBUY()
  {
   int count=0;
   int i;
   for(i=OrdersTotal()-1;i>=0;i--)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
        {
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==magic && OrderType()==OP_BUY)
            count++;
        }
     }
   return(count);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int CountVsego()
  {
   int Vsego;
   Vsego=CountBUY()+CountSELL();

   return(Vsego);
  }
//+------------------------------------------------------------------+
bool IsLastOrderCloseManual()
{
bool signal = false;
for(int i=OrdersHistoryTotal()-1;i>=0;i--)
  {
   bool select = OrderSelect(i,SELECT_BY_POS,MODE_HISTORY);
   if(select && OrderSymbol()==_Symbol && OrderMagicNumber()==magic)
     {
     if(OrderType()==OP_BUY && OrderCloseTime()>=EaStartTime)
       {
       if(OrderClosePrice()>OrderStopLoss() && OrderClosePrice()<OrderTakeProfit())
         {
         signal = true;
         
         }
         break;
       }
     else if(OrderType()==OP_SELL && OrderCloseTime()>=EaStartTime)
       {
       if(OrderClosePrice()<OrderStopLoss() && OrderClosePrice()>OrderTakeProfit())
         {
         signal = true;
         
         }
         break;
       }
       break;
     }
  }
return(signal);
}


Respondido

1
Desenvolvedor 1
Classificação
(590)
Projetos
789
71%
Arbitragem
9
33% / 33%
Expirado
22
3%
Livre
2
Desenvolvedor 2
Classificação
(879)
Projetos
1392
67%
Arbitragem
117
32% / 42%
Expirado
215
15%
Livre
3
Desenvolvedor 3
Classificação
(236)
Projetos
440
26%
Arbitragem
125
21% / 57%
Expirado
96
22%
Trabalhando
4
Desenvolvedor 4
Classificação
(186)
Projetos
261
69%
Arbitragem
12
33% / 67%
Expirado
16
6%
Livre
Pedidos semelhantes
I need an urgent requirement by the developer who are able expert in designing the EA-Anil and can give best trailing result of profit in EA-Anil I am sending.Developer should design the best graphic user trader panel info, plus a buy sell input panel and should display trade result within 4-5 days of this development program
EA Description: Box Identification: The EA allows users to manually mark consolidation zones on the chart with rectangular boxes. These boxes are distinguished by color: red for bearish zones and green for bullish zones. Entry Types: Aggressive Entry (True/False): Users can opt for aggressive entries, initiating trades at a specified percentage of the zone's range. Divergence Entry (True/False): The EA detects
I’m looking for a developer that has understanding of scalping and HFT strategies that can make an algo that works for all brokers and prop firm LIVE accounts (like STP, ECN, DMA, Money Makers, NDD, Fast Server etc.,). I want someone that has understanding and insight in different scalping and HFT strategies, preferably something like momentum based strategies. The EA has to work on all Brokers and Prop firms like
The strategy uses a grid trading system where trades are placed at set intervals (grid levels) and are managed using Bollinger Bands for entry and exit signals. A fixed lot size, trades are managed to comply with maximum spread conditions and specific trading hours, with the possibility of closing trades based on Bollinger Bands signals. The use of Bollinger Bands indicates a focus on volatility-based trading, while
I would like some assistance modifying an indicator as I am not experienced enough to make these changes myself. The indicator is relatively simple high/low breakout indicator that I need to add additional logic to. Source code will be provided. Current Features The indicator provided scans swing highs and lows and based on certain conditions draws a green or red line showing a break high or low. Dots are drawn to
Hi Everyone, I need a cloud based licensing system to protect my MT4 / MT5 Indicators and Expert advisors Secure an unlimited number of EAs, indicators, and scripts. Create and manage unlimited license keys for secured EAs, indicators, and scripts. Instantly suspend license keys in case of refund. Lock EA/indicator to specific accounts and time frame similar to this
Hi, i have a tos script i need converted to Ninja script, but someone who knows both coding. Cant be someone who is just going to paste into chat gpt, it requires more understanding for compatibility
Hi, i have a tos script i need converted to Ninja script, but someone who knows both coding. Cant be someone who is just going to paste into chat gpt, it requires more understanding for compatibility
HELLO, I need some modifications into my indicator . I need to add the possibility to show the old zones in addition to the current ones . We can already choose the possibility of displaying the old zones with the history mode with a double click when the option is ON, but this remove the current zones . What i want is the possibility when you activate the HISTORY MODE : to KEEP THE OLD ZONES DISPLAYED AUTOMATICALLY
MT4 INDICATOR 30 - 35 USD
Looking for a proven MT4 indicator that is highly consistent and profitable preferably that you have developed and are able to share with me. If you have some indicator that is valuable for making consistent profit please bid and show me trading history from using it in your MT4 account. Thanks

Informações sobre o projeto

Orçamento
30+ USD
IVA (20%): 6 USD
Total: 36 USD
Desenvolvedor
27 USD
Prazo
para 10 dias