- THE 2007 TRADING CHAMPIONSHIP!
- My EA will not open a trade. What am I doing wrong??
- calling buy or sell order in Indicator?
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)
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)
William...mate....who is "us" that you are referring too.
Everybody else is giving an answer...or not...you are the only one very nasty and frustrated...don't know why...you don't want to help...please move on... We can live without you telling "us" useless tips... if you don't know what to answer...you don't have to say anything
A I was saying...EA is working fine with the other buy/sell conditions...but I have added the above condition, and EA is opening trades without taking into account the above condition. I have printed above ATR1 and ATR2 and is showing the values of this parameters, but still something is wrong- The "us" is the thousand people that read your post.
- No one else has answered you.
- Post all relevant code. Your non-input lines are without context; no idea whether those lines are inside a function or not.
- "Something is wrong" is meaningless — just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires — meaningless.
How To Ask Questions The Smart Way. (2004)
When asking about code
Be precise and informative about your problem
- The "us" is the thousand people that read your post.
- No one else has answered you.
- Post all relevant code. Your non-input lines are without context; no idea whether those lines are inside a function or not.
- "Something is wrong" is meaningless — just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires — meaningless.
How To Ask Questions The Smart Way. (2004)
When asking about code
Be precise and informative about your problem
1. You should live that thousand to answer...or not...there is no need for you to speak in their name
2. Yet...maybe someone will...
3. There is no need for the hole code...whatever you need is there...I called ATR twice...ATR1 and ATR2...with different periods...I have print this values and even if ATR1=0.0018 and ATR2=0.0025, and condition is <<Open trade if ATR1<ATR2>>, trade it is getting open also if ATR1>ATR2....and I don't understand why. Because I did the same thing with MA and it is working. I called MA twice with different periods, and buy trade will open only if MA(5)>MA(20)...for example...but with ATR it doesn't work
"
How To Ask Questions The Smart Way. (2004)"
I am Not that smart like you... I am asking questions the way I can. As long as I am not offending anyone this should be fine.
If the question is too stupid for you...as I said...move on to the next ... simple as that
and condition is <<Open trade if ATR1<ATR2>>, trade it is getting open also if ATR1>ATR2....and I don't understand why. Because I did the same thing with MA and it is working. I called MA twice with different periods, and buy trade will open only if MA(5)>MA(20)...for example...but with ATR it doesn't work
nobody can know what you tried with MA & nobody see your entire code with ATR... BTW, if you do not hesitate not only to demand for the answer on your very uncertain question but first to explore your problem yourself - you'll find many examples already discussed ... ? why don't you want to check ==INVALID_HANDLE & to work with GetLastError()); ...
p.s.
BTW, MA is a chart_indicator (all vars are measured in the same coordinates), ATR is a separate_window indicator (did you compare values of your ATRs yourself ? ) - N.B. you should compare values of indicators, not their handles, but getArrays... (learn examples at the link I've left)
Spent time to look through enormous number of examples TO TEST them & to provide more concrete question of your misunderstanding (with nonworking but Minimal Compilable code that reflects the problem)
- and you will be...
- 2020.09.17
- www.mql5.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use