References to closing an open order when conditions are met strategic points.

 
I am writing my first code and ask, is there any reference to code a " Close an Order When conditions are Met. " An example would be when a open order reverses and meets a moving average ! Thanks to any help. 
 
in your expert folder you have 2 EA examples use them and modify its code for your needs
 
Hi - Taking out the elements that i would need to build into my ea are not straight forward for me at the moment and really need some more specific examples also examples in the code base don`t meet the new compilation property strict so nothing seems straight forward ! 
 
ok - here you have plenty of examples.