Testing real-time forecasting systems - page 74

 
neoclassic писал(а) >>
You can see the forecast.csv file

Not any more :o( But I'll have some more this weekend! :o)

 
I need to understand the structure of the data. I remember solving a similar problem, I needed to display the trajectories on a graph. But I used an indicator for this purpose. So, it was necessary to get the length of trajectories to determine SetIndexShift. The file with trajectories had the following format: lines with values of the 1st trajectory, empty, 2nd, empty, etc. To determine the length, each readout was checked for an empty line, and when it was found, the next buffer was filled in and determined with a shift. I hope it helped.
 
grasn >> :

I did write a script to generate an array of probable realisations (it's very simple):

Here's how the script works:

How to automatically determine the length of probability sample from a text file is a mystery to me, so far it's set manually. If you have any ideas, please advise me.

I have a function in ShowSeries to determine the size of the series - it's done in a globally by an extra preemptive read of the file, like this:

int GetFileCount()
{
  int count = 0;
  int columns = 0;
  int handle = FileOpen( FileName, FILE_CSV| FILE_READ, Delimiter);
  if( handle > 0)
  {
    while(!FileIsEnding( handle))
    {
      string x = FileReadString( handle);
      if(StringLen(StringTrimLeft(StringTrimRight( x))) == 0) break;
      if( count == 0)
      {
        columns++;
      }
      if(FileIsLineEnding( handle))
      {
        count++;
      }
    }
    FileClose( handle);
  }
  Comment("Column ", ColumnNo, "(", columns, "),", " Lines:", count);
  return( count);
}

If you save to a binary format file, you can quickly calculate by the obvious formula (length-file-header-if-it-is)/size-one-record.

I don't understand the benefit of using a bunch of objects instead of indicators, though. I usually on the contrary, if I happen to need to use some code where objects are applied, I convert it to buffers. The only objects that are necessary are captions, imho ;-), and only because methacquotes did not bother to make text indicators.

And another important point. We will not be able to build the TS by objects. An indicator must be a signal one - give signals available through iCustom.

I'd dismiss this direction with objects as improper buy-design ;-). But of course you know best.

 
neoclassic >> :
I need to understand the structure of the data. I remember solving a similar problem, I needed to display the trajectories on a graph. But I used indicator for this purpose. So, it was necessary to get the length of the trajectories to determine SetIndexShift. The file with trajectories had the following format: lines with values of the 1st trajectory, empty, 2nd, empty, etc. To determine the length, each readout was checked for an empty line, and when it was found, the next buffer was filled in and determined with a shift. I hope it helped.

There's a matrix. I just need to determine the size of that matrix.

 
marketeer >> :

I have a function in ShowSeries to determine series size - done obliquely by an extra preemptive read of the file, like this:

If you save to a binary file, you can quickly calculate by the obvious formula (length-file-header-if-it-is)/size-one-record.

I don't understand the benefit of using a bunch of objects instead of indicators, though. I usually on the contrary, if I happen to need to use some code where objects are applied, I convert it to buffers. The only objects that are necessary are captions, imho ;-), and only because methacquotes did not bother to make text indicators.


I have seen the function and even conceptually understood what it does. What remains to be understood is how it works. OK. I'll take a time-out over the weekend and think about it, and if I don't understand it, I'll beg for an explanation.


And another important point. We will not be able to build the TS by objects. The indicator should be signal - give signals available through iCustom.

I would close this way with objects as wrong buy design.) But of course you know better.


This I know, but for now I need it only for visualisation of forecasts. Of course there will be a level to bargain with, and I will input the data into the matrices :o)

 
grasn >> :

there's a matrix. I just need to determine the size of that matrix.

If each row of the matrix is a trajectory, then I would do this
   while(FileIsEnding( Handle)==false)
   {
      if(FileIsLineEnding(Handle)) //если строка закончилась, начинаем новую траекторию с 0
      {
         i=0;
      }

      COUNT=FileReadString( Handle);
      realisation=NormalizeDouble(StrToDouble( COUNT), 5);

      ObjectCreate(DoubleToStr( idCount, 10), OBJ_ARROW, 0,Time[0]- timeShift*15*60)+( i)*Period()*60+1, realisation);
      ObjectSet(DoubleToStr( idCount, 10), OBJPROP_ARROWCODE, 250);
      
      i= i+1;
      idCount= idCount+1;

   }
 
neoclassic >> :
If each row of the matrix is a trajectory, then I would do

So far grasn has generated files where the rows are time counts and the trajectories are written by columns. To keep this layout would be more convenient, at least imho;-) -I use it everywhere. By the way, so does Deductor.

 

I looked at the code of the indicator that grasn posted on the previous page, it reads the trajectories by rows. The problem, as far as I understand, is that I need to know the length of the trajectories to start drawing from the 0th bar in time.

Suggested by me method automatically detects the end of line and moves the carriage :-).

About what's more convenient - I agree.

 
Colleagues, thank you very much for the advice. I will give it a try.
 

EURUSD, M15.

Forecast for 300 counts (just over 3 days).

Main trajectories:


Two most likely groups of trajectories, roughly "equal":


Transferred to MT:



PS1: Just in case - the system is being tested, it is too early to use it for trading.

PS2: I strongly suspect that the chart will "shift" into history at the first quote.

Files:
files.rar  44 kb
Reason: