Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 661

 
Roman Sharanov:

I need to store arrays of quotes in an array

To copy once in a loop and then perform calculations using ArrayCopy, not CloseCopy

Of course, everyone is free to do whatever he/she wants. But why should we copy one array element by element into another two-dimensional array and then work with this two-dimensional array? Can't we perform the same calculations instead of copying?

Or am I missing something? Can a one-dimensional array be copied into the second dimension of a two-dimensional array?
 
Alexey Viktorov:

Of course, everyone is free to do as they like. But why copy one element by element into another two-dimensional array and then work with this two-dimensional array? Can't we do those calculations instead of copying?

Or am I missing something? Is it possible to copy a one dimensional array into the second dimension of a two dimensional array?

I have two nested loops, the external one has CopyClose, and the internal one

And all of them copy the same characters from the array.

I want to enter an array of quotes for each pair in a separate array before the loops.

Anyway, here's what I did, I wrapped a double array of currency into a structure, and made an array of structures

for(int i = 0; i<ACTIVES; i++){
      CopyClose(all_pairs[i], PERIOD_CURRENT, 1, calculation_period, pairs_data[i].currency);
      pairs_data[i].pair = all_pairs[i];
   }
for(int i = 0; i < ACTIVES-1; i++){
	 ArrayCopy(first_data, pairs_data[i].currency, 0,0,WHOLE_ARRAY);
	//работа с firstData
	...
      
	 for(int k = i+1; k < ACTIVES; k++){
		 ArrayCopy(second_data, pairs_data[i].currency, 0,0,WHOLE_ARRAY);
         	//Работа с secondData
         	...
      }
   }
 

My friends, I cannot sleep without solving this problem for some time:

I use an indicator, which periodically! refreshes itself after receiving a tick. But sometimes this update is needed right now, but the tick is with a delay, and on weekends the market is asleep.
I have to right-click on the chart - "refresh". Unfortunately, I have not found a hotkey for this action.

The most effective thing I see is a separate highly specialised indicator/advisor with a button on the chart, pressing which imitates the one-time "refresh" action. I tried to google the solution, but without success...

Since the theme is called "Any questions from newbies, help and discussion" I dare ask this question.
I hope that someone smart in this matter will help, or at least poke the nose in - "exactly THIS has already been discussed here".


 
Roman Sharanov:

the close average difference does not equal the close average difference, alas and ah

Well, that's obvious!

But if you move into the space of close averages, you are automatically in a different mathematical space.

That is, you perform an integral transformation of moving averages, and consciously(!!!! In your case, as I understand it, not quite) leave the space of quotes (by Close, in your case).

That is, you consciously give up quotes (Close) and go into (integral) moving average space.

No one is forcing you to do this. You do it yourself, of your own free will and quite consciously. (!?)

But!!! In this new (integral) space we must work with the differences in averages, and not quotes.

The difference in quotes makes no sense in the (integral) space of averages!!!

And the average difference in quotes in the integral mean space does not make sense either !!!

I hope these simple mathematical truths are clear to you. (!?)

------------------------------------------------------------------------------------------------

And what you have got is that you kind of move into the space of averages. And, at the same time, you continue to consider the average difference by a close.

What kind of mathematical miracle is that?

-------------------------------------------------------------------------------------------------------

You can't have one foot in the boat and one foot on the shore and still be sailing on the sea.

 
Alexey Viktorov:

Of course, everyone is free to do as he likes. But why should I copy one element by element into another two-dimensional array and then work with this two-dimensional array? Can't we perform those calculations instead of copying?

Or am I missing something? Can a one-dimensional array be copied into the second dimension of a two-dimensional array?

You probably don't understand something.

By definition, you are not allowed to perform calculations on raw data arrays.

In order to perform calculations, we must copy the original data array into a new array, and then perform calculations with this new array.

That way, if errors or glitches occur, we can always easily go back to the original array and start again.

----------------------------------------------------------------------------------------------------------------------------------

If we use the original array for calculations, any error will be fatal.

--------------------------------------------------------------------------------------------------------------------------------------------

And copying a one-dimensional array into a two-dimensional one can be quite useful.

For example, we write "colour of quotes" in the first array, and the quotes themselves in the second one.

Then by "colour" of the array you can judge about the movements of the quotes themselves, without paying attention to values.

------------------------------------------------------------------------------------------------------------------------------------------------

By the way, it is useful to have a similar "colour gradation" on the chart itself (and not just a plain background!).

Or you can just make a "colour bar" on the side. It is very useful to have it for trading.

 
Сергей Николаев:


I use an indicator, which is periodically updated after the receipt of a tick. But sometimes this update is needed right now, and the tick is received with a delay, and on weekends the market is asleep.
I have to right-click on "refresh" chart. Unfortunately, I have not found any hotkey for this action.

track this event in a timer and update your indicator

 
neverness:

You probably don't understand something.

Calculations in raw data sets are, by definition, forbidden.

Really... you can't understand such nonsense as you're writing...

What original arrays? And who forbade it???

All the rest, not only is it hard to understand the meaning, it's even impossible to understand what everything you've written refers to...

 
Alexey Viktorov:

Indeed... It's impossible to understand such nonsense as you write...

What are the original arrays? And who forbade it???

All the rest, it is difficult not only to understand the meaning, even to understand what everything written refers to...

Practice understanding "nonsense", not yourself.

Once again, in programming, the raw data is not corrected, and does not change under any conditions.

That's why this data goes only "in read mode - ONLY READ".

That is, to work with raw data, it must be copied into a new data array.

And that's why C++Builder has a procedure to copy data into Memo block, which itself determines the size of the required array to copy.

By the way, this is also present in MT4/MT5. Well done MT4/MT5 developers - they took care of it.

 
neverness:

Another load of nonsense that not only has no relevance to the topic at hand, but makes no sense whatsoever.

 
Alexey Viktorov:

Another piece of nonsense that not only has no relevance to the topic at hand, but makes no sense whatsoever.

Don't get upset. It's normal. If you don't understand, that's fine. It's no big deal.

Reason: