Code to find the open and close price of previous bar

 

Hi,

I'm relatively new to programing MQL4 and would like to know how to code an expert to understand the open and close prices of the previous bar?

Any help would be appreciated.

Thanks,

Chris.

 
chrisds9 wrote >>

Hi,

I'm relatively new to programing MQL4 and would like to know how to code an expert to understand the open and close prices of the previous bar?

Any help would be appreciated.

Thanks,

Chris.

PREVIOUS OPEN = Open[1];

PREVIOUS CLOSE = Close[1];

thats the easy part, to be useful you need to know how to select the currency they apply to and a whole bunch of other stuff,suggest you work through the book

or some samples in the code base, see top of page, search engine leads you to many useless results but is a necessary evil.

good luck

Keith

 
kminler:

PREVIOUS OPEN = Open[1];

PREVIOUS CLOSE = Close[1];

thats the easy part, to be useful you need to know how to select the currency they apply to and a whole bunch of other stuff,suggest you work through the book

or some samples in the code base, see top of page, search engine leads you to many useless results but is a necessary evil.

good luck

Keith

Hi Keith,


I read the book already, it wasn't easy going but I think I've got a grasp of the basics of programming this language. I couldn't find the above information in it though.

Anyway thanks for your help.

Chris

 
Chris:

Hi,

I'm relatively new to programing MQL4 and would like to know how to code an expert to understand the open and close prices of the previous bar?

Any help would be appreciated.

Thanks,

Chris.

how to code the "last previous bar close on upper or lower band"
 
tasaoirse:
how to code the "last previous bar close on upper or lower band"
That question does not make sense at all. What bands and what do bands have to do when it comes to close? What "last previous"?
 
Keith:

PREVIOUS OPEN = Open[1];

PREVIOUS CLOSE = Close[1];

thats the easy part, to be useful you need to know how to select the currency they apply to and a whole bunch of other stuff,suggest you work through the book

or some samples in the code base, see top of page, search engine leads you to many useless results but is a necessary evil.

good luck

Keith


How can i get Open[1] and Close[1] value of Week, Day and H4 timeframe...?

 
Winners786:


How can i get Open[1] and Close[1] value of Week, Day and H4 timeframe...?

Use iOpen() and iClose()

Reason: