Testing real-time forecasting systems - page 52

 
grasn >> :

still less than 1.55 :o) Let's see

Very likely ^_^, at least if you look at the options

Visual CME Options

 
grasn писал(а) >>

(1) How to correctly initalise a multidimensional array (all its dimensions). This code, as I understand it, will be correct for a one-dimensional array and the first found dimension in the multidimensional one:

double memRow[];

ArrayResize(memRow, N);
ArrayInitialize(memRow, 0.0);

But what to do with more dimensions?

(2) How to dynamically extend univariate and multivariate arrays?

In this case, array memRow[] should increase by some value at each iteration, no matter what, let it be 1 for simplicity. Similarly, for 2D array, it should grow in two directions by i and j - memRow[i][j]

(1) This is correct and is exactly the same for multiple dimensions. Initialization puts one value into all elements of the array, regardless of dimensionality.

(2) Alas, it won't work. In MKL4 you can only change the dimensionality of the first dimension of a multidimensional array. Maybe this will be corrected in MKL5.

 
NEKSUS_ >> :

Very likely ^_^, at least if you look at the options

Visual CME Options

Where did such beautiful data come from?

 
dentraf >> :

Where did you get such beautiful data?

The data is very ordinary, and whether it's pretty or not is up to the author ^_^

 

grasn, if programming in MQL4 is not an end in itself, then wouldn't it be better to write the most important parts of the project, especially if they require multidimensional arrays for normal implementation, in C and attach them as a DLL? It will work faster and more convenient to debug, and the source code will be more readable (without the hassles with a lot of arrays, indirect indexing and other stuff, which we will have to invent in MQL, to bypass its limitations).

 
grasn >> :

I predict realizations (trajectories), but when making trading decisions, I focus on "frequency" characteristics, e.g. average value of +/- the most probable trajectories on the forecast horizon. These are more reliable as far as targets are concerned, but the price path to these levels can be very convoluted. I am of course working on the second approach to estimate local reversal zones. As for MM as such - it is not so simple, it must be a separate serious task.

exactly for this reason, which is the subject matter of the conversation, I am in the process of translating code from MathCAD to MT. It will make statistical sense to have a testing period of at least 6 months (by eye). So, I'll post the state a bit later.


By the way, there's a programming question, because I'm stuck (I'm a bit of a programmer):

(1) How to properly initialize a multidimensional array (all its dimensions). This code, as I understand it, will be correct for a one-dimensional array and the first found dimension in the multidimensional one:

double memRow[];

ArrayResize(memRow, N);
ArrayInitialize(memRow, 0.0);


But what to do with more dimensions?


(2) How to dynamically extend univariate and multivariate arrays?



for(i=0; i<=N-1; i++)

{

...

memRow[];

...

}


In this case, array memRow[] should increase by some value at each iteration, no matter what, let it be 1 for simplicity. Similarly, for 2D array, it should grow in two directions by i and j - memRow[i][j].


Apparently, addressing a multidimensional array will have to be implemented as a function.


For example, you have a one-dimensional array a[n]


then suppose we want to use it as a three-dimensional array i,k,j


then the element (i,k,j) will be addressed in the array a, as a[i*3+k*2+j]


And so on...

 

to Yurixx

(1) Все правильно и для нескольких измерений точно так же. Инициализация прописывает одно значение во все элементы массива независимо от размерности.

(2) Alas, that won't work. In MKL4 you can only change the dimensionality of the first dimension of a multidimensional array. Maybe it will be fixed in MKL5.

Glad to see you in our safe haven :o). And it's good, that it is quiet unlike neighbour branches, where human passions rage, on an even place. A little summary for clearer understanding. Suppose there is such a construct:

double memRow[];

...

<какая то первая инициализация массива>

j=1

for(int i=0; i<=N-1; i++)

{

if(<какое то условие>)

{

ArrayResize(memRow, j+1);

<запись значений в расширенный массив>

...

}

}


As I understood it will dynamically increase array memRow[] when some condition triggers. I.e. I don't know the length of array beforehand. Did I get it right?


to marketeer

If programming in MQL4 is not an end in itself, then wouldn' t it be better to write the most important parts of the project, especially if they require multi-dimensional arrays for normal implementation, in C and attach them as a DLL? It will work faster and more convenient to debug, and the source code will be more readable (without intricate stuff with a bunch of arrays, indirect indexing and other stuff, that we will have to invent in MQL, to bypass its limitations).

My programming in C/C++ is even worse than in MQL. And I haven't been programming on the whole for about 15 years or so. Now I want to get the first result, on the basis of which I'll draw some conclusions. Of course, I won't get any performance, but the system will somehow start working in automatic mode. At least I hope so. :о)


But you are right of course, in the future I will replace some functions with dll, and maybe the whole system.


to sol

Apparently, the appeal to a multidimensional array will have to be implemented as a function.

For example, you have a one-dimensional array a[n]

then, suppose we want to use it as a three-dimensional array i,k,j

then the element (i,k,j) will be addressed in the array a, as a[i*3+k*2+j]

And so on...

It's an interesting idea, but at each iteration leading to a change of matrix dimension it would actually require reassembly (or rebuild) of the whole array. It's probably feasible though. Thanks for the idea.

 
grasn писал(а) >>

Suppose there is such a construct:

double memRow[];

...

<какая то первая инициализация массива>

j=1

for(int i=0; i<=N-1; i++)

{

if(<какое то условие>)

{

ArrayResize(memRow, j+1);

<запись значений в расширенный массив>

...

}

}

As I understood it will dynamically increase array memRow[] when some condition triggers. I.e. I don't know the length of array beforehand. Did I get it right?

A little advice. Do not increase the array by 1 element in the loop. Keep the number of used (filled) elements in an additional variable, and increase the array by a dozen or so elements (you can easily estimate it for your task), when you run out of space. In this way, you can get a significant performance gain. // Although I'm not familiar with how memory is allocated for arrays in the terminal. If memory is allocated with some reserve for case of array enlargement, then ArrayResize(memRow, j+1) will be executed very quickly.

 
lea >> :

A word of advice. Do not increase the array by 1 element in the loop. Keep the number of used (filled) elements in an additional variable and increase the array by a dozen or so elements (estimate for your own task) when you run out of space. In this way, you can get a significant performance gain. // Although I'm not familiar with how memory is allocated for arrays in the terminal. If memory is allocated with some reserve for case of array enlargement, then ArrayResize(memRow, j+1) will be executed very quickly.

Thanks, I'll try it, but I can't estimate what's more optimal. On the other hand, for a small array I'll also not know its dimensionality and besides in this implementation I'll have to double the array, firstly - the small one, and then the big one, where calculated values are accumulated. But it's time to experiment, thanks for the advice.

 

to Yurixx

I suggest to play good old thimbles, you can use any strategies and look anywhere :o) Forecast on EURUSD M15 for 300 samples (from Monday to Wednesday included):

Option 1:



Process entropy: 13.84



Variant 2:


Process entropy: 13.01



Option 3:


Process entropy: 14.36


Which thimble are you picking up? :о)

Files:
process_2.rar  5 kb
Reason: