Grid EA with Order expiration

MQL4 Experten

Auftrag beendet

Ausführungszeit 6 Tage

Spezifikation

I have a grid order EA with code. I need EA to close pending orders after 5 minutes. So if orders with magic number 1 open at 00:00, pending orders with magic number 1 are delete at 00:005


See code below


//+------------------------------------------------------------------+

//--External variables

extern int    MagicNumber       = 1;//Magic number

extern string EaComment         = "Grid_Template";//Order comment

extern double StaticLot         = 0.01;//Static lots size

extern bool   MM                = false;//Money Management

extern int    Risk              = 2;//Risk %

extern double TakeProfit        = 20.;//Take Profit in pips

extern double StopLoss          = 10.;//Stop loss in pips

extern double PriceDistance     = 15.;//Distance from price in pips

extern double GridStep          = 15.;//Step between grid orders in pips

extern int    GridOrders        = 2;//Amount of grid orders

extern int    PendingExpiration = 15;//Pending expiration after xx minutes

//--Internal variables

double PriceB,PriceS,StopB,StopS,

       TakeB,TakeS,_points,PT,Lots;

int LotDigits;

datetime _e = 0;

int Ticket  = 0;

//--

int OnInit()

  {

//--Determine digits

   _points=MarketInfo(Symbol(),MODE_POINT);

//--

   if(Digits==5 || Digits==3)

      PT = _points*10;

   else

      PT = _points;

//--

   return(INIT_SUCCEEDED);

  }

//--

void OnDeinit(const int reason)

  {


  }

//--

void OnTick()

  {

//If trade allowed and no positions exists by any chart - open a new set of grid orders

   if(IsTradeAllowed() && !IsTradeContextBusy())

     {

      if(PosSelect()==0)

        {

         GridPos(PriceDistance,TakeProfit,StopLoss);//Place grid

        }

      return;

     }

  }

///////////////////////////////////////////////////////////

//Grid order send function

void GridPos(double _Dist,double _Take,double _Stop)

  {

   int i;

   _e=TimeCurrent()+PendingExpiration*60;

//--

   for(i=0; i<GridOrders; i++)

     {

      PriceB = NormalizeDouble(Ask+(_Dist*PT)+(i*GridStep*PT),Digits);

      TakeB  = PriceB + _Take * PT;

      StopB  = PriceB - _Stop * PT;

      Ticket=OrderSend(Symbol(),OP_BUYSTOP,LotSize(),PriceB,3,StopB,TakeB,EaComment,MagicNumber,_e,Green);

      //--

      PriceS = NormalizeDouble(Bid-(_Dist*PT)-(i*GridStep*PT),Digits);

      TakeS  = PriceS - _Take * PT;

      StopS  = PriceS + _Stop * PT;

      Ticket=OrderSend(Symbol(),OP_SELLSTOP,LotSize(),PriceS,3,StopS,TakeS,EaComment,MagicNumber,_e,Red);

     }

   if(Ticket<1)

     {

      Print("Order send error - errcode: ",GetLastError());

      return;

     }

   else

     {

      Print("Grid placed successfully!");

     }

   return;

  }

//////////////////////////////////////////////////////////

//PositionSelector - Determines open positions

int PosSelect()

  {

   int posi=0;

   for(int k = OrdersTotal() - 1; k >= 0; k--)

     {

      if(!OrderSelect(k, SELECT_BY_POS))

        {

         Print("Order pos selection failed - errcode: ",GetLastError());

        }

      if(OrderSymbol()!=Symbol()&&OrderMagicNumber()!=MagicNumber)

        {

         continue;

        }

      if(OrderCloseTime() == 0 && OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber)

        {

         if(OrderType() == OP_BUY)

            posi = 1; //Long position

         if(OrderType() == OP_SELL)

            posi = -1; //Short positon

         if(OrderType() == OP_BUYSTOP)

            posi = 1; //Pending Long position

         if(OrderType() == OP_SELLSTOP)

            posi = -1; //Pending Short positon

        }

     }

   return(posi);

  }

////////////////////////////////////////////////////////////

//Lots size calculation

double LotSize()

  {

   if(MM == true)

     { Lots = MathMin(MathMax((MathRound((AccountFreeMargin()*Risk/1000/100)

       /MarketInfo(Symbol(),MODE_LOTSTEP))*MarketInfo(Symbol(),MODE_LOTSTEP)),

       MarketInfo(Symbol(),MODE_MINLOT)),MarketInfo(Symbol(),MODE_MAXLOT));}

   else

     {

      Lots = MathMin(MathMax((MathRound(StaticLot/MarketInfo(Symbol(),MODE_LOTSTEP))*MarketInfo(Symbol(),MODE_LOTSTEP)),

      MarketInfo(Symbol(),MODE_MINLOT)),MarketInfo(Symbol(),MODE_MAXLOT));

     }


   return(Lots);

  }

//+----------------End of Temi's Trader EA-------------------+

Bewerbungen

1
Entwickler 1
Bewertung
(16)
Projekte
20
0%
Schlichtung
9
0% / 78%
Frist nicht eingehalten
6
30%
Frei
2
Entwickler 2
Bewertung
(33)
Projekte
35
40%
Schlichtung
11
9% / 91%
Frist nicht eingehalten
4
11%
Frei
3
Entwickler 3
Bewertung
(251)
Projekte
400
54%
Schlichtung
9
67% / 22%
Frist nicht eingehalten
36
9%
Frei
4
Entwickler 4
Bewertung
(376)
Projekte
475
40%
Schlichtung
83
36% / 33%
Frist nicht eingehalten
13
3%
Überlastet
5
Entwickler 5
Bewertung
(368)
Projekte
398
70%
Schlichtung
3
100% / 0%
Frist nicht eingehalten
2
1%
Beschäftigt
6
Entwickler 6
Bewertung
(298)
Projekte
442
64%
Schlichtung
5
40% / 0%
Frist nicht eingehalten
4
1%
Arbeitet
7
Entwickler 7
Bewertung
(74)
Projekte
121
43%
Schlichtung
12
33% / 50%
Frist nicht eingehalten
17
14%
Frei
8
Entwickler 8
Bewertung
(2428)
Projekte
3057
66%
Schlichtung
77
48% / 14%
Frist nicht eingehalten
340
11%
Frei
9
Entwickler 9
Bewertung
(478)
Projekte
507
53%
Schlichtung
10
60% / 20%
Frist nicht eingehalten
3
1%
Frei
10
Entwickler 10
Bewertung
(256)
Projekte
415
38%
Schlichtung
86
44% / 19%
Frist nicht eingehalten
70
17%
Überlastet
11
Entwickler 11
Bewertung
(124)
Projekte
158
42%
Schlichtung
20
60% / 20%
Frist nicht eingehalten
8
5%
Frei
12
Entwickler 12
Bewertung
(11)
Projekte
16
25%
Schlichtung
0
Frist nicht eingehalten
1
6%
Frei
13
Entwickler 13
Bewertung
(74)
Projekte
73
47%
Schlichtung
2
50% / 50%
Frist nicht eingehalten
2
3%
Frei
14
Entwickler 14
Bewertung
(563)
Projekte
932
47%
Schlichtung
302
59% / 25%
Frist nicht eingehalten
124
13%
Beschäftigt
15
Entwickler 15
Bewertung
(42)
Projekte
88
14%
Schlichtung
30
30% / 53%
Frist nicht eingehalten
36
41%
Arbeitet
Ähnliche Aufträge
I am seeking an experienced MQL5 developer to create a user-friendly manual Grid Trading Expert Advisor (EA) with the following key features: Dynamic Grid Trading: Adjustable Grid Distance: Traders can manually input grid distance in pips via an intuitive, movable table. Take Profit Management: Fixed TP for the initial positions (e.g., first 5 trades). Stop-Loss (Optional): Traders can choose to use a stop-loss with
I want have the possibility to increase lotsize not alone by Lot-multiplier rather I want add a fix-lot increase for excample for 0,05 lot. I want have this for buy / sell and hedge-buy and hedge sell
Hi, I want to make an automated system to take my place in making trading positions and closing it. But I want to ask , can you program it to draw a trend line in a specific chart and several moving averages should be in specific order, and when the price is near the trend line by few pips, we shift to 15 minutes chart and noticing a resistance or support action , then we take the trade ? can we do that
Develop EA to track performance metrics of strategies I would like to develop an EA that will track the performance metrics of the strategies I have running on a terminal, If any of the metrics start to under perform then the EA/Indictor should alert me with a pop up alert that specify's the metric that has triggered the alert. The EA should also display the metrics in a dashboard - please see my example screen shot
I would like to modify the RSI Epert Avisor with a developer. I would like to use the RSI Expert on the inverse mode and the base setting doesnt conatain this strategy mode
Profitable EA HFT 50 - 300 USD
From a long time i am searching for a profitable EA i have lost a lot , and now i have only 300$ to buy a profitable EA , i wish to say with 0 losses but some or most traders they don't want to hear this i am really tired of searching for a programmer to just create me a profitable EA with the least losses or zero losses maybe nearly 1 year i am searching i just need an HFT EA that can work very well on MT4,MT5
I need help fixing my EA for MT5. It’s a very simple EA, and I currently cannot solve an issue where webrequest communicates with OpenAi API without error. Please only apply if you can help solve this issue
у нас есть стратегия, нам нужно написать mql5-код ​​для тестера стратегий МТ5,Цена договорная. Мой контакт @abbosaliyev из Telegram Программист должен знать РУССКИЙ ИЛИ УЗБЕКСКИЙ язык. Задание: разработать тестер, который использует шаблон условий на открытие и проверит весь исторический график на всех доступных таймфреймах. Остальная информация будет предоставлена ​​после согласования цены
a coder is required to add an indicator to existing ea The new indicator will work as 1. option to combine with exiting indicator to open trade 2. it will be used as alternative BE point 3. It can also be used to close order or combine with other to close trade The second Job is telegram bot to get alert fr news trade and others Details when you apply i will test the ea work on live market and all bug is fixed before
Hello, I want to make an EA based on SMC and a developer that is familiar with the concept and full understanding of this. Must have done similar jobs before and be able show it. I only want to work with developer that has good track record and is precise. Further information will be handed when contact is made. Developers that has zero rating will not be considered. Listed price is a base point. The project can also

Projektdetails

Budget
50 - 100 USD
Für die Entwickler
45 - 90 USD
Ausführungsfristen
von 1 bis 10 Tag(e)