i understand the function iClose and iOpen, but i do not understand Close and Open when Programming. - page 2

 
tim4dexlus #: and if i want to compare it with current price. so if i want to compare for example EURUSD Open ask price with EURUSD current bid price is that possible?

The Open ask price, no! That is a Bid price. But current price, yes! If you synchronise the detection of a new bar, then that will give you the current open ask and bid price, which you can save for further reference.

The predefined Variables

Variable

Value

Ask

The latest known seller's price (ask price) of the current symbol

Bid

The latest known buyer's price (offer price, bid price) of the current symbol

For current prices of different symbols, use ...

SymbolInfoDouble

Returns the double value of the symbol for the corresponding property

ENUM_SYMBOL_INFO_DOUBLE

Identifier

Description

Type

SYMBOL_BID

Bid - best sell offer

double

SYMBOL_ASK

Ask - best buy offer

double


SymbolInfoDouble - Market Info - MQL4 Reference
SymbolInfoDouble - Market Info - MQL4 Reference
  • docs.mql4.com
SymbolInfoDouble - Market Info - MQL4 Reference
 
Fernando Carreiro #:

The Open ask price, no! That is a Bid price. But current price, yes! If you synchronise the detection of a new bar, then that will give you the current open ask and bid price, which you can save for further reference.

For current prices of different symbols, use ...

SymbolInfoDouble

Returns the double value of the symbol for the corresponding property

ENUM_SYMBOL_INFO_DOUBLE

Identifier

Description

Type

SYMBOL_BID

Bid - best sell offer

double

SYMBOL_ASK

Ask - best buy offer

double


thank you! also if i would search in metaedittor help. how would i ever have found  SymbolInfoDouble ?

SymbolInfoDouble - Market Info - MQL4 Reference
SymbolInfoDouble - Market Info - MQL4 Reference
  • docs.mql4.com
SymbolInfoDouble - Market Info - MQL4 Reference
 
tim4dexlus #: thank you! also if i would search in metaedittor help. how would i ever have found  SymbolInfoDouble ?

Is it not obvious? Bid and Ask prices are information about Symbols, which in turn is about Market information ...

 
Fernando Carreiro #:

Is it not obvious? Bid and Ask prices are information about Symbols, which in turn is about Market information ...

that is the whole problem. i understand the history logic pretty well. it is the current info logic in metatrader i struggle with. i also started working first with history because that looked the easiest to me to check, incase i made an error. but going from history to current values. everything is different to me. it feels like it is 2 different languages in 1 editor.

 
tim4dexlus #: that is the whole problem. i understand the history logic pretty well. it is the current info logic in metatrader i struggle with. i also started working first with history because that looked the easiest to me to check, incase i made an error. but going from history to current values. everything is different to me. it feels like it is 2 different languages in 1 editor.

I think that maybe the reason you are having a difficult time understanding the logic, is because you have not taken the time to first learn to properly trade manually on the platform.

Unless you fully understand the mechanics and intricacies of manual trading, you will have difficulty programming it in MQL code.

 
Fernando Carreiro #:

I think that maybe the reason you are having a difficult time understanding the logic, is because you have not taken the time to first learn to properly trade manually on the platform.

Unless you fully understand the mechanics and intricacies of manual trading, you will have difficulty programming it in MQL code.

i trade already over 8 years using metatrader. now to say that i am highly successful would be a lie, but i never used the programming part of it, since 3 months ago i started learning metatrader editor. sure i can make easy script to set orders. i can also easily make a crossover ma indicator for example. but when it gets more complicated i struggle for current values, but that has more to do that i do not find the right functions like symbolinfodouble for example. market info i knew already, but it was that next step, but now with symbolinfodouble it becomes much more clear to me. so thanks a lot for that!

SymbolInfoDouble - Market Info - MQL4 Reference
SymbolInfoDouble - Market Info - MQL4 Reference
  • docs.mql4.com
SymbolInfoDouble - Market Info - MQL4 Reference