Questions from Beginners MQL5 MT5 MetaTrader 5 - page 307

 

Good afternoon, started running the owl in the tester today and it started giving an error, the owl has a timer, it was fine yesterday. What are the possible causes?

2014.11.02 10:59:47.200 OnTimer critical error

 
PokrovMT5:

Good afternoon, started running the owl in the tester today and it started giving an error, the owl has a timer, it was fine yesterday. What are the possible causes?

2014.11.02 10:59:47.200 OnTimer critical error

I figured out there is a reason in expression involved comparisons of arrays up to 4th value

But there is a question why the expression

if (low[1] < low[2] && low[1] < low[3] && sym_bid > open_price[0]+X)

works, and

if (low[1] < low[2] && low[1] < low[3] && low[1] <low[4] && sym_bid > open_price[0]+X)

already generates an error, the difference is only the 4th array value.


Are there any limitations?
 
PokrovMT5:

There is a reason why the expression involves array comparisons up to the 4th value

But there is a question why the expression

works, and

already generates an error, the difference is only the 4th array value.


Are there any limitations?

You need to know what kind of error you get:

  1. Know what kind of error you are getting.
  2. Know more information about your variables.
  3. What language do you write in (MQL4 or MQL5) and what build of the terminal?

 
barabashkakvn:

You need to know what kind of error you are getting:

  1. Know exactly what kind of error you are getting.
  2. Know more information about your variables
  3. What language do you write in (MQL4 or MQL5) and what build of the terminal?

I've found a mistake in the conditions, I've declared an insufficient value in the array, that's why the array was created but the value didn't come, as the condition didn't fit. Thanks for the input.
 
Fellow professionals, please advise how to create a paired chart object? More specifically, I need a Fibonacci levels object tied with a zero point to the middle of a trend line. Thank you!
 
Karatalmazovih:
Fellow professionals, could you please tell me how to create a paired chart object? More specifically, I need a Fibonacci levels object tied with a zero point to the middle of a trend line. Thank you!
Good afternoon, what does "paired" mean?
 
You need to connect the two objects into one. That is, combine Fibonacci levels with an ordinary trend line.
 
Karatalmazovih:
You need to connect the two objects into one. That is, combine Fibonacci levels with an ordinary trendline.
That is, you want the Fibonacci line object (OBJ_FIBO) to be automatically attached to its central point when creating a trend line? To automate such a thing, we need to catch events of the trend line creation, and when such an event happens, we have to bind one point to its middle point... and the second... yes, and where should the second point be?
 

I am very pleased that you have shown interest! Thank you!

That's right, when you create a " trend line " its central point is automatically linked to the " Fibonacci lines " zero point (reference point) object. I see the event. I create a trend line with the bound Fibo object and independently move the second point to the desired location on the chart.

 
Karatalmazovih:

I am very pleased that you have shown interest! Thank you!

That's right, when you create a " trend line " its central point is automatically linked to the " Fibonacci lines " zero point (reference point) object. I see the event. I create a trend line with the bound Fibo object and independently move the second point to the desired location on the chart.

Here we will also face some difficulty determining the anchor "midpoint" as far as I know it cannot be identified using program methods (via ObjectGetDouble). And if the number of candlesticks between the line is even, the midpoint is "between" candlesticks, so we cannot "hook" the fibo-grid there, we have to shift it forward or backward to the nearest candlestick. So... One should think if it is really necessary))