EA who bug

작업 종료됨

실행 시간 7 시간
고객의 피드백
Great programmer, great thank you
피고용인의 피드백
Good customer

명시

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

응답함

1
개발자 1
등급
(620)
프로젝트
680
57%
중재
25
16% / 60%
기한 초과
228
34%
무료
비슷한 주문
C onversion from Ninjatrader to Tradingview. This includes thorough testing and debugging to guarantee that the script functions as intended on Tradingview...If you are in for this job kindly bid
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
Wedging MT4 and MT5 hedging locker expert advisors that hedge existing trades either with pending or market order hedging trades. With pending hedge trades the entry price may optionally be made to trail the existing open orders. There should be option for a breakeven and trailing of the hedge trade’s stop
I would like to create an EA based on my indicator. The indicator issues buy and sell alerts on the chart, and it marks the signal zone, the Stop Loss zone, and the Take Profit zones 1, 2, and 3. I want to replace the alerts with other alerts that have customized text if possible, and have the ability to switch On or Off in the EA to use either EA mode or indicator-only mode. As for the opening and closing mode of
105fx 30 - 200 USD
We are trading nothing is a scam when you join our group we use same robot and we use the same broker we can also teach you some other tricks of trading
I m looking for a developer who can convert a MT4 EA to MT5 EA, work details as under. It is very basic MT4 EA, some un-wanted options need to be removed in MT5 version and some basic options like EA start time and stop time need to be add in MT5 version. Source code of MT5 version also needed. Experienced Developers can contact me
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
I'm looking for professional developer for my project.I'm having indicators source code , i want to convert it into MT4 EA .it is having some basic inputs such as lot size,TP,SL,B.E,trailing,News filter features along with some special inputs.detailed strategy will be discussed in chat room.i prefer Indian developers who speaks hindi
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

프로젝트 정보

예산
30+ USD
VAT (20%): 6 USD
총: 36 USD
개발자에게
27 USD