I ran the indicated code, worked fine.
#property strict void OnStart() { double B,val1=0; for (int i=0; val1==0; i++) //I want this instead (int i=histoupcount; val1==; i--) but crashes MetaTrader { val1=iFractals(NULL, 0, MODE_UPPER, i); B = val1; if(B!=0) { Print(B, " B high Located ",i); // testscr USDSGD,Daily: 1.4005 B high Located 6 //Print(A); return; } }
Use the debugger or print out your variables, including _LastError and prices and find out why. Do you really expect us to debug your code for you?
Code debugging - Developing programs - MetaEditor Help
Error Handling and Logging in MQL5 - MQL5 Articles (2015)
Tracing, Debugging and Structural Analysis of Source Code - MQL5 Articles (2011)
Introduction to MQL5: How to write simple Expert Advisor and Custom Indicator - MQL5 Articles (2010)
Thanks
I do not get any debugging output or errors found in the debugger.
Switching time frames makes MetaTrader (not responding)
I do not understand the crash with no errors or debug info.
I do not get any debugging output or errors found in the debugger.
Switching time frames makes MetaTrader (not responding)
I do not understand the crash with no errors or debug info.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
In this code I am count back bars for the MACD true indicator (iCustom) etc etc.
I use these bar count to initialize i in parts of the code. This locks up the EA and Metatrader stops responding.
How to diagnose this or perhaps someone can explain why ?
Thanks
See code below with highlighted comments that crashes Metatrader.
Please advise
Thanks