Code for sending orders on opening of new bar

指定

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.

応答済み

1
開発者 1
評価
(87)
プロジェクト
134
14%
仲裁
41
22% / 29%
期限切れ
14
10%
2
開発者 2
評価
(192)
プロジェクト
232
30%
仲裁
1
100% / 0%
期限切れ
9
4%
3
開発者 3
評価
(1095)
プロジェクト
1451
45%
仲裁
49
73% / 12%
期限切れ
36
2%
4
開発者 4
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
5
開発者 5
評価
(1)
プロジェクト
0
0%
仲裁
2
0% / 100%
期限切れ
0
6
開発者 6
評価
(2)
プロジェクト
3
0%
仲裁
1
0% / 100%
期限切れ
0
7
開発者 7
評価
(2429)
プロジェクト
3060
66%
仲裁
77
48% / 14%
期限切れ
340
11%
仕事中
8
開発者 8
評価
(4)
プロジェクト
4
0%
仲裁
1
0% / 100%
期限切れ
1
25%
9
開発者 9
評価
(257)
プロジェクト
419
38%
仲裁
86
44% / 19%
期限切れ
72
17%
多忙
10
開発者 10
評価
(87)
プロジェクト
114
26%
仲裁
7
29% / 57%
期限切れ
5
4%
11
開発者 11
評価
(26)
プロジェクト
34
26%
仲裁
7
14% / 43%
期限切れ
7
21%
12
開発者 12
評価
(126)
プロジェクト
151
48%
仲裁
6
83% / 17%
期限切れ
2
1%
13
開発者 13
評価
(66)
プロジェクト
143
34%
仲裁
10
10% / 60%
期限切れ
26
18%
類似した注文
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

プロジェクト情報

予算
48+ USD
開発者用
43.2 USD
締め切り
最低 1 最高 3 日