Start with writing down, what you see in the chart. If you are shure you have all details (what is with gaps) pack all in a algorith and then you can start with coding.
If you have worked it out on a paper, you can compare it with your code.
I would have coded it otherwise, but i don't know what you want.
But if you prefer thinking and writing code at the same time, learn to use a debugger or print your variables.
If you have worked it out on a paper, you can compare it with your code.
I would have coded it otherwise, but i don't know what you want.
But if you prefer thinking and writing code at the same time, learn to use a debugger or print your variables.
- chipNdale: to check if previous 10 candles is not touching my SMA(18)Refine your requirement. A) not touching the SMA, or B) Above or below the current value of the SMA. B is what your code does.
- chipNdale: is there a debugger in MQ$
Have you bothered to hover over these buttons?
There is not only a debugger, there also is some information in the manual.
- chipNdale: to check if previous 10 candles is not touching my SMA(18)Refine your requirement. A) not touching the SMA, or B) Above or below the current value of the SMA. B is what your code does.
- chipNdale: is there a debugger in MQ$
Have you bothered to hover over these buttons?
Hi WhRoeder, thanks so much for responding I appreciate it. Below is my response. Will try to check the buttons thanks! And thanks in advance for bothering to understand me more I super appreciate it
Refine your requirement.
A) not touching the SMA, & B) Above or below the current value of the SMA. B is what your code does.
I need to assign a variable that checks for "noise" meaning if a price crosses above the sma I will only open a long position if the last 10 candles did not touch the sma
The other way around for short position, when it crosses the sma downwards I will only open a short position if the past 10 candles did not touch my SMA
- chipNdale: is there a debugger in MQ$
Have you bothered to hover over these buttons?
Hi WHRoeder,
Thanks for pointing me to the debugger, I found whats causing it not to work, I have declared my variables as INT instead of double good thing you showed me the debug function thanks so much!!

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi Guys,
I wanted to check with you guys if you can help me with a function that I can call to check if previous 10 candles is not touching my SMA(18) as I want to use it as another filter for the EA that I am working on something like below: