Exact moment when the rule triggers
I’ve attempted to build many EAs that would theoretically be profitable to a certain level, but have failed.
Sometimes I think the problem is the moment when the rule trigger goes off. I need to understand better how it works.
So for example, I use two indicators with the rule “Crosses Above” to go Long, and the inverse rule to go Short, that is “Crosses Below”. The used offset is 1.
When either rules trigger, I set it to close the opposite open position.
– Does the rule triggers the exact moment that the cross above occurs, or does it triggers only at the next bar open after it crosses?
– What if both rules are met at the same candle, for say, first it goes above and then it goes below, what happens?
Now using the same example as above but with offset 0. How does it behave?
If you do MA cross with 0 then once MAs are crossed during creation of a bar (intrabar) then EA opens a position – this can be seen with ‘every tick’ test in MT4
If you do MA cross with 1 then it waits while bar closed with MAs crossed and then opens a position (on next bar open basically)
Thank you Tomas. Your information helped.
I once tested with offset 0 on other type of situation (not crossing over rules) and by then I noticed strange behavior, but I can’t recall exactly what. It was a while ago on earlier version. I hadn’t tested offset 0 ever since.
Now I’ve ran a few tests with 0, and it actually looks better. EA is showing better results.
But there is another concern. I won’t have a reliable test on MT4 because the testing environment, as far as I know doesn’t check the fluctuation of the price on a candle. It doesn’t simulate the exact reality of the price fluctuation. This is because my trigger relies on the live signal output and not on what happened on earlier candles.
Do you know a way to do more reliable tests with all the ticks within a minute?
From what I know you can get reliable results with MT4 backtest but you have to use ‘every tick’ precision for backtesting. This way you will get fills even inside minute bars as soon as moving averages cross for example. See screen attached.
Yes you are correct.
But with MT4, the most precision you can get is by the minute, I think.
The most precise historical data that you can feed in for testing, is of 1M timeframe and not more accurate than that. You then convert to the desired timeframe. This will provide the most tick information possible, but the 1M timeframe doesn’t include the ticks that occur within the minute.
We would need to get tick-precision historical data, and then convert it to 1M. I know there are ways, but not so simple.
Anyway, thank you for the help.
Viewing 5 posts - 1 through 5 (of 5 total)