Download MetaTrader 5

Experts: Expert Advisor Template with Trailing Stop

To add comments, please log in or register
Automated-Trading
Admin
108097
Automated-Trading  

Expert Advisor Template with Trailing Stop:

This is a template for Expert Advisor coders to decrease their coding time. It contain Trailing Stop, autolots (true or false) and function scanning previous candles to find the lowest and the highest order price in the past.

There is a lot more innovations to make it work better like buy, sell block or max orders opened on current symbol.

  • EaTemplate.mq4 contains my comments to show you how every line in my code works.
  • Clean_EaTemplate doesn't contain my comments.

Author: jacekdc

Mizan Sharif
36
Mizan Sharif  

Hallo Jacek D C,

Excellent template. I need it. Code base is lack of such an ideal template (I tested above 80 here). 

You did not put any magic number. I guess ticket is that. Am I right? If not can you add a magic number?

Thanks and regards,

 

Mizan Sharif 

AndPra
22
AndPra  

Hi JACEKDC

Can you please post your template including an example of a functional expert advisor, e.g. include MACD and Signal

(If MACD-Signal >0 then BUY, ...if <0 SELL, .....etc...) , because I don not know where to put the conditions BUY. SELL and the EXITS.

Thanks and Regards

AndPra 

Mizan Sharif
36
Mizan Sharif  

Hi Jacek D C

I tried to make it functional but could not. Experts coders don't need this template. Newbies like me need it. If you add a magic number and set an example as AndPra suggested that will be helpful.

Thanks and regards,

 

Mizan Sharif

AndPra
22
AndPra  

OK. It seems this template of JacekDC needs further work for the buy and sell blocks.

Let's talk instead about existing fully working templates. I have tried some of them and the best I could find was from   http://sufx.core.t3-ism.net/ExpertAdvisorBuilder/  You can enter this with setting "Custom" for indicators, set all options and you get a General Template. Then you can edit  this EA with Metaeditor setting your particular inputs. It works fine. You can set BUY and BUY CLOSE and SELL and SELL CLOSE.

Do you know any other template available that could be better or more complete in functions?

Regards

AndPra 

Expert Advisor Builder for MetaTrader 4
  • sufx.core.t3-ism.net
Expert Advisor Builder allows you to create Expert Advisor for MetaTrader 4 easily. *Please enable JavaScript. Add Strategy and input parameters. Input Order options. Click "Complete!" button. If you'd like to save/load your settings, click "Save"/"Load" button. What's New(18 Feb. 2012) 18 Feb. 2012 Removed the first...
Mizan Sharif
36
Mizan Sharif  

I found one template 'Universal EA' in this Codebase. Complete and functional. The coder uses most of the indicators, Magic number and trailing stop. Not profitable but ready for a tailor cut and profit making. Fine tuning the system may give a good profit.

Regards,

Mizan Sharif

AndPra
22
AndPra  

Yes Universal EA is OK. However I fear it has only BUY and SELL options (using sell as exit the buy as exit of sell ), do you think so?. I need an extra BUY EXIT (and SELL EXIT) code as in some cases exit has to be faster than e.g using sell as exiting the buy. I also need a template with the optional code A) to enter and exit a specific time of trade and B) also possible to select a limit for the variable spread of the broker when it gets high (higher spread during the day may ruin the results).

The issue with EA seems to be that good designed templates are not given for free. So, maybe a good programmer can get some (3-4) good different free EA from internet and combine their codes in one really multifunction general and universal template.  A last remark is that different templates with exactly all same inputs give different results, and this makes hard the selection (try for instance  http://sufx.core.t3-ism.net/ExpertAdvisorBuilder/  and another one, the  http://www.ForexEAdvisor.com  with same exactly inputs and criteria.

Thanks and Regards

 AndPra

Expert Advisor Builder for MetaTrader 4
  • sufx.core.t3-ism.net
Expert Advisor Builder allows you to create Expert Advisor for MetaTrader 4 easily. *Please enable JavaScript. Add Strategy and input parameters. Input Order options. Click "Complete!" button. If you'd like to save/load your settings, click "Save"/"Load" button. What's New(18 Feb. 2012) 18 Feb. 2012 Removed the first...
Mizan Sharif
36
Mizan Sharif  
AndPra:

Yes Universal EA is OK. However I fear it has only BUY and SELL options (using sell as exit the buy as exit of sell ), do you think so?. I need an extra BUY EXIT (and SELL EXIT) code as in some cases exit has to be faster than e.g using sell as exiting the buy. I also need a template with the optional code A) to enter and exit a specific time of trade and B) also possible to select a limit for the variable spread of the broker when it gets high (higher spread during the day may ruin the results).

The issue with EA seems to be that good designed templates are not given for free. So, maybe a good programmer can get some (3-4) good different free EA from internet and combine their codes in one really multifunction general and universal template.  A last remark is that different templates with exactly all same inputs give different results, and this makes hard the selection (try for instance  http://sufx.core.t3-ism.net/ExpertAdvisorBuilder/  and another one, the  http://www.ForexEAdvisor.com  with same exactly inputs and criteria.

Thanks and Regards

 AndPra

Nothing is free in the world.

I don't find anything better than the sites you mentioned here. I bookmarked these pages.

Thanks and regards,

Mizan Sharif 

 N.B. I just got one in this forum:http://articles.mql4.com/482.

Universal Expert Advisor Template - MQL4 Articles
  • www.mql5.com
Universal Expert Advisor Template - MQL4 Articles: automated trading systems
AndPra
22
AndPra  

You wrote:

 N.B. I just got one in this forum:http://articles.mql4.com/482.

 Yes, is fine but I think has only BUY and SELL and no specific BUY. SELL EXITS. I am now searching a piece of code to introduce selection of trading hours.

 Regards

AndPra

PS: Maybe we should start/open this "EA template discussion" in the Forum to get more readers. 

Universal Expert Advisor Template - MQL4 Articles
  • www.mql5.com
Universal Expert Advisor Template - MQL4 Articles: automated trading systems
jacekdc
614
jacekdc  

Hello!

Im back from holidays. Thank you for comments. After reading all of them i decided to upgrade my template to make it short, compressed and fucntional. Also ill add simple working ea based on my template. Stay focus and have a nice trades :)

Regards

Jacek

jacekdc
614
jacekdc  
The work is done. New template is ready. Now we just need to wait for moderator check.
To add comments, please log in or register