[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 23
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I don't understand how being in 15 minutes, through which time function, to organise a cycle of enumeration by day.
I hope the question is clear.
Thanks for the help
Look at the iBarShift help and/or you can work directly with the daily bars like this: iOpen(Symbol(),PERIOD_D1,1) - previous day's opening, etc.
Another Smartypants !
You have no idea how right you are in your characterisation of this forum! I hope that you will also draw the right conclusions about yourself and the quality of your enquiries, since you have come into such an environment.
You have no idea how right you are in your characterisation of this forum! I hope that you will also draw the right conclusions about yourself and the quality of your enquiries, since you have come into such an environment.
artmedia70
THANK YOU !..................... I have already been helped !
Two Chukchi are lost in the woods...
-Shoot in the air, maybe someone will hear and help...
A few minutes later...
-Shoot some more.
-I can't, I'm out of arrows...
The closing price can be well above the fractal (if the fractal is up) and then the potential profit is lost. I check the price breakout on every tick.
I agree, you can do that, as buy order opens on ask, you can compare it with ask...
if (Ask > upfractal) { DO IT }
To the question - why are not all your entry conditions triggered, I'll explain again in detail - it's because of incorrect fractal calculation...
To correctly calculate the value of the last fractal, you should use this construction using an auxiliary variable...
In your code, it's not there and the fractal has appeared, yes, you have memorized its value well. You wrote it correctly - not on the 3rd bar, but on the 2nd one, when we know its value on the 0th bar already, what happens next ... If the price does not break through the value of the latest fractal on the next bar, and, for example, "small steps", on each subsequent bar moves to its penetration without forming a regular fractal (which usually happens), then your situation is ... your calculated fractal value is reset to "0" by itself... and there is no need to zero it additionally as you do in your code (I won't cite where you know)... And that is why upfractal !=0 appears only on the next bar after the calculated one (where the latest fractal was)...
That's why they remember and keep the value of the newest fractal when forming subsequent bars just by entering an auxiliary variable, try to make these changes in your code and see that the deals are done right at the breakthrough of the latest fractal and it makes no difference how many bars later this breakthrough occurs, if you still do not understand, enter the print instead of your alert and look how the upfractal variable changes with each new bar and you will understand everything - it resets itself to "0" at the new formed bar, and the fractal is broken through, say, at the 8th bar - that's all, its value has been equal to zero for a long time.
That's how it is with you:
That's how it should be:
"Roman, why? Isn't it the same thing? For example, if MA_8<MA_2 is the same as (MA_8-MA_2)<0 ?"
It's the same, but for real-world operation and 100-guess reliability, for no ground for possible "glitches" - the 2nd option is needed.
P.S. Instead of alerts, use prints and track the resulting variable values over time in the tester in the EA log to analyse the "correct" operation of your owl.
I agree, you can do that, as the buy order opens on the ask, you can compare with the ask...
if (Ask > upfractal) { DO IT }
I've looked through the help, I don't understand (I don't get it) how to specify in the variable "some_time" in 15 minutes, that I need the previous day, i.e. if today is Jan. 25. 2011 how can I set January 24, 23, 22, etc. to search.
Thanks if you can explain.
I visually analyse the chart for penetration of a fractal and search for dependencies by the visible price, i.e. the bid. That's why I consider a fractal break as a bid (and upfractal also gives a bid, not an ask).
you can do it that way too, it is not important :-)))
Have you figured it out now?
I agree, you can do it that way, as the buy order opens on the ask, you can compare it with the ask...
To the question of why you don't have all entry conditions triggered, I'll explain again in detail - it's because the fractal is not calculated correctly...
For correct calculation of value of the last fractal it is necessary to use such construction with use of auxiliary variable...
In your code, it's not there and the fractal has appeared, yes, you memorized its value well. You wrote it correctly - not on the 3rd bar, but on the 2nd one, when we know its value on the 0th bar, what happens next ... If the price does not break through the value of the latest fractal on the next bar, and, for example, "small steps", on each subsequent bar moves to its penetration without forming a regular fractal (which usually happens), then your situation is ... your calculated fractal value is reset to "0" by itself... and there is no need to zero it additionally as you do in your code (I won't cite where you know)... And that is why upfractal !=0 only on the next bar after the calculated one (where the latest fractal was).
The order is opened by asc, then it can be compared to asc. That's why they remember and keep the value of the latest fractal when subsequent bars are formed just by entering an auxiliary variable, try to correct these changes in your code and see that the deals are done just at the breakthrough of the latest fractal and it doesn't matter how many bars later this breakthrough occurs,