Errors, bugs, questions - page 2996

 
Artyom Trishkin:

That was a long time ago. The problem has long since been solved. You need to access non-native timeframe/symbol data at least once every two minutes. In the main loop, if there is no data from the requested timeframe yet, you need to exit the loop - just return zero to wait for the next tick, and the indicator knew that the historical data has not yet been calculated.

So they are calculated, just the values are sent incorrectly. It only works correctly on minutes.

 
Francuz:

That's how they are calculated, it's just that the values are sent back incorrectly. Only works correctly on minutes.

Arethe arrayindexing directions the same?

 
Artyom Trishkin:

Arethe indexing directions of the arrays the same?

Copying one value. Do you think flipping the array will change anything? But just in case, I checked and made sure that flipping the array numbering does not change the only value. :)

 
Francuz:

Copying one value. Do you think flipping the array will change anything? But just in case, I checked and made sure that flipping the array numbering does not change the only value. :)

Well, I do not know what, how and where you copy.

 
Artyom Trishkin:

I don't know what, how or where you're copying.

0_о

The given indicator code showed everything:

::CopyBuffer(handle, 0, a, 1, Buffer);
 
Francuz:

You are missing the point. The code is only supposed to work once. Its purpose is to clearly show that the called indicator doesn't work. The problem is that the called indicator will not work if it (and the caller) has a different TimeFrame from the minute one. I found out that it is a bugof MetaTrader that can be solved only with crutches. And this problem is quite old. You can read the details in "I can't get indicator data from the higher TF 123".

What do you mean by highlighted? The current period is set in the code.

   handle = iCustom(_Symbol, PERIOD_CURRENT, "Examples\\ATR.ex5", 14);

You show at least something, what parameters you ran with, what you got and what you expect to get. And it would be nice to see what this line prints

   ::Print(__FUNCTION__ + "| PERIOD_CURRENT = ", EnumToString(_Period));
 
Alexey Viktorov:

Highlighted, what is that about? The code specifies the current period.

You should at least show me something, what parameters you ran with, what you got and what you expected to get. And it would be nice to see what this line prints out

1. For example, you may run this code with a TimeFrame different from one minute.

2. Run ATR on the same Symbol and the same TimeFrame.

3. CompareATR values via code and directly from the indicator.

4. Check that the values do not coincide.

Example

BS is the received ATR value.

 
Francuz:

1. Run the above code on a TimeFrame other than a minute.

2. Run ATR on the same Symbol and the same TimeFrame.

3. CompareATR values via code and directly from the indicator.

4. Verify that the values do not match.

Have you tried pasting the code I highlighted in yellow and running the indicator?

 
Francuz:

1. Run the above code on a TimeFrame other than a minute.

2. Run ATR on the same Symbol and the same TimeFrame.

3. CompareATR values via code and directly from the indicator.

4. Check that the values do not coincide.

BS is the received ATR value.

Maybe the skis are bad?


and also RTS-6.21


 
Nikolai Semko:
Have you tried pasting the code I highlighted in yellow and running the indicator?

Yes, I did. The result hasn't changed.