Download MetaTrader 5

My new Universal EA, come check it out.

To add comments, please log in or register
How to test a program before buying?
Patrick Cofflin
5549
Patrick Cofflin 2014.02.23 18:32 

I am an amateur coder and I am trying to make a good EA that is easy to use.

I'm trying to give back to the community since I have learned so much from this website and want to continue to learn.


I have created an EA that is very adjustable and easy to use. If you wish to download it the links are

<links removed by moderator>


Also I made some youtube tutorials on how to use them here

https://www.youtube.com/watch?v=ZKRzSfHMjpQ


Good luck and happy trading!


Patrick Cofflin,

p.a.cofflin@gmail.com

Patrick Cofflin
5549
Patrick Cofflin 2014.02.23 18:36  

Also you can download the EA from the attached file.


Good luck and happy trading!

Files:
Simon Gniadkowski
Moderator
17999
Simon Gniadkowski 2014.02.23 19:38  
pacofflin:

Also you can download the EA from the attached file.


Good luck and happy trading!


You should read these articles: What are Function return values ? How do I use them ? & Loops and Closing or Deleting Orders
Patrick Cofflin
5549
Patrick Cofflin 2014.02.23 20:00  

Thanks for the inputs Raptor, I am a new coder and learned from youtube videos and other EAs. My knowledge of loops is limited. I read your links and I learned some new things.

Is there some way I could make my loops better? Or maybe a more simple way to write the code?


You see I struggled a lot with the trade limiter because I tried using a time based loop and it just wouldn't work. My original code was this


{for(int i = 0 ; i < OrdersTotal() ; i++ )
{if( OrderSelect( i, SELECT_BY_POS, MODE_TRADES ) == false ) break;
if((OrderOpenTime()+TradeTimer)<TimeCurrent())
{if( OrderType() == OP_BUY)
Buy=false;
else if( OrderType() == OP_BUYSTOP)
Buy=true;}}}


Where you could adjust the variable TradeTimer to however many seconds you wanted the trading window to be open.

I'm not sure why it wouldn't work so I switched it to a Stochastic based trade limiter which worked like a charm.

Thanks for the help.

Patrick Cofflin
5549
Patrick Cofflin 2014.02.23 20:04  

So I should change


for(int i = 0 ; i < OrdersTotal() ; i++ )

to

for(int i = 0 ; i < OrdersTotal() - 1 ; i++ ) 
Patrick Cofflin
5549
Patrick Cofflin 2014.02.23 20:07  

No it should be

for(int i =OrdersTotal() - 1 ; i >=0 ; i++ ) 
Tjipke de Vries
6314
Tjipke de Vries 2014.02.23 20:11  
pacofflin:
So I should change for(int i = 0 ; i < OrdersTotal() ; i++ ) to for(int i = 0 ; i < OrdersTotal() - 1 ; i++ ) ?


No read What are Function return values ? How do I use them ? & Loops and Closing or Deleting Orders

looking is not enough read it for(int i = 0 ; i < OrdersTotal() - 1 ; i++ ) is not correct

also select right Symbol() and right MagicNumber

also why do you need every tick so many loops checking your trades

Patrick Cofflin
5549
Patrick Cofflin 2014.02.23 20:12  
Is
for(int i =OrdersTotal() - 1 ; i >=0 ; i++ )

or


for(int i =OrdersTotal() - 1 ; i >=0 ; i--)

better for closing a loop?

whroeder1
14480
whroeder1 2014.02.23 20:15  
pacofflin: No it should be for(int i =OrdersTotal() - 1 ; i >=0 ; i++ )
Correct and please:

Play video
Please edit your post.
For large amounts of code, attach it.
Patrick Cofflin
5549
Patrick Cofflin 2014.02.23 20:17  

Well deVries I did read it but I'm still trying to figure out where I messed up at.


My loops contain bool functions so each one has a different function and can be turned on and off using true or false values.


I wanted to add many different functions to give people the option to choose how they wanted to close their trades so that they could customize the EA to their own trading strategy. I created an EA that has many different variables and inputs so that anyone could adjust the numbers. The EA is a template for any system that you can think of that uses the indicators provided. I am trying to make it better so that people who use it don't have to mess with the code at all.

Patrick Cofflin
5549
Patrick Cofflin 2014.02.23 20:28  
WHRoeder:
Correct and please:

Play video
Please edit your post.
For large amounts of code, attach it.

Thanks for the info WHRoeder I was wondering how to add the code correctly.
123
To add comments, please log in or register