Modify an Expert Advisor so it will trade

MQL4 Indikatoren Experten Forex

Auftrag beendet

Ausführungszeit 3 Minuten
Bewertung des Kunden
I am fairly new to all this and was amazed with the skill and patience from my developer. I will always use him in the future.
Bewertung des Entwicklers
Thank you very much!

Spezifikation

I created an EA online through EA Builder.com, but it will not initiate any trades. I keep receiving an error stating:  "OrderSend error #4051 invalid function parameter value" and "invalid lots amount for OrderSend function".I have tried every lot size I can think of, but I still get this same error message.

Here is what I want this EA to be able to do:

1.  I want to be able for it to initiate a trade, long and/or short in the lot size I can specify.

2.  I want to be able to set trading times of day in 30 minute intervals.  For example, I can turn the system on at 4pm and stop initiating trades at 6pm.

3.  That's All!


Here is the current EA that I am using that will not initiate any trades:

//+------------------------------------------------------------------+
//|                                         Strategy: RJS QQE EA.mq4 |
//|                                       Created with EABuilder.com |
//|                                        https://www.eabuilder.com |
//+------------------------------------------------------------------+
#property copyright "Created with EABuilder.com"
#property link      "https://www.eabuilder.com"
#property version   "1.00"
#property description ""

#include <stdlib.mqh>
#include <stderror.mqh>

int LotDigits; //initialized in OnInit
int MagicNumber = 1532634;
extern double TradeSize = 0.1;
int MaxSlippage = 3; //adjusted in OnInit
bool crossed[1]; //initialized to true, used in function Cross
bool Push_Notifications = true;
int MaxOpenTrades = 1;
int MaxLongTrades = 1;
int MaxShortTrades = 1;
int MaxPendingOrders = 1;
int MaxLongPendingOrders = 1;
int MaxShortPendingOrders = 1;
bool Hedging = false;
int OrderRetry = 5; //# of retries if sending order returns error
int OrderWait = 5; //# of seconds to wait if sending order returns error
double myPoint; //initialized in OnInit

bool Cross(int i, bool condition) //returns true if "condition" is true and was false in the previous call
  {
   bool ret = condition && !crossed[i];
   crossed[i] = condition;
   return(ret);
  }

void myAlert(string type, string message)
  {
   if(type == "print")
      Print(message);
   else if(type == "error")
     {
      Print(type+" | RJS QQE EA @ "+Symbol()+","+IntegerToString(Period())+" | "+message);
      if(Push_Notifications) SendNotification(type+" | RJS QQE EA @ "+Symbol()+","+IntegerToString(Period())+" | "+message);
     }
   else if(type == "order")
     {
      Print(type+" | RJS QQE EA @ "+Symbol()+","+IntegerToString(Period())+" | "+message);
      if(Push_Notifications) SendNotification(type+" | RJS QQE EA @ "+Symbol()+","+IntegerToString(Period())+" | "+message);
     }
   else if(type == "modify")
     {
     }
  }

int TradesCount(int type) //returns # of open trades for order type, current symbol and magic number
  {
   int result = 0;
   int total = OrdersTotal();
   for(int i = 0; i < total; i++)
     {
      if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == false) continue;
      if(OrderMagicNumber() != MagicNumber || OrderSymbol() != Symbol() || OrderType() != type) continue;
      result++;
     }
   return(result);
  }

int myOrderSend(int type, double price, double volume, string ordername) //send order, return ticket ("price" is irrelevant for market orders)
  {
   if(!IsTradeAllowed()) return(-1);
   int ticket = -1;
   int retries = 0;
   int err = 0;
   int long_trades = TradesCount(OP_BUY);
   int short_trades = TradesCount(OP_SELL);
   int long_pending = TradesCount(OP_BUYLIMIT) + TradesCount(OP_BUYSTOP);
   int short_pending = TradesCount(OP_SELLLIMIT) + TradesCount(OP_SELLSTOP);
   string ordername_ = ordername;
   if(ordername != "")
      ordername_ = "("+ordername+")";
   //test Hedging
   if(!Hedging && ((type % 2 == 0 && short_trades + short_pending > 0) || (type % 2 == 1 && long_trades + long_pending > 0)))
     {
      myAlert("print", "Order"+ordername_+" not sent, hedging not allowed");
      return(-1);
     }
   //test maximum trades
   if((type % 2 == 0 && long_trades >= MaxLongTrades)
   || (type % 2 == 1 && short_trades >= MaxShortTrades)
   || (long_trades + short_trades >= MaxOpenTrades)
   || (type > 1 && type % 2 == 0 && long_pending >= MaxLongPendingOrders)
   || (type > 1 && type % 2 == 1 && short_pending >= MaxShortPendingOrders)
   || (type > 1 && long_pending + short_pending >= MaxPendingOrders)
   )
     {
      myAlert("print", "Order"+ordername_+" not sent, maximum reached");
      return(-1);
     }
   //prepare to send order
   while(IsTradeContextBusy()) Sleep(100);
   RefreshRates();
   if(type == OP_BUY)
      price = Ask;
   else if(type == OP_SELL)
      price = Bid;
   else if(price < 0) //invalid price for pending order
     {
      myAlert("order", "Order"+ordername_+" not sent, invalid price for pending order");
   return(-1);
     }
   int clr = (type % 2 == 1) ? clrRed : clrBlue;
   while(ticket < 0 && retries < OrderRetry+1)
     {
      ticket = OrderSend(Symbol(), type, NormalizeDouble(volume, LotDigits), NormalizeDouble(price, Digits()), MaxSlippage, 0, 0, ordername, MagicNumber, 0, clr);
      if(ticket < 0)
        {
         err = GetLastError();
         myAlert("print", "OrderSend"+ordername_+" error #"+IntegerToString(err)+" "+ErrorDescription(err));
         Sleep(OrderWait*1000);
        }
      retries++;
     }
   if(ticket < 0)
     {
      myAlert("error", "OrderSend"+ordername_+" failed "+IntegerToString(OrderRetry+1)+" times; error #"+IntegerToString(err)+" "+ErrorDescription(err));
      return(-1);
     }
   string typestr[6] = {"Buy", "Sell", "Buy Limit", "Sell Limit", "Buy Stop", "Sell Stop"};
   myAlert("order", "Order sent"+ordername_+": "+typestr[type]+" "+Symbol()+" Magic #"+IntegerToString(MagicNumber));
   return(ticket);
  }

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {  
   //initialize myPoint
   myPoint = Point();
   if(Digits() == 5 || Digits() == 5)
     {
      myPoint *= 10;
      MaxSlippage *= 10;
     }
   //initialize LotDigits
   double LotStep = MarketInfo(Symbol(), MODE_LOTSTEP);
   if(NormalizeDouble(LotStep, 5) == round(LotStep))
      LotDigits = 0;
   else if(NormalizeDouble(10*LotStep, 5) == round(10*LotStep))
      LotDigits = 1;
   else if(NormalizeDouble(100*LotStep, 5) == round(100*LotStep))
      LotDigits = 5;
   else LotDigits = 5;
   int i;
   //initialize crossed
   for (i = 0; i < ArraySize(crossed); i++)
      crossed[i] = true;
   return(INIT_SUCCEEDED);
  }

//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
  }

//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   int ticket = -1;
   double price;  
  
  
   //Open Buy Order, instant signal is tested first
   if(Cross(0, iCustom(NULL, PERIOD_CURRENT, "QQE averages histo + alerts + arrows", 1, 5, 14, 0, 4.236, 70, 30, "Alerts Settings", false, false, true, false, false, false, true, false, "alert2.wav", true, "qqe Arrows1", 1.5, false, DeepSkyBlue, Red, 233, 234, 1, 1, true, DeepSkyBlue, Red, 233, 234, 3, 3, 3, 0) > iCustom(NULL, PERIOD_CURRENT, "QQE averages histo + alerts + arrows", 1, 5, 14, 0, 4.236, 70, 30, "Alerts Settings", false, false, true, false, false, false, true, false, "alert2.wav", true, "qqe Arrows1", 1.5, false, DeepSkyBlue, Red, 233, 234, 1, 1, true, DeepSkyBlue, Red, 233, 234, 3, 3, 4, 0)) //QQE averages histo + alerts + arrows crosses above QQE averages histo + alerts + arrows
   )
     {
      RefreshRates();
      price = Ask;  
      if(IsTradeAllowed())
        {
         ticket = myOrderSend(OP_BUY, price, TradeSize, "");
         if(ticket <= 0) return;
        }
      else //not autotrading => only send alert
         myAlert("order", "");
     }
  }

Bewerbungen

1
Entwickler 1
Bewertung
(192)
Projekte
232
30%
Schlichtung
1
100% / 0%
Frist nicht eingehalten
9
4%
Frei
2
Entwickler 2
Bewertung
(139)
Projekte
181
24%
Schlichtung
23
22% / 39%
Frist nicht eingehalten
13
7%
Frei
3
Entwickler 3
Bewertung
(171)
Projekte
194
11%
Schlichtung
37
38% / 35%
Frist nicht eingehalten
5
3%
Beschäftigt
4
Entwickler 4
Bewertung
(204)
Projekte
209
28%
Schlichtung
0
Frist nicht eingehalten
3
1%
Frei
5
Entwickler 5
Bewertung
(188)
Projekte
212
58%
Schlichtung
9
11% / 89%
Frist nicht eingehalten
8
4%
Frei
6
Entwickler 6
Bewertung
Projekte
0
0%
Schlichtung
0
Frist nicht eingehalten
0
Frei
7
Entwickler 7
Bewertung
(126)
Projekte
151
48%
Schlichtung
6
83% / 17%
Frist nicht eingehalten
2
1%
Frei
8
Entwickler 8
Bewertung
(54)
Projekte
53
17%
Schlichtung
7
0% / 100%
Frist nicht eingehalten
5
9%
Frei
9
Entwickler 9
Bewertung
(33)
Projekte
49
12%
Schlichtung
16
0% / 88%
Frist nicht eingehalten
10
20%
Frei
10
Entwickler 10
Bewertung
(66)
Projekte
143
34%
Schlichtung
10
10% / 60%
Frist nicht eingehalten
26
18%
Frei
11
Entwickler 11
Bewertung
(261)
Projekte
425
38%
Schlichtung
86
44% / 19%
Frist nicht eingehalten
71
17%
Beschäftigt
12
Entwickler 12
Bewertung
(23)
Projekte
45
20%
Schlichtung
24
29% / 46%
Frist nicht eingehalten
12
27%
Frei
13
Entwickler 13
Bewertung
(56)
Projekte
75
44%
Schlichtung
21
14% / 67%
Frist nicht eingehalten
8
11%
Arbeitet
14
Entwickler 14
Bewertung
(2441)
Projekte
3076
66%
Schlichtung
77
48% / 14%
Frist nicht eingehalten
340
11%
Frei
15
Entwickler 15
Bewertung
(769)
Projekte
1033
44%
Schlichtung
50
8% / 50%
Frist nicht eingehalten
117
11%
Frei
16
Entwickler 16
Bewertung
(22)
Projekte
30
20%
Schlichtung
8
63% / 13%
Frist nicht eingehalten
9
30%
Frei
17
Entwickler 17
Bewertung
(87)
Projekte
114
26%
Schlichtung
7
29% / 57%
Frist nicht eingehalten
5
4%
Frei
18
Entwickler 18
Bewertung
(48)
Projekte
80
28%
Schlichtung
8
75% / 13%
Frist nicht eingehalten
41
51%
Frei
19
Entwickler 19
Bewertung
(7)
Projekte
8
63%
Schlichtung
1
0% / 100%
Frist nicht eingehalten
1
13%
Frei
20
Entwickler 20
Bewertung
(33)
Projekte
46
59%
Schlichtung
0
Frist nicht eingehalten
6
13%
Frei
21
Entwickler 21
Bewertung
(564)
Projekte
933
47%
Schlichtung
302
59% / 25%
Frist nicht eingehalten
125
13%
Beschäftigt
Ähnliche Aufträge
I have a indicator, mql file. The signals are seen below on a EURNZD H1 chart. Very important to get accurate entries. The signal to trade is the first tic after the the indicator signal paints. I've tried to demonstrate that below. Other than that the EA will have a lot size escalation, an on-screen pip counter, a button to stop taking new trades, SL/TP, and magic number. I would like the indicator to be within the
I would like to create an EA based on the Shved Supply and Demand indicator. you can find the Shved Supply and Demand v1.7 indicator in the following link https://www.mql5.com/en/code/29395 NB: Checks the trading robot must pass before publication in the Market ( https://www.mql5.com/en/articles/2555 ) MQ5 file to be provided
Hi Guys, I am looking to someone that can generate an indicator for MT4 as explained below. Basically I would need that the indicator point out the price that will close my position in stop out/margin call. The indicator should pick automatically the level of trade out for the broker (which can be different from a broker to another broker) It should write (ideally on the bottom on the left) the following information
Mbeje fx 50+ USD
I like to own my robot that why I want to build my own.i like to be a best to every robot ever in the life to be have more money
I need an MT5 EA that can do the following: I have to give the EA a price in advance, when the price is reached the EA has to automatically place a buy stop or sell stop order 0.5 pips below or above the price. Is this possible
Good day, I want someone to help me create a universal news filter with on/off switch, with start and end settings, and drawdown control with magic number of EAs, etc. Thanks
Hello, I am looking for a professional programmer to optimize my existing EA integrating it with ChatGPT to analyze currencies using various methods to make the right trading decisions. i want it to be an EA that can be trusted to carry trade with the help of chat gpt and also have a very low drawdown
Hello, I am looking for a professional programmer to create a trading expert on the MT4 platform, integrating it with ChatGPT to analyze currencies using various methods to make the right trading decisions. Further details will be provided to the applicants later
I am looking for an experienced MQL5 developer to help me finalize and optimize an Expert Advisor (EA) for the FTMO challenge. I have already built a significant portion of the code, but it requires further refinement and optimization to ensure it functions according to the trading strategy I intend to use. I am happy to share all the resources, including the current code, reference materials, and detailed
dreams good and have a great Cash out from your smart phone , tuyoywuiy glamorous flood see full idk idk slow so dolls stupid sis workouts who's spark koalas oral waits also doggo idk

Projektdetails

Budget
100+ USD
Für die Entwickler
90 USD
Ausführungsfristen
bis 1 Tag(e)