I friendly recommend you to start you programming study with more simple examples (indicators, macros, custom columns) - strategy is an automated indicator(or them conjunction) tied by specific logic and which can trade. Thereby it has the highest level of script's difficulty ladder.
Sorry, your code isn't correct. My recommendations to make it work are next:
1. To check some signals on the crossing you have to check all start/end points for both lines/signals (it's a pure math question).
2. The crossing must be checked on next bar appearing. Then you will check already happened crossing (just logic question).
3. You have to define what reaction you want and after that - place trade logic in NextBar() or OnQuote() method (design question).
"I do not understand very well, because I am a beginner...to learn to program...How can I do it? Because he does not understand what he is"
The working code will be some kind of disservice on your way. You will gain more practice and programming skills by exploring Holt's EMA EA example from our code base.
PTMC is a professional trading platform that combines all the best charting and analytical tools to trade on different financial markets. It is developed by PFSOFT UK LTD, a global provider of trading technology for banks & brokers