Code for sending orders on opening of new bar

MQL4 Experts Consultation Forex

Spécifications

I want my EA to perform the same on a live account with tick data than the performance I get when running it in the Strategy Tester under the "Open Prices" model.

That means when I run my normal EA under the Open Prices model in the Strategy Tester I get a certain result - and i want that result to be duplicated when i run the same EA with the code for opening trades at the opening of a new bar under the "every tick" model.

I understand that the following code does not achieve this objective:

bool IsNewCandle() {
   static datetime lastCandleTime;
   if (Time[0] == lastCandleTime) return false;
   lastCandleTime = Time[0];
   return true;
}
void OnTick() {
   if (IsNewCandle()) {
      // rest of logic goes here
   }
}

Please test this properly on a standard MT4  EA before submitting the code.

Répondu

1
Développeur 1
Évaluation
(87)
Projets
134
14%
Arbitrage
41
22% / 29%
En retard
14
10%
Gratuit
2
Développeur 2
Évaluation
(192)
Projets
232
30%
Arbitrage
1
100% / 0%
En retard
9
4%
Gratuit
3
Développeur 3
Évaluation
(1102)
Projets
1459
45%
Arbitrage
49
73% / 12%
En retard
36
2%
Gratuit
4
Développeur 4
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
5
Développeur 5
Évaluation
(1)
Projets
0
0%
Arbitrage
2
0% / 100%
En retard
0
Gratuit
6
Développeur 6
Évaluation
(2)
Projets
3
0%
Arbitrage
1
0% / 100%
En retard
0
Gratuit
7
Développeur 7
Évaluation
(2442)
Projets
3079
66%
Arbitrage
77
48% / 14%
En retard
340
11%
Gratuit
8
Développeur 8
Évaluation
(4)
Projets
4
0%
Arbitrage
1
0% / 100%
En retard
1
25%
Gratuit
9
Développeur 9
Évaluation
(261)
Projets
426
38%
Arbitrage
86
44% / 19%
En retard
71
17%
Chargé
10
Développeur 10
Évaluation
(87)
Projets
114
26%
Arbitrage
7
29% / 57%
En retard
5
4%
Gratuit
11
Développeur 11
Évaluation
(26)
Projets
34
26%
Arbitrage
7
14% / 43%
En retard
7
21%
Gratuit
12
Développeur 12
Évaluation
(126)
Projets
151
48%
Arbitrage
6
83% / 17%
En retard
2
1%
Gratuit
13
Développeur 13
Évaluation
(66)
Projets
143
34%
Arbitrage
10
10% / 60%
En retard
26
18%
Gratuit
Commandes similaires
Hi, i want you to code a simple 2 moving average crossover EA for MT5(MQL5). In settings i want to customize the both slow and fast MA Periods, Timeframe, Lots, Take Profit, Maximum stop loss, and trading starting and ending time in UTC. For Buy trades: Fast MA line should cross the Slow MA line from below and closes. If this happens, then place a buy stop order at high price of the crossing bullish candle with the
hello there I need a copy trade for mt4 can ANYONE help me with and let discuss on how to go about it kindly send me message to signify and let discuss mind you i need this urgently let connect to discuss and conclude
I would like the better volume indicator 1.6 in a scanner format. Scanning multiple timeframe and pairs of which can be picked. Would like it to provide all standard notifications and also if pressed to go to the a template timeframe and pair. *To be placed in a table format as the one added. To be able to add which time frame you want to see. *To advise me of the following Climax High - turn the text green High
i have a JavaScript of a code which is a indicator of trading view, i want to convert into python script and make a mql5 automated trading bot which can take automatic trade and also exit when the signals come by the indicator
I need to build EA MT4 that able to connect as copy trading between demo account to real account with partial of positions not all Example: If the demo account open position so the real account will be opened same position with ability to place different volume size based on real account equity and demo equity, and ability to choose which position should be copied, position one, two, three, four, five, six, seven
I would like an existing, older MT4 EA I had developed converted into an MT5 EA and debugged where necessary. The EA is attached and should be fairly self-explanatory. It is a breakout order entry EA with customisable parameters
I require an MT4 Expert Advisor (EA) that automatically places hedge orders when a buy or sell order is placed by me or another EA. The hedge orders will consist of a stop order (either Buy Stop or Sell Stop), with the same lot size as the original order, deployed at a predefined price distance. The EA must ensure that only one hedge order is placed for each trade. The system should monitor trades based on specific
For Chart Panel : Needs a Black Back ground at present its transparent . ✔️ Trading Panel (To be reset weekly = 1-6) 1. EA Status : (on/off) 2. Total Trades Taken : 3. Number of Profitable Trades Today : 4. Number of Loosing Trades Today : 5. Number of Profitable Trades This Week : 6. Number of Loosing Trades This Week : (To be Reset every Month = 7-9) 7. Number of Profitable Trades This Month : 8. Number of Loosing
my request is to convert a trading view indicator to mt4. I have a supertrend indicator for trading view or pine script. and all I want is to convert it for to mt4 or mql4
I have more detailed audio/ video attached Close All and restart = tru ___________________________________________ RULES EA MQL5 EA requirements below. MQ5 source code The EA must work in strategy tester with out any errors. The EA must be efficient, must execute trades quickly and not slow down if placed on many charts. require MQ5 source code when code is completed

Informations sur le projet

Budget
48+ USD
Pour le développeur
43.2 USD
Délais
de 1 à 3 jour(s)