Winners786:
Hello Friends,
I am new to mql4 coding and learning from past 2 months.
I am trying to code MA cross counter. If MA50 cross above MA1000 then BUY CROSS =1 and same for below.
But the issue is Cross Counter increased by 1 on every tick.
Below is code. Please help me with this.
Thanks in Advance.
You need to hold back calculation until new bars are formed... add these lines before your "MyPoint=SetPairPipValue(Symbol());":
static datetime lastBarTime = 0; datetime currBarTime = iTime(Symbol(),Period(),1); if (currBarTime==lastBarTime) return (0);And
lastBarTime = currBarTime;
Before the final "return (0);".
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
Hello Friends,
I am new to mql4 coding and learning from past 2 months.
I am trying to code MA cross counter. If MA50 cross above MA1000 then BUY CROSS =1 and same for below.
But the issue is Cross Counter increased by 1 on every tick.
Below is code. Please help me with this.
Thanks in Advance.