- Why did you post your MT4 question in the Root / MT5 EA
section instead of the MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Next time post in the correct place. The moderators will likely move this thread there soon. - Stop looking at bar zero. (multiple crosses.)
- Look at the start of a new bar.
For a new bar test, Bars is unreliable (a refresh/reconnect can change number of bars on chart,) volume is unreliable (miss ticks,) Price is unreliable (duplicate prices and The == operand. - MQL4 programming forum.) Always use time.
I disagree with making a new bar function, because it can only be called once per tick. A variable can be tested multiple times.
New candle - MQL4 programming forum - Why are you looking at the D1 instead of the current TF.
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
Hi all, I am really new to mql4, coming from NT world.
I downloaded a custom indicator which plots 2 lines (white and blue).
All I want my EA to do is to go long when white crosses blue and go short when blue crosses white. However, I want it to be done only if cross happens after the one-day candle is formed (if cross happens while candle is forming it does not count, cross must be there on the chart).
I wrote this simple EA, but it gives me totally random signals, not even close to indicator line crosses. I tried to figure out all day long today, but no luck. Hope you can help.
Below are the codes for indicator and for EA. They are also attached:
INDICATOR:
EA: