Open one order, when MAs intersect and close it, the next trade will be open in next MAs intersect

 

Can somebody help me, how can I write the code, because I am beginner of programming in mql.

In My strategy are two Simple Moving Average and Average Directional Movement Index.

I want open buy, when SMAB>SMAR && PlusDI>MinusDI && ADX>ADXLevel

And I close it on TakeProfit or Stoploss. If the buy closed, I want wait to open sell, NO open next order buy.

When MAs intersect I want open only one trade to next MAs intersect.

I don't know, how can I continue with programming.

Thank you very much!

Files:
script.ex4  10 kb
 
https://book.mql4.com/practice
 
You have only three choices: Search for it, learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
Reason: