- my code is not generating the correct ATR signals, can anyone help me in finding the error?
- MQL4 Learning
- Open parenthesis expected
We cannot help you with generated code. If you don't know how to code yourself, how are you to understand and implement any advice we give you?
Have your code generated by a human, not a machine, or take some time to learn to code yourself.
EDIT: By the way, the generated code is mostly MQL4 and will not work on MQL5.
- You got what you paid for.
EA builder, EA Builder Pro, EATree, Etasoft forex generator, Forex Strategy Builder, ForexEAdvisor, ForexRobotAcademy.com, FX EA Builder, fxDreema, Forex Generator, FxPro, Molanis, Octa-FX Meta Editor, Online Forex Expert Advisor Generator, Strategy Builder FX, Strategy Quant, Visual Trader Studio, MQL5 Wizard, etc., are all the same. You will get something quick, but then you will spend a much longer time trying to get it right, than if you learned the language up front, and then just wrote it.
-
Since you haven't learned MQL4/5, therefor 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 yours.
We are willing to HELP you when you post your attempt (using Code button) and state the nature of your problem, but we are not going to debug your hundreds of lines of code. You are essentially going to be on your own. EA builder makes bad code: - Counting up while closing multiple orders.
- Bars is unreliable (Max bars in chart), volume is unreliable (miss ticks.) Always use time.
- Not adjusting for 4/5 digit brokers, TP/SL and slippage.
- Not adjusting for ECN brokers. pre-Build 500)
- Not checking return codes.
EATree uses objects on chart to save values — not persistent storage (files or GV+Flush.) No recovery (crash/power failure.) FX EA Builder makes bad code: - Not checking return codes.
- Loosing open tickets on terminal restart. No recovery (crash/power failure.)
- Not adjusting stops for the spread.
- Using OrdersTotal directly.
FOREXEADVISOR STRATEGY BUILDER makes bad code: - Non-updateing global variables.
- Compilation errors.
- Not checking return codes.
ForexEAdvisor makes bad code: - Not checking return codes.
- Not reporting errors.
Learn to code it, or pay someone (Freelance) someone to code it.
Hiring to write script - General - MQL5 programming forum #1 (2019) -
-
for (int i = 0; i < rates_total; i++) { if (time[i] >= TimeCurrent() - TimeDay() && time[i] < TimeCurrent()) { MidnightOpenLine[i] = open[i]; } else { MidnightOpenLine[i] = EMPTY_VALUE; } }
MT5 does not have TimeDay(). Why did you post your MT4 question in the MT5 Indicators section instead of the MQL4 section, (bottom of the Root page)?
General rules and best pratices of the Forum. - General - MQL5 programming forum? (2017)
Next time, post in the correct place. The moderators will likely move this thread there soon. - Buffers are as-series. The arrays in OnCalculate are not.
To determine the indexing direction of time[], open[], high[], low[], close[], tick_volume[], volume[] and spread[], call ArrayGetAsSeries(). In order not to depend on default values, you should unconditionally call the ArraySetAsSeries() function for those arrays, which are expected to work with.
Event Handling Functions - Functions - Language Basics - MQL4 Reference -
Substracting a few seconds (TimeDay) off of TimeCurrent is meaniingless. You want to see if the bar is the first of that day; nothing to do with current time.
Find bar of the same time one day ago - MQL4 programming forum #1 & #6 (2017) -
You are drawing a line. That is visiable when you draw from one bar to another; you don't. You wanted a vertical line.
-
Why are you redrawing all bars each tick?
How to do your lookbacks correctly #9 — #14 & #19 (2016)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use