Before you begin to code your EA, do you have a deep understanding on how the MetaTrader Strategy Tester works?
Why do you need to understand how it works? After you have coded your EA, you need to back test to see if it performs accordingly to your strategy right?
Well, if you have not read up on it, I suggest that you read up these links provide before you venture into the world of EA.
Testing Trading Strategies
The Algorithm of Ticks’ Generation within the Strategy Tester of the MetaTrader 5 Terminal
Creating Custom Criteria of Optimization of Expert Advisors
Some food for your thoughts
Order Strategies. Multi-Purpose Expert Advisor
Have a good time reading.