Testing real-time forecasting systems - page 19

 
grasn >> :

A little later I will be able to give an estimate of the probability of the forecast implementation. Question - what correlation are you talking about?

I mean something that allows you to assess the quality of a prediction system in some kind of points. So that you could take two systems, evaluate each system in points, compare scores and say "this one is XX better than that one".

In general, it would be interesting to think about how such an estimate could be made more accurately...

The correlation coefficient is the first thing that came to mind. Like this.

We go back in history for a couple of years.

Every hour we run the system in the history, it builds a forecast and counts its correlation with the history

Then the average correlation is the system's score.

And on what techniques do you base your estimation of the probability of the forecast realization?


 

I've always wanted to try a curious parameter - mathematical expectation at each time section, but never had enough time. The calculation is quite simple, it is the sum of products of price levels by corresponding frequencies of occurrences. The probability is taken from the initial probability state of the system.


I haven't tested the parameter at all, so I can't say anything. But just for the sake of sport interest: 15 min, EURUSD, one day forecast from the present moment

State vector (a bit out of place).


Expectation on time sections (1 sample - 15 minutes)




Probable levels (or not very probable):



 

to Lord_Shadows

Переименовали ветку. Теперь уже не игра, а тестирование, и кончились прогнозы.

Predictions have not yet started, in the sense that we are just warming up :o))) join in :o)


to shtoba

I mean something that allows you to evaluate the quality of the prediction system in terms of some points. In general it would be interesting to think how to make such an estimate.

Such a rating has long been invented for the championships - in fact, it is the number of earned points. I can add - without applying any MM - only the model works. The main thing is what are these points for? What is the point?

If we go to the history for a couple of years, we run the system every hour, it builds the forecast and calculates its correlation with the history. Then the average value of the correlation is sort of a system score.

The market never repeats, and if you calculate the correlation of the forecast by 3 periods, you'll find a lot of "similar" situations. But the coefficient won't say anything.

And what methods do you use to estimate probability of forecast implementation?

In two ways:

(1) A prediction is made at each count and its performance is assessed. Then frequencies are calculated, if it turns out, a more complex analysis is performed, in order to relate the frequency to the current situation independently of the model with the forecast

(2) The second method, more theoretical, sits in the model itself.

 

HAPPY VOICE DAY!!!! HAPPY HAPPY OUR VICTORY DAY!!! :о)))

Just missed the 1.3331 level a little, the rest are fine. Now a curious situation on EURUSD. Below is the calculation of the information entropy "map":

If we take the principle of maximum entropy to heart, we should expect a pullback to the level of about 1.3445, but on the other hand, the dynamic model shows an essential possibility to move up to 1.3756 (I remind, I consider the price level as a statistical one, around which the price will "concentrate"). So, the most reasonable thing is not to start trading on Monday, but to wait for about 10-20 readings of 15 minutes each :o)


What do you think, colleagues? Who has plans/targets for Monday?


ISSUE:

(1) I've started to learn MQL and made a very cool :o) "fetch data" script for MathCAD:

extern int diapason = 7000;


int start()
{
double process[];

GetHistoryProcess(process, diapason);
CreateFlowData(process);

return(0);
}


void GetHistoryProcess(double signal[], int window)
{
int n;
int i;

double y[];

ArrayResize(y, window);
ArrayInitialize(y, 0.0);

ArrayResize(signal, window);
ArrayInitialize(signal, 0.0);

i=0;

for(n=0; n<=window-1; n++)
{
y[i]=(High[window-n-1]+Low[window-n-1])/2.0;
i=i+1;
}

ArrayCopy(signal, y, 0, 0, WHOLE_ARRAY);

return(0);
}


void CreateFlowData(double process[])
{
int i;
int N;
int Handle;

string FILE="data.csv";

N=ArraySize(process);
Handle=FileOpen(FILE, FILE_CSV|FILE_WRITE,";");

if(Handle<0)
{
if(GetLastError()==4103)
{
Alert("Нет файла с именем ",FILE);
}
else
{
Alert("Ошибка при открытии файла ",FILE);
}

return;
}

for(i=0; i<=N-1; i++)
{
FileWrite(Handle, process[i]);
}

FileClose(Handle);

return(0);
}


At first I couldn't figure out why predictions didn't come true at all, then I figured it out - I forgot to "flip" the data :o). I've entered extern thinking I'll have an interface at initialization, where I can enter desired history range (it also changes) without compilation. So there's no interface, it doesn't work for scripts? Took some experts for example, it works there.


(2) I can't figure out how to "write to the future" the forecast time series (for example). While calculating, and while processing and analyzing the data, time shifted by, say, a few counts. Roughly speaking, I want to load 100 samples into the future since some historical date (or zero), i.e. some data have to be first loaded into the history before the current bar, and some further. It doesn't work.

 
grasn >> :

At first I couldn't figure out why the predictions didn't come true at all, but then I figured it out - I forgot to "flip" the data :o). Entered extern, thinking that during initialization there will be an interface, where I can enter the desired historical range (it also changes) without compilation. So there's no interface, it doesn't work for scripts? Took some experts for example, it works there.

It does not work for scripts, only for indicators and Expert Advisors. Make your exporting as an indicator if you want to manage extern variables


(2) I can't figure out how (for example) I should "write the forecast time series into the future". While calculating, and while processing and analysing data, time moved by, say, a few counts? Roughly speaking, I want to load 100 samples into the future since some historical date (or zero), i.e. some data have to be first loaded into the history before the current bar, and some further. It doesn't seem to work.

There is no future in MT. All series are placed in arrays, and vice versa. The index 0 corresponds to the current (or the most recently available) time, the index 1 corresponds to the bar backward, etc. Then for future we need indexes -1, -2, etc., but there are no such negative indexes in mql.

But there are other fusses. Look at function SetIndexShift for indicators (set shift of indicator line relatively to the beginning of chart). It is only a visual shift. The indexes are as they were and remain.


There is also SetIndexDrawBegin (Set the serial number of the bar from the beginning of the data, from which the drawing of the indicator line must start), it can be used to cut the drawing on the left for a specified bar.

 

To make everything synchronous in time - mark the values of your series not with indices, but with time and synchronize with MT chart by Time[bar].

But there is a problem - time axis on the graph may be non-uniform. If there are no bars in the initial series on the chart (there is no connection with the server or there is a hole for some other reason) - then the bars will still be drawn in a continuous manner, and time will jump over these gaps. This is only natural for the "past".

 
grasn >> :

..Entered extern, thinking that at initialisation there will be an interface where I can enter the desired historical range (it also changes) without compiling. So there is no interface, it doesn't work for scripts? Took some experts as an example, it works there....

Insert #property show_inputs in the script and your extern will appear when the script runs.

 

to Shtoba, granit77

Colleagues, thanks for the help. :о) I'm not too happy with these indicators :o). I do not know how to use them. For trading they are local status levels, according to the market modeling concept - the price "concentrates" near them. On the image they are red (more precisely, I haven't calculated them yet, I'm preparing an astrolabe :o)):

Theoretically, they can be shown in MT as lines ("trend" for example, the type seems to be OBJ_TREND). But a very simple question arises, how to recalculate the time counts (0, 1, 2, .... (15 minutes each)) to "future" time. So far, I've found the following way: we take number of seconds TimeCurrent( ), add the forecasted one to it and this number should be converted into time somehow. How do I do it?

PS: But we still have something in this entropy. The price hasn't reached the level, but it has started to move and if we conclude the deal we'd still be in the plus: o)

 

 
grasn >> :
... Only a very simple question arises, how to recalculate the time counts (0, 1, 2, .... (15 minutes each)) to "future" time...
FutureTime=Time[0]+N*Period()*60;
где N - номер бара в будущее от нулевого.
Reason: