Fully functional expert adviser with trailing stop. Should not be used for trading as there are no entry/exit rules or any thing else!
You can choose to either to use a buy or a sell to demonstrate trailing stop function. This is a template for further development or whatever. Have fun ;)
A ready made expert adviser template to use for further development or use 'as is'ZigZag Based on Close Prices
The code is based on indicator ZigZag which is in-built in MT4. I have changed it so that it isn't calculated on highest Highs and lowest Lows, but instead uses highest Close and lowest Close of chart price history. See attached chart for differences: ZigZag (red) versus ZigZagClose (yellow).