Trabajo finalizado

Plazo de ejecución 7 horas
Comentario del Cliente
Great programmer, great thank you
Comentario del Ejecutor
Good customer

Tarea técnica

Hello,
My EA has some takeprofit and order opening investment problems.

Example:
I decide that my order opens at 1.3540 on the gbpusd pair with a takeprofit of 10 pips,
 when the price is reached the EA opens well, but when I close my order manually and the price 
goes back to 1.3540 the EA opens the position but with a takeprofit over 100pips and when I close
 it again and the price goes back to 1.3540 it opens the order but with a takeprofit of more than 
1000pips and when I close it again the EA opens no more order ...



It really is

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.01;
extern int     TakeProfit     = 10;
extern int     StopLoss       = 3000;
extern int     magic          = 111111;
extern double  Level          = 1.3540;
extern double  MaxDeviation   = 9;         // Max Deviation, points

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(IsLastOrderClose())
    {
    OnInit();
    Print("Ea Closed Manually ");
    EaStartTime=TimeCurrent();
    }

   int ticet;
   int t=MathRand();
  
   if(CountVsego()==0)
        {
      if(t>16384)
        {
         if(RunOnce || (Ask >=Level && Ask<=Level+(MaxDeviation*_Point) && 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 && Bid >= Level-(MaxDeviation*_Point) && 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 IsLastOrderClose()
{
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);
}

Han respondido

1
Desarrollador 1
Evaluación
(620)
Proyectos
680
57%
Arbitraje
25
16% / 60%
Caducado
228
34%
Libre
Solicitudes similares
If you can deliver, you can bid your price. 1. Decompile the MT4/MT5 EA: - Decompile the provided .ex4 (for MT4) or .ex5 (for MT5) file into the original .mq4/.mq5 source code. - Ensure that the entire logic and functionality are preserved during decompilation. 2. Remove Expiration Limitations: - Locate and remove or bypass any code that imposes an expiration date or limits the usage of the bot. - Test to
Project Overview: The project is to convert a high-frequency trading strategy from TradingView’s PineScript into an automated MQL5 Expert Advisor (EA). Additional features will be added to the EA which are not part of the TradingView PineScript, details are added below. Key Requirements: Experience: Strong expertise in both TradingView PineScript, MQL5, and FOREX trading is essential. The MQL5 EA must closely
Experienced developer to create an EA using multiple common indicators. Indicators are disclosed in the Requirements Specification in clear formal trading rules. Sharp focus on the placement of Stop Loss and Trailing Stops in a must capability. 4X platform is MT4
Dear All, I need an RISK to REWARD Ratio expert advisor for top to bottom, support and resistance and order block strategy. If the developer has any good risk to reward strategy, I will apprecaite. Kindly provide me the EA, I will test it on my demo account from Monday till friday - And the payment gets released on Friday upon the results The EA should also be able to give TRUE and honest back test results. The ea
Hello there, I’m looking for a highly skilled programmer or engineer that can code an efficient and effective anti-decompilation mechanism for my MQL5 expert advisor, that ideally can obfuscate further my code. Also, I’m looking for an integrity check system, which based on the hash of the original code (hidden inside the code itself) checks whether the hash of the current code matches
I have created a Timeframe Panel indicator in mql5. The indicator scans for all open charts on the platform and it creates a panel that contains all the open symbols and next to it it contains all the timeframes for each symbol. When i attach the indicator to 4-5 charts then it makes many times the chart to freeze and the price feed of the chart stops. I want an experienced mql5 to make the indicator not to freeze
Hi, I will use: 5 indicators to find main trend , 5indicators to find current trend, find pivot point, support/resistance, reversel candle then entry.......indicators are available on mt5. *Dashboard chart will show on the chart as all indicators result,,,,as MA,MACD, bullish or bearish ,,,,add all others features days of trading,,,,hrs,,,etc
Ea already has it way of placing order by putting pending orders when candle open in the direction of the previous candle .All function of the ea should be maintained nothing should change. I want ea should have a compounding order function,which allow ea place multiple pending order in the form of grid with a compounding pips interval function(the distance between two pending orders) in accordance to original ea
I want Ea tht will work on boom and crash only. The ea must work in m1 / m5 and it must scalp . I want the ea grow small account like 10 usd to 100/50 usd daily.. boom and crash no loss . The developer must came with the strategy... this ea is for small account
Here’s a rephrased version with more than 30 words: "Hello, I'm new here and looking for assistance in coding my trading strategies on TradingView. I need someone experienced with Pine Script to help me create scripts for my strategies. Please let me know if you're able to assist with this project. Thank you!" 4o

Información sobre el proyecto

Presupuesto
30+ USD
IVA (20%): 6 USD
Total: 36 USD
Para el ejecutor
27 USD