-
Your function only works for a single symbol/timeframe. You can never use it with more than one.
detecting a new bar without removing ability to detect tick in multiple timeframe - Easy Trading Strategy - MQL4 programming forum #8 (2021.08) -
On MT4: Unless the current chart is that specific symbol(s)/TF(s) referenced, you must handle 4066/4073 errors before accessing candle/indicator values.
Download history in MQL4 EA - MQL4 programming forum - Page 3 #26.4 (2019)
-
Your function only works for a single symbol/timeframe. You can never use it with more than one.
detecting a new bar without removing ability to detect tick in multiple timeframe - Easy Trading Strategy - MQL4 programming forum #8 (2021.08) -
On MT4: Unless the current chart is that specific symbol(s)/TF(s) referenced, you must handle 4066/4073 errors before accessing candle/indicator values.
Download history in MQL4 EA - MQL4 programming forum - Page 3 #26.4 (2019)
Thank you! I agree, I can only used for one symbol and one timeframe, still, if I want to detect new daily candle while my EA is loaded on a 5 min timeframe, it is not working every time. But if I load the EA on a daily timeframe, it works.
Hello Guys!
I have also a question which is also time related.
So I have the following newbar function:
This function works if I used it for any other period except daily. If trying to detect new Daily candle it is not working every time.
I use this function on a EA which I load it on 5 Min timeframe.
Kindly advice!
Hello,
Try using this function:
datetime curbar; datetime lastbar; bool new_bar(string symbol,ENUM_TIMEFRAMES periods) { curbar=(datetime)SeriesInfoInteger(symbol,periods,SERIES_LASTBAR_DATE); if(lastbar==0) lastbar=(datetime)SeriesInfoInteger(symbol,periods,SERIES_LASTBAR_DATE); if(lastbar!=curbar) { lastbar=curbar; return(true); } return(false); }
Help you with what? You haven't stated a problem, you stated a want.
How To Ask Questions The Smart Way. (2004)
Prune pointless queries.
You have only four choices:
-
Search for it (CodeBase or Market). Do you expect us to do your research for you?
- Beg at:
- Coding help - MQL4 programming forum
- Make It No Repaint Please! - MQL4 programming forum
- MT4 to MT5 code converter - MQL5 programming forum
- Please fix this indicator or EA - General - MQL5 programming forum
- Requests & Ideas (MQL5 only!) - Expert Advisors and Automated Trading - MQL5 programming forum
- Indicator to EA Free Service - General - MQL5 programming forum
-
MT4: Learn to code it.
MT5: Begin learning to code it.If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into your code.
-
Or pay (Freelance) someone to code it. Top of every page is the link Freelance.
Hiring to write script - General - MQL5 programming forum (2019)
We're not going to code it for you (although it could happen if you are lucky or the problem is interesting.) We are willing to help you when you post your attempt (using CODE button) and state the nature of your problem.
No free help (2017)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello Guys!
I have also a question which is also time related.
So I have the following newbar function:
This function works if I used it for any other period except daily. If trying to detect new Daily candle it is not working every time.
I use this function on a EA which I load it on 5 Min timeframe.
Kindly advice!