Great start! I have to admit, I'm glad you raised your hand on this one. I had started to work on it, but was having trouble deciding which direction to go (forward or backwards). I think I settled on going backwards through the data (starting with current bar) and trying to see if you have a C first. If you have a C, you have the whole thing.youcrazykids wrote:Hi Meiloo
I've written a detection routine for the XABC formations you described, using the rules you outlined.
I spent time today refining the code - here's a screenshot of what I've seen today from 06:00 to 17:00 GMT (ignore the trade lines on the chart).
Green letters indicate points of a possible/emerging XABC formation, with a view to trading LONG.
Red letters indicate points of a possible/emerging XABC formation, with a view to trading SHORT.
I think the best formations that appeared so far were LONG XAB (not the full XABC) at 07:30 and 10:20, and SHORT XAB at 15:20.
Can you confirm whether or not you saw any C points today? If I relax the detection rules, they start appearing, but not otherwise. Please take a look, and tell me if this looks like a good start, or if more refinement is needed.
Thanks
youcrazykids
Pseudo Code:
Is Current bar a local high or local low (it has to have the highest high or lowest low in the last 9 bars)?
{assume we have a local low for the rest of the tests, reverse for local high}
Is the previous local low (previous 9 bars) within 1-3 pips of our current low and did it occur 5-9 bars ago?
Is the local high between our current bar and whichever bar was the previous local low > 10 pips away?
Is the previous local low still the lowest value as we step back in time until the range from the previous local low to the high of the stepping back bar > 30? {I could probably say that better :>)
If we made it this far, we know we have a valid setup. Well, I think we do.
George