(this is an old topic but ... posting for beginners )
Simple Sample Exmple EA - to understand how to draw Trendline and use it to open trade in an EA ( for beginner someone like me )
Use this example only with Demo account and to learn how it is working. I am not responsible for your money losses.