A common base for all Cross-based strategies
MQL4 algorithmisations that work with Technical Indicators ( iOBV()
, iMFI()
et al ) in a separate window have to be also carefull about the independent Y-axis scaling-factors, these "lines" have.
Thus beware that saying lines cross or lines do not cross depends on "hidden" values of these coefficients ( sometimes fixed, sometimes adaptively modified in the background ).
A systematic problem with hot-[0]-end vs. all frozen-[1..] values
If you have already spent some time with MT4 MQL4
-code-base, you have already both a feel & some common-sense practice, how to handle the dualism of [0]
-candle close()
value. There are many issues while working within the hot (current) end of the TimeSeries and there might be some additional efforts needed so as to filter-out many "false-Crosses" that happen "during" the hot-end evolution, but do not mean a positive-detection for the strategy, as these artefacts disappear and do not remain as visible Cross after the hot-candle gets frozen once it becomes a part of "history" as aNewBarEVENT
passes and reversed-indices shift forwards.
A consistent & complete definition for a strategy algorithmisation
As depicted in your example, there are "almost-Cross-es", that are marked by a white circle + arrow, but there are also exactly analogous "almost-Cross-es", that are not marked.
There may be some reason for making a difference between these two groups.
MQL4 Robots ( a.k.a. EAs ) are very powerful beasts, working relentlessly 24/7/365, reacting to aMarketEVENT flow within a few nanoseconds, however they all remain as blind and deaf automatons, that do not see or feel what you have in mind once you "see" the lines on screen.
The EA simply does only what it has been pre-programmed to do.
So the precise description of what to do ( which also means what not to do ) is a key to the ExpertAdvisor automation of a success.
A best next step
Can you, please, specify ( rather in plain words than by a pseudo-syntax ) additional conditions, to clarify some other reasons, why some constellations were left without positive-detection markers?
How some Cross-based strategies' Projects may look like?
Without going into full details and risking a customer's NDA or intellectual rights infringement in general, let me show you a bit from a Cross-based Trading Strategy design, that was prepared, validated and developed under FSA/OOP methodology framework, to ensure both Backtesting also with a need to integrate MT4 Terminal/Strategy Tester with external computing grid and KBD-Terminal-IO controls.
