@polwes This is certainly an ambitious project. Before moving on I strongly recommend you to use a custom indicator to identify 1,2,3 structures on chart. That would be a much easier way to create your EA. You can find some of them for free on mql5.com.