teoretical question about Indicators

 

Hello,

I have a question about the indicators. 

this is a Normal format of an indicator like MACD:

BarZero=iMACD(NULL,1,12,26,9,PRICE_CLOSE,MODE_MAIN,0)

this is for price Close of the current Bar (Bar Zero) of MACD. 

problem is when we are talking about the bar zero, that means the close price is not determined yet.

and when the price close is determined, Than Bar zero becomes Bar One.

so if The CONTROL is not exactly on the Bar zero in the split second when it ends and it becomes Bar one, which is very unlikely,

than it Must be imposible to bring the close price of Bar zero in our Expert.

the worst is even if we use PRICE TYPICAL insted of PRICE CLOSE , still we will have this problem. because price typical calculetes like this:

price open + price close / 2 . so even now PRICE CLOSE is in the calculation.

the only logical explanation that i can get is that : in all the indicators we can not bring the close price of the Bar zero in our Expert.

correct me if i am wrong. i must be wrong, because this is in every EA i have ever seen. Bur how it works?

 
kriss.ro:

Hello,

I have a question about the indicators. 

this is a Normal format of an indicator like MACD:

BarZero=iMACD(NULL,1,12,26,9,PRICE_CLOSE,MODE_MAIN,0)

this is for price Close of the current Bar (Bar Zero) of MACD. 

problem is when we are talking about the bar zero, that means the close price is not determined yet.

and when the price close is determined, Than Bar zero becomes Bar One.

so if The CONTROL is not exactly on the Bar zero in the split second when it ends and it becomes Bar one, which is very unlikely,

than it Must be imposible to bring the close price of Bar zero in our Expert.

the worst is even if we use PRICE TYPICAL insted of PRICE CLOSE , still we will have this problem. because price typical calculetes like this:

price open + price close / 2 . so even now PRICE CLOSE is in the calculation.

the only logical explanation that i can get is that : in all the indicators we can not bring the close price of the Bar zero in our Expert.

correct me if i am wrong. i must be wrong, because this is in every EA i have ever seen. Bur how it works?




You are wrong, you need to observe it differently, as it really is:


The CLOSE price of Bar Zero, is the Close price of the current moment, which corresponds to the current BID price.

As an exercise, take a picture of the screen, if you look to the picture, there will be a close price for the Bar Zero, always will be.


The difference is that Bar Zero is "Live", so its Close price is changing every moment, until the Bar "freezes" when the timeout is reached and another bar is created.

The "Open" of the new bar, is exactly the "Close" of the one which has just closed, because that is the point where the BID price was.. 

Price movements are constant and analogical. To separate them into bars is just an imaginary concept for organization of them on the bars timeline. 

And yes, you should work on Bar zero, if you dont want to have a delay on your EA

 

thank you rrocchi.

you are right. to be honest i considered this before. i just wanted to be sure.

the word "PRICE CLOSE" made me doubt myself.

thank you for your help.

 
I disagree with "open is exactly the close". In fact the open is constructed from the tick data following the close's tick data. Mostly they are very close by each other, but do not have to be.
This is called an opening gap.


Reason: