Code for sending orders on opening of new bar

İş Gereklilikleri

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.

Yanıtlandı

1
Geliştirici 1
Derecelendirme
(87)
Projeler
134
14%
Arabuluculuk
41
22% / 29%
Süresi dolmuş
14
10%
Serbest
2
Geliştirici 2
Derecelendirme
(192)
Projeler
232
30%
Arabuluculuk
1
100% / 0%
Süresi dolmuş
9
4%
Serbest
3
Geliştirici 3
Derecelendirme
(1095)
Projeler
1451
45%
Arabuluculuk
49
73% / 12%
Süresi dolmuş
36
2%
Serbest
4
Geliştirici 4
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
5
Geliştirici 5
Derecelendirme
(1)
Projeler
0
0%
Arabuluculuk
2
0% / 100%
Süresi dolmuş
0
Serbest
6
Geliştirici 6
Derecelendirme
(2)
Projeler
3
0%
Arabuluculuk
1
0% / 100%
Süresi dolmuş
0
Serbest
7
Geliştirici 7
Derecelendirme
(2429)
Projeler
3060
66%
Arabuluculuk
77
48% / 14%
Süresi dolmuş
340
11%
Çalışıyor
8
Geliştirici 8
Derecelendirme
(4)
Projeler
4
0%
Arabuluculuk
1
0% / 100%
Süresi dolmuş
1
25%
Serbest
9
Geliştirici 9
Derecelendirme
(257)
Projeler
419
38%
Arabuluculuk
86
44% / 19%
Süresi dolmuş
72
17%
Meşgul
10
Geliştirici 10
Derecelendirme
(87)
Projeler
114
26%
Arabuluculuk
7
29% / 57%
Süresi dolmuş
5
4%
Serbest
11
Geliştirici 11
Derecelendirme
(26)
Projeler
34
26%
Arabuluculuk
7
14% / 43%
Süresi dolmuş
7
21%
Serbest
12
Geliştirici 12
Derecelendirme
(126)
Projeler
151
48%
Arabuluculuk
6
83% / 17%
Süresi dolmuş
2
1%
Serbest
13
Geliştirici 13
Derecelendirme
(66)
Projeler
143
34%
Arabuluculuk
10
10% / 60%
Süresi dolmuş
26
18%
Serbest
Benzer siparişler
AllForexEA 30+ USD
Algorithm - from which order the drawdown reduction algorithm is activated. - Percent profit for DD Reduction Algoritm - percentage of profit when closing orders in the drawdown reduction mode. - Magic - is a special number that the EA assigns to its orders. - Fix distance - fixed distance between orders (default 250 - in points) - Order dinamic distance - from which order will the
I need two trading view indicators to be on Mt4 .i want them to work the same way that they do on trading view if possible.i will send the indicators
Function (A) simple to do___________________________________________________ //+------------------------------------------------------------------+ //| Expert Tick Function | //+------------------------------------------------------------------+ void OnTick() { F1(); F2(); F3(); } //+------------------------------------------------------------------+ bool F1(){ extern bool F1(); Set to external (false) or (true)
Ok 30+ USD
thacksc d trttt rtrt in super market fddf dghfg tdhdthdt gdydtydt jnjnjndf gd gdfg dgd gd t rt r te tr sf fdsffsdgs g dfg dg d dfh f hfh dh d hd fh dh dt y ty dry dr td ryd ddry
hi , i am looking for a Grid EA with some basic type of EA but fully functional and final one. so anyone who can do perfect EA should contact. plan is discussed as below. start and end time, and days of active deactive button should be added in dashboard or else like if we want to close EA for any future day or days in coming week so before time we should be able to set. when EA starts. it opens one buy or sell and
Busco crear un indicador que marque todos los Order Blocks en una temporalidad concreta. Quiero que distinga order blocks tocados de los no tocados, que se pueda configurar color y estética del Ordee block y Que marque el 50% de los Ordwr blocks marcados
Hi, I would Like an EA ORDER PANEL for MT5 which allows me to place limit orders . The only addition I would like compared to other order panels, is an o ption to place a reversal trade if the original idea is stopped out. For example: I place a Short trade at 1.2120 with a 20 pip Stop Loss and a 100 pip target IF the SL is hit, then I want a Long trade to be place at 1.2120 with the same size SL and TP (20pip and
I need the following modules as per this sample indicator, then integrated with RSD Candles. look into the sample input settings, ................................................. ......................................................................................................... .......................................................................................................... ................previous
hello everyone I need to create an ea that creates signals based on the indicator on trading view and transmits it directly to mt5, so that the signals are created on trading view and orders are opened in mt5
Create a basic EA with 2 indicators and 3 conditions with stop loss and trailing stops. The lot size is one full lot, 1.0 EUR/USD, 100,000 Euros and stated clearly in the code

Proje bilgisi

Bütçe
48+ USD
Geliştirici için
43.2 USD
Son teslim tarihi
from 1 to 3 gün