Download MetaTrader 5
To add comments, please log in or register
They are already making profit from their signals. Publish your signal and join them!
Xavi
10
Xavi 2015.07.15 07:16 

Hi mql4 community!

As the subject says, I am an mql4 newbie and I would appreciate a lot if someone could point me in the right direction.

This is what I want to accomplish:

- An EA that opens position in EurUsd when one of many conditions is true and then closes this position after X amount of time.

- The condition/conditions is not a Custom Indicator (at least not that I know) and is something like this:

- Every minute check for closing price. If closing price is higher than -1 minute closing price, and -1 minute closing price is lower than -2 minutes closing price, and -2 minutes closing price is higher than -3 minutes... (this up to -5 minutes and higher or lower are just examples here) the trigger EA.

 

The question is how do I do this and where do I start?

Many thanks. 

Keith Watford
Moderator
7963
Keith Watford 2015.07.15 07:56  

The Book, linked at the top of the page will help you get started with the basics.

You will need to learn the basics before attempting to code such an EA.

Reading old topics here can help a lot as probably all questions have been answered at least once.

If you don't want to learn how to code an EA, the link at the top of the page, Freelance will take you to where you can order an EA to be coded for you. 

Xavi
10
Xavi 2015.07.15 07:59  
GumRai:

The Book, linked at the top of the page will help you get started with the basics.

You will need to learn the basics before attempting to code such an EA.

Reading old topics here can help a lot as probably all questions have been answered at least once.

If you don't want to learn how to code an EA, the link at the top of the page, Freelance will take you to where you can order an EA to be coded for you. 

Thanks for the input.

In particular I would like to know how to get the price at the end of each minute. I didn't find such predefined variable in the documentation. 

Keith Watford
Moderator
7963
Keith Watford 2015.07.15 08:22  
yarek37:

Thanks for the input.

In particular I would like to know how to get the price at the end of each minute. I didn't find such predefined variable in the documentation. 

If you mean the bar closes on the M1 chart, then you can use Close[] if you have the M1 chart open

If you have the chart open in another timeframe, then you can use iClose() 

Xavi
10
Xavi 2015.07.15 09:29  
GumRai:

If you mean the bar closes on the M1 chart, then you can use Close[] if you have the M1 chart open

If you have the chart open in another timeframe, then you can use iClose() 

 

Thanks! I will look into close[]
/
To add comments, please log in or register