Please attach your file using the button
Topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I have moved your topic to the MQL4 and Metatrader 4 section.
Topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I have moved your topic to the MQL4 and Metatrader 4 section.
My custom indicator looks similar to this it has 3 bands, and i am trying to code EA to set long position if bar close price crosses middle band up or is above middle band, but below upper band
I tried different logic in my if statement with no luck. closest results i got is with current code where i get signal if price close is above middle line, but i also get signal if price close is above upper line, which is not good.Can you please help me?
if(Close[0] > band_middle_curr && Close[0] < band_up_curr)
Try something like that,
Use close[1] instead of close[0]
Try something like that,
Use close[1] instead of close[0]
- www.mql5.com
I have deleted your new topic which is about the same EA but with additions.
Get this issue correct before expanding the code.
Hi, i have tried, but no... it triggers long signal when the bar close is above upper line, and it sould trigger only if the bar close is below the upper line
Show your modified code.
Show your modified code.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
My custom indicator looks similar to this it has 3 bands, and i am trying to code EA to set long position if bar close price crosses middle band up or is above middle band, but below upper band
I tried different logic in my if statement with no luck. closest results i got is with current code where i get signal if price close is above middle line, but i also get signal if price close is above upper line, which is not good.Can you please help me?