EA who bug

Auftrag beendet

Ausführungszeit 7 Stunden
Bewertung des Kunden
Great programmer, great thank you
Bewertung des Entwicklers
Good customer

Spezifikation

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

Bewerbungen

1
Entwickler 1
Bewertung
(620)
Projekte
680
57%
Schlichtung
25
16% / 60%
Frist nicht eingehalten
228
34%
Frei
Ähnliche Aufträge
Purpose: 1. The EA should catch the trend and follow it up or down. 2. The EA must use volitile and volume (strong money flow/ATR or ADX. Feel free to come up with suggestions for indicators we can use. 3. EA must have a minimal Draw down at 3-5% MT4 EA Inputs • Lot size = 0.1 • Use Dynamic Lots = true/false • Risk Percentage of your balance= 2% • Min Allowed Lot Decimals = 0.1 or 0.01 or 1 • SL pips = 100 • TP Pips
I’m looking for someone experienced with Think or Swim to create a backtesting script for an in-the-money Iron Condor strategy using options on the SPX. The strategy involves setting up 10 contracts of an Iron Condor with a 10-point spread width and a net credit requirement of $11 per contract. The goal is to backtest the performance over the last three years, focusing on trades where the SPX closes outside a
Hello good Day, I would like to make a modification to an mql4 robot that I have and I am sure that by doing a couple of additional things it would be perfect. looking for someone to help me with it, and make sure you understand Spanish because the Mql4 is in Spanish
Hello there, i need an expert forex developer who is well versed with GALLIEO FX. I purchased a trading bot from this company and due to some reasons I haven't been able to test and run the program properly so I need an expert who can help me to fine tune the bot for me so that bot can provide excellent results. Thank You
Hi, I have my own strategy and some development done on it. But my developer is not able to solve few errors. Strategy has been built already. Can anyone help me with that
We are looking for an experienced MQL5 programmer to develop an Expert Advisor (EA) on MetaTrader 5. The project involves creating an automated trading bot that uses a methodology based on the integration of 2 technical indicators. If you have proven experience in similar projects, we invite you to apply. Main Description of the Bot Trading Methodology Details : The trading bot will operate based on a strategy that
Hello, I have a physically trading keyboard and i want to connect it with tradelocker, mt4,mt5 and ctrader. People need to be able to open and close a position with the keyboard really fast. i need it on macos, windows and linux. (desktop) My competition is: www.magickeys.trade My goal is to be the number 1 to sell the keyboards + software. When people order a tradingkeyboard they will get a mail after the purchase
Job Title: Expert Advisor (EA) Developer for Forex Trading Job Description: I am seeking an experienced Expert Advisor (EA) developer to create a customized trading bot for the MetaTrader 4/5 platform. The bot will be designed to execute a sophisticated trading strategy that incorporates daily range calculations, cost averaging, and hedging with precise pip management. The successful candidate should have strong
Hello, I have built and EA with FX Dreema ( https://fxdreema.com/ ) that uses the maximum and minimum vales of the previous candle to entry on a trade. After that, I put a Stop Loss and Trailing Stop on that order, and goes as the market follows up and down. First, I recognize what I'm asking in this project may not be possible. I know about the differences in results comparing Strategy Tester with Real and Live
I have an indicator here for sun Candlesticks...I'm looking for a programmer who can convert it to an EA . The EA must just follow the color of the candlesticks. Open and close based on the color of the candlesticks

Projektdetails

Budget
30+ USD
MwSt (20%): 6 USD
Insgesamt: 36 USD
Für die Entwickler
27 USD