You are looking at only the first tick in the new bar. You need to look at subsequent ticks if you want to see other values
OK, so let me get this straight.
Every 30 Minutes my EA gets invoked. A number of ticks get passed in, is it 30 ticks - 1 for each minute?
My current thinking is the following:
Every 30 minutes my EA gets invoked.
Close[0] = the current tick
Close[1] = the previous 30 minute tick
and so on...
If that not correct?
OK, so let me get this straight.
Every 30 Minutes my EA gets invoked. A number of ticks get passed in, is it 30 ticks - 1 for each minute?
My current thinking is the following:
Every 30 minutes my EA gets invoked.
Close[0] = the current tick
Close[1] = the previous 30 minute tick
and so on...
If that not correct?
A tick is a change in the price within a candle. The number of ticks in a candle is not a constant number.
When a new candle begins Open[0], Close[0], Low[0], High[0] are equal. If you wait some time (some ticks) and check them again they will differ.
Every 30 Minutes my EA gets invoked.
if( barTime < Time[0]No, your EA gets invoked each tick. You are ignoring all of them except the first tick per bar.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello all,
My first time post to the forum, would really like someone to explain what I'm doing wrong here.
I have an custom written EA using M30. Currently when I try and get the value of Open[0] for the current candle lets say it returns 1.4578. Then I go for the value of Close[0] and its the same value 1.4578. So I think ok, its a doji, but then High[0] and Low[0] also return the same value 1.4578.....
So I did a little test: (borrowed code below from this forum)
This then prints the following:
As you can see, 100% of the time the Open, Close, High & Low are the same values...
What I would like to do is on every 30 minute bar, My EA gets the current candle prices for Open, Close, High and Low - AND they are the real prices :)