Need help with code for adding market orders during trend

 
I've been looking for the last week to find some type of code to add market orders at regular intervals during the trend. I was wondering if there is anyone that has some code that will do this that i could use. I've been learning mql for awhile now....but i haven't found anything that i can learn from to do the code myself. Any help would be greatly appreciated! Marty
Reason: