I must be coming from the wrong side. Any advice - here's a fractal on 1 bar. I need to compare its value with the values of the Bollinger lines to determine if the fractal is inside or outside. How can I represent this in the code?
Ha! Got it - you don't need fractals at all, at least not for my purposes. You have to compare the minimum or maximum price of the bar with the upper or lower value of the Bollinger lines, as a fractal has the value of the high or low of the bar on which it appeared. Right?
A fractal is the value of the high or low on 5 bars.
Having data on a single bar will not give you the correct fractal value.
Placing the "fractals" indicator on the chart, you will immediately see that the indicator arrows are positioned on the maximum or minimum bar, and their values are equal to the high or low of that bar. It does not matter how many bars the fractals are calculated on. Anyway, it is not important for my strategy.
n0name: That's right, please do the test by selecting a few days. What will be the result?
I understand there is still a problem. Since my desire to help is still there and I somehow don't fully understand the problem, please write your expectations. The EA I wrote earlier will print the closing price of a candle with index 1 on every tick in the log. I put the EA on my M1 chart (not a history test) and it prints a new value when a new candle appears.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
As a result I get
2015.11.30 23:30:37.645 2015.10.30 22:54 111 EURUSD,H1: NormalizeDouble(dX,Digits) 1.05934
same value by test
You need at least three bars for a fractal
A fractal is the value of the high or low on 5 bars.
Having data on a single bar will not give you the correct fractal value.
A fractal is the value of the high or low on 5 bars.
Having data on a single bar will not give you the correct fractal value.
Placing the "fractals" indicator on the chart, you will immediately see that the indicator arrows are positioned on the maximum or minimum bar, and their values are equal to the high or low of that bar. It does not matter how many bars the fractals are calculated on. Anyway, it is not important for my strategy.
Thanks anyway.
as a result I get
2015.11.30 23:30:37.645 2015.10.30 22:54 111 EURUSD,H1: NormalizeDouble(dX,Digits) 1.05934
same value by test
A) To paste the code correctly here on the forum, click on SRC and then in the field that opens the code itself.
B) Try the following code.
2015.12.01 22:24:01.683 2015.10.02 17:49 111 EURUSD,H1: Close price = 1.06181
2015.12.01 22:24:09.701 2015.11.30 23:59 111 EURUSD,H1: Close price = 1.06181
tried on another pair
2015.12.01 22:35:58.830 2015.11.30 23:59 111 GBPUSD,H1: Close price = 1.50718
2015.12.01 22:35:58.683 2015.11.27 20:59 111 GBPUSD,H1: Close price = 1.50718
2015.12.01 22:24:01.683 2015.10.02 17:49 111 EURUSD,H1: Close price = 1.06181
2015.12.01 22:24:09.701 2015.11.30 23:59 111 EURUSD,H1: Close price = 1.06181
tried on another pair
2015.12.01 22:35:58.830 2015.11.30 23:59 111 GBPUSD,H1: Close price = 1.50718
2015.12.01 22:35:58.683 2015.11.27 20:59 111 GBPUSD,H1: Close price = 1.50718
Can't reproduce, it's not clear where the second date came from, I have this
2015.12.01 22:10:04.250 111 EURUSD,H1: Close price = 1.06336
2015.12.01 22:10:00.531 111 EURUSD,H1: Close price = 1.06336
2015.12.01 22:10:00.531 is the date and time;
111 - name of the Expert Advisor;
EURUSD,H1 - symbol name and timeframe;
Close price = 1.06336 - close price of candle with index 1 (the previous hour), so you will get it until the new hour arrives.
Can't reproduce, it's not clear where the second date comes from, I have this
2015.12.01 22:10:04.250 111 EURUSD,H1: Close price = 1.06336
2015.12.01 22:10:00.531 111 EURUSD,H1: Close price = 1.06336
2015.12.01 22:10:00.531 is the date and time;
111 - name of the Expert Advisor;
EURUSD,H1 - symbol name and timeframe;
Close price = 1.06336 - closing price of candle with index 1 ( previous hour ), you will receive this until the new hour.
That's right, please do the test by selecting a few days. What will be the result?