Who wants a strategy? Lots and for free) - page 52

 
Miroslav_Popov писал(а) >>

Generator repaired. Replace your exe with this.


The generator sets sometimes Indicator Period + Shift > Bar Count;

I'm already confused. :)

New version.

But having reduced bar count to 300, the generator works and can be stopped with Stop button

'

Old version (quickly downloaded from site)

But, if amount of bars < 1000, then generator hangs.

'

IMHO it's better to get used to the 1000 bar limit requirement for the tester, but the convenience of selecting the interval.

'

 
SergNF писал(а) >>

I'm already confused. :)

'

Old version (downloaded quickly from website)

But, if number of bars < 1000, generator hangs.

'

Happy thoughts about 'old version' turned out to be mistaken.

I.e. picture is the same as with new version. (I.e. number of bars has higher priority than date DO!!!!)

'

'

Oops

if ( bUseStartDate && aBar[ iTempStartBar].Time < dtStartingDate)
{   // We need to cut out the oldest bars
 for (int iBar = iTempStartBar; iBar < iTempBars - MINIMUMBARS; iBar++)
 {

Is it correct that the loop goes to iTempBars - MINIMUMBARS, i.e. to the maximum number of bars iTempBars = iMaxBars; from the beginning of the history ?

In my history files a lot more than 50 000 lines and in this interval from iTempStartBar = iBars - iMaxBars to iMaxBars- MINIMUMBARS can simply not be ordered date?!

Logically the End date and the start date should be searched to the end of the whole story, i.e. to iBars ???

But the ending bar is found correctly.

int  iTempEndBar   = iBars - 1;
for (int iBar = iTempStartBar + MINIMUMBARS; iBar < iTempEndBar; iBar++
 
SergNF >> :

About your screen shots:

1. "Remove data older than September 1st 1st 2008" is ignored since there are less than 300 bars till January 1st 2009

2. "Remove data newer than January 1st 2009" - it seams there is no data for January 1st FSB cuts out all bars from 01.01.08 including . That why FSB limits the bars till 31.12.08.


(I.e. number of bars has higher priority than date BEFORE!!!!)

Exactly.

 
Miroslav_Popov писал(а) >>

1. "Remove data older than September 1st 2008" is ignored since there are less than 300 bars till January 1st 2009.

2. "Remove data newer than January 1st 2009" - it seams there is no data for January 1st. That why FSB limits the bars till 31.12.08.

Not anymore.

I am now showing the clock.

In file 63291(iBars) the lines from 1999-01-04 to 2009-03-18

Date 2008-09-01 is line 59 973

The date 2009-01-02 is line 62 021.

I.e. when the program searches for the start date, the cycle "runs" from bar 63 291 - 50 000 = 13 291(iTempStartBar = iBars - iMaxBars; ) to bar 50 000 - 300 = 49 700(iTempBars - MINIMUMBARS) and not finding my "before" date (bar 59 973), leaves(iTempStartBar = iBars - iMaxBars;) start bar = 63 290 - 50 000 = 13 290.

In my file it is 2001-02-21 12:00 (+/- 300, which corresponds to the figure)

File attached.

Files:
eurusd60.rar  702 kb
 

iBars<= 50,000

FSB imports the newest 50,000 bars from the data file.

So:

Date 2008-09-01 is line 59 973

Date 2009-01-02 is line 62 021

are outside of the loaded data. Data Horizon does not take them into account.



Ops. I'm wrong.

 
Miroslav_Popov писал(а) >>

iBars <= 50,000

FSB imports the newest 50,000 bars from the data file.

So:

Date 2008-09-01 is line 59 973

2009-01-02 is line 62 021

are outside of the loaded data. Data Horizont does not take them into account.

newest !!!!, i.e. from 13,291 to 63 291!!!!! and now searches from 0 to 50,000 (rounded ;) )

No agreement. :( Pity :(

Although it seems to me that it would be more correct toreplace iTempStartBar ;iBar < iTempBars - MINIMUMBARS; iBar++) with iTempEndBar inplace of iTempBars - MINIMUMBARS. And the whole block "// Set the maximum nuber of bars" is redundant if AND bUseStartDate=True AND bUseEndDate=True

'

But again, I don't insist. :( (I'll cut the file, though for minutiae it may well want to optimize the strategy on the previous 50 000 bars and check it on the next 10 000 bars.

:(

SZY. There is still an error in the code and it does not correspond to the scheme!!!!! (my interval is on the right and not on the left) :(

 

Let's think about it.


Give me the code you want. I'll put it in the program and we'll test it.

 
Miroslav_Popov писал(а) >>

Let's think about it.

Give me the code you want. I'll put it in the program and we'll test it.

A snippet of your code from the previous pages.

// Set the maximum nuber of bars
// if (iBars > iMaxBars && iMaxBars >= MINIMUMBARS)
// {   // We need to cut out the oldest bars
//  iTempBars     = iMaxBars;
//  iTempStartBar = iBars - iMaxBars;
//  bChange       = true;
// }
// Или оставить 
// только если && bUseStartDate=False && bUseEndDate=False 
// или && (bUseStartDate=False || bUseEndDate=False)
// сам не представляю, но весь блок "сбивает"



// Set the starting date
DateTime dtStartingDate = new DateTime( iStartYear, iStartMonth, iStartDay);
if ( bUseStartDate && aBar[ iTempStartBar].Time < dtStartingDate)
{   // We need to cut out the oldest bars
 for (int iBar = iTempStartBar; iBar < iTempEndBar; iBar++)
 {
  if ( aBar[ iBar].Time >= dtStartingDate)
  {
   iTempStartBar = iBar;
   iTempBars     = iTempEndBar - iTempStartBar + 1;
   bChange       = true;
   break;
  }
 }
}

Как вариант, после
// Set the maximum nuber of bars
if (iBars > iMaxBars && iMaxBars >= MINIMUMBARS)
{   // We need to cut out the oldest bars
 iTempBars     = iMaxBars;
 iTempStartBar = iBars - iMaxBars;
 bChange       = true;
}

add

if (bUseStartDate)
{   
 iTempStartBar = 0; 
}
But for start date reset iTempStartBar must be!!!!
 
if (bUseStartDate)
{   
    iTempStartBar = 0; 
}
If dtStartingDate is earlier than iMaxBars, ignore dtStartingDate and limit by iMaxBars
 
Miroslav_Popov писал(а) >>
if dtStartingDate is earlier than iMaxBars you should ignore dtStartingDate and limit by iMaxBars

And I think there should be iMaxBars from dtStartingDate "to the right", so that you can move the window size of iMaxBars throughout the file!

But if to the right dtStartingDate bars are smaller than iMaxBars. then it should be dtStartingDate that has priority, as dates are more intuitive than bars. IMHO.

And in general, a user puts a 'tick' deliberately, and bars - by default, the more so it's written in the system (iMaxBars)

'

ZS. The funny thing is that I probably will not use the program :)