how is it possible that an expert advisor be coded to do the following: buy when the price trend is going up and sell when its going down. (this is only a part of my ea plan)

 
how is it possible that an expert advisor be coded to do the following: buy when the price trend is going up and sell when its going down. (this is only a part of my ea plan)
 

Your question is unclear.
Have you tried anything? How do you identify the price trend? What are your buy/sell signals? Do you have any specific issues with your code?

 
tafadzwa: how is it possible that an expert advisor be coded to do the following:..
It possible when a human codes it. Since there are no slaves here, 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 and the nature of your problem.
 
tafadzwa:
how is it possible that an expert advisor be coded to do the following: buy when the price trend is going up and sell when its going down. (this is only a part of my ea plan)
What is your definition of a trend ?  define that first then it is possible for you to code it.
Reason: