Code for sending orders on opening of new bar

MQL4 Experts Consultation Forex

Specification

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.

Responded

1
Developer 1
Rating
(87)
Projects
134
14%
Arbitration
41
22% / 29%
Overdue
14
10%
Free
2
Developer 2
Rating
(192)
Projects
232
30%
Arbitration
1
100% / 0%
Overdue
9
4%
Free
3
Developer 3
Rating
(1088)
Projects
1439
45%
Arbitration
49
71% / 12%
Overdue
35
2%
Working
4
Developer 4
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
5
Developer 5
Rating
(1)
Projects
0
0%
Arbitration
2
0% / 100%
Overdue
0
Free
6
Developer 6
Rating
(2)
Projects
3
0%
Arbitration
1
0% / 100%
Overdue
0
Free
7
Developer 7
Rating
(2423)
Projects
3045
66%
Arbitration
77
48% / 14%
Overdue
340
11%
Free
8
Developer 8
Rating
(4)
Projects
4
0%
Arbitration
1
0% / 100%
Overdue
1
25%
Free
9
Developer 9
Rating
(253)
Projects
408
38%
Arbitration
86
43% / 19%
Overdue
70
17%
Working
10
Developer 10
Rating
(87)
Projects
114
26%
Arbitration
7
29% / 57%
Overdue
5
4%
Free
11
Developer 11
Rating
(26)
Projects
34
26%
Arbitration
7
14% / 43%
Overdue
7
21%
Free
12
Developer 12
Rating
(126)
Projects
151
48%
Arbitration
6
83% / 17%
Overdue
2
1%
Free
13
Developer 13
Rating
(66)
Projects
143
34%
Arbitration
10
10% / 60%
Overdue
26
18%
Free
Similar orders
Hello, I am looking for a highly skilled and experienced MT4 developer to assist with transferring a strategy currently coded in Pine Script to MetaTrader 4 (MT4). The project requires a professional who can handle this project successfully. I am looking for a dedicated and professional developer who can deliver high-quality results. If you have any questions or need further details about the project, feel free to
Hello, I am looking for a highly skilled and experienced MT5 developer to assist with modifying an existing MT5 file. I am looking for a dedicated and professional developer who can deliver high-quality results. If you have any questions or need further details about the project, feel free to reach out. Thank you for your time and consideration. I look forward to working with the right expert to bring this project to
We are looking for an experienced coder to develop a trading robot that utilizes two main indicators: 1) Brain Trend Signal 2) TMA (Triple Moving Average) Centered Bands. The robot should generate buy and sell signals based on specific conditions and include robust risk management features. Initial Requirements - **Indicators**: 1. Brain Trend Signal 2. TMA Centered Bands - **Timeframes**: - H4/D1 for trend
1. Combination of Market Profiles on daily basis a) this should be combined if the bell curve is similar to the previous day. Rotational day (volume - standard deviation). b) If breakout, new range should be drawn Conclusion: Market profile should be combined on daily after the market is closed 2. Use Vwap indicator, with 0.5 - slow trend, 1.0 - normal trend, 1.5 fast trend. The stop loss should be under the trend
hi this is a question regarding your telegram to metatrader copier. if i buy the premium/lifetime will it work on unlimited accounts? or will you lock in in an account
Hello, I'm looking for an MQL5 developer that can create an MQL5 code that can accurately mark the following: 1. Swing Break of Structure using Horizontal Ray 2. Internal Break of Structure using Horizontal Ray 3. Extreme Supply and Demand zones using Rectangle 4. Decisional Supply and Demand zones using Rectangle 5. Breaker Block zones using Rectangle 6. Buy to sell wick zones using Rectangle 7. Sell to buy wick
Make a 10000 plus script trading Expert advisor with detail and make it flawless with no errors no tiny mistakes and make it in mql 5 language. Make it adjustable for it to be able to trade on its own and not be disturbed and make it study the chart and be able to trade any currency pair. I have zero experience and I would just like to copy and paste the code in MetaTrader. Can you make it be compatible with both
I need a trading bot, My strategy works with the 1hour timeframe .My stop-loss should be put using Atr of the candle multiply by 1.5 then the value will be added or subtracted from my entry depending on if it's a buy or sell and my entry should be a candlestick pattern also in addition to when the 3 Ema corresponds .When the 8Ema is above the 20Ema and they are both above the 100Ema it is a buy and when the 20Ema is
Looking to create EA for forex tradding with strategy as per price action, where order get excuted with proper stop loss and take profit. and order size should change as per privious trade result
Hello I need a simple heiken ashi candle indicator created . The difference I would like the I indicator to show more candles I know the heiken ashi candle open use the previous days open, close but I would like it to show more candles . So basically say if the previous candle is red the open heiken ashi should be coded using previous days open,close and low / 3. It Sound confusing but all im trying to do is get more

Project information

Budget
48+ USD
For the developer
43.2 USD
Deadline
from 1 to 3 day(s)