Кому стратегию? Много и бесплатно) - страница 50

 

There is no any difference between "Journal by Bars" and "Journal by Position". They only display the information in different way.


*А Data Bars Filter "фильтрует" "Journal by Position"* it looks like that because there is no entry before "Oldest 'm' bars". The "Journal by Bars" shows the bars because they are loaded in the program but no trades are executed in the "Oldest" bars.


"Data Bars Filter" and "Date Filter" are exactly that - filters. They are used to permit (or forbid) market entry for the interval specified. This do not change the strategy logic.


We cannot use "Data Bars Filter" or "Date Filter" in a "Closing logic Condition" slot. That would change the strategy exit logic.

 
Miroslav_Popov писал(а) >>

There is no any difference between "Journal by Bars" and "Journal by Position". They only display the information in different way.

*А Data Bars Filter "фильтрует" "Journal by Position"* it looks like that because there is no entry before "Oldest 'm' bars". The "Journal by Bars" shows the bars because they are loaded in the program but no trades are executed in the "Oldest" bars.

"Data Bars Filter" and "Date Filter" are exactly that - filters. They are used to permit (or forbid) market entry for the interval specified. This do not change the strategy logic.

We cannot use "Data Bars Filter" or "Date Filter" in a "Closing logic Condition" slot. That would change the strategy exit logic.

Я это все прекрасно понял.

Указанные "извращения" я пытался применить для того, чтобы

1. Ограничить участок оптимизации слева и справа.

2. Увидеть поведение стратегии после вне участка оптимизации.

3. Граальные кривые не мешали смотреть на относительно реальную часть графика. (п.1 - увидеть участок истории, ограниченный слева и справа)

4. Минимизировав при этом количество нажатий кнопочек.

(Да и реально, часто необходимо более пристально "посмотреть" на какой-то участок истории. При этом открытие отдельного (full chart) окна "Balans/Equity Chart" не удобно)

И все это до исправления бага с галочкой в "Remove data older then" в Data Horizont.

Т.е. бум ждать исправления Data Horizont!!!!

 

Первый бар в журнале позиций ... 1254. Что, ИМХО, изменится не должно.


Forex Strategy Builder хочет minimum 300 bars. Для ето 1554 - 300 = 1254

 
/// <summary>
/// Data Horizon - Cuts some data
/// </summary>
int DataHorizon()
{
	if (iBars < MINIMUMBARS) return 0;

	int  iTempBars     = iBars;
	int  iTempStartBar = 0;
	int  iTempEndBar   = iBars - 1;
	bool bChange       = false;

	// 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;
	}
	

	// 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 < iTempBars - MINIMUMBARS; iBar++)
		{
			if (aBar[iBar].Time >= dtStartingDate)
			{
				iTempStartBar = iBar;
				iTempBars     = iTempEndBar - iTempStartBar + 1;
				bChange       = true;
				break;
			}
		}
	}

	// Set the end date
	DateTime dtEndingDate   = new DateTime(iEndYear, iEndMonth, iEndDay);
	if (bUseEndDate && aBar[iTempEndBar].Time > dtEndingDate)
	{   // We need to cut out the newest bars
		for (int iBar = iTempStartBar + MINIMUMBARS; iBar < iTempEndBar; iBar++)
		{
			if (aBar[iBar].Time >= dtEndingDate)
			{
				iTempEndBar = iBar - 1;
				iTempBars   = iTempEndBar - iTempStartBar + 1;
				bChange     = true;
				break;
			}
		}
	}

	// Cut the data
	if (bChange)
	{
		Bar[] aBarCopy = new Bar[iBars];
		aBar.CopyTo(aBarCopy, 0);

		aBar = new Bar[iTempBars];
		for (int iBar = iTempStartBar; iBar <= iTempEndBar; iBar++)
			aBar[iBar - iTempStartBar] = aBarCopy[iBar];

		iBars  = iTempBars;
		dtTime = aBar[iTempBars - 1].Time;
		bCut   = true;
	}

	return 0;
}

MINIMUMBARS = 300

iMaxBars - What we set in "Data Horizon"

 

:( I cannot post the code properly. It removes the leading tabs.

 
Miroslav_Popov писал(а) >>

// 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 < iTempBars - MINIMUMBARS; iBar++)
{
if (aBar[iBar].Time >= dtStartingDate)
{
iTempStartBar = iBar;
iTempBars = iTempEndBar - iTempStartBar + 1;
bChange = true;
break;
}
}
}

т.е. (надо использовать "пиктограмму" Ctrl+Alt+M, а не форматирование текста )

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

а где else для первого if?

Или хотелось

if (bUseStartDate && aBar[iTempStartBar].Time < dtStartingDate)
 iTempStartBar = Какая_там_функция_пересчета_времени_в_бары(dtStartingDate)

Аналогично и для "end date"

 

**а где else для первого if?**

We cut data when:

1. Check box is checked: bUseStartDate == true

2. Selected date is after (newer) than the beginning of our historical data: aBar[iTempStartBar].Time < dtStartingDate


In the opposite case simply there is no cutting.


-------

Edit:

You cannot remove date older than September 30th 2008. That is because if you remove them less than 300 bars will remain. (Daily chart)


for (int iBar = iTempStartBar; iBar < iTempBars - MINIMUMBARS; iBar++)

 
Miroslav_Popov писал(а) >>

**а где else для первого if?**

Да. поторопился, каюсь. :(

Получается, что для генерации стратегии на H4 я не могу использовать период меньше 2.5 месяцев (300/6=50дней - выходные дни без баров ~ 2.5. месяца) не критично, но и интервал проверки стратегии (OOS) должен начинаться не позже, чем за 2.5 месяца до текущей даты (не удобно, т.к. сомневаюсь, что подогнанная стратегия будет так долго жить, да и интереснее смотреть "как повела бы сегодня себя стратегия, оптимизированная позавчера"), либо вычитать "пересекающийся участок", либо ... добавлять пустые бары в файл (надеюсь, что время компьютера не проверяется)

:)

Резюме - количество бар всегда ставлю по максимуму (чтобы не зависала генерация), а интервалы оптимизации/проверки выставляю датами.

 

. добавлять пустые бары в файл (надеюсь, что время компьютера не проверяется)


It will catch them. Remove the check mark "Market" - "Check Data"

 
voltair >>:

А какие данные необходимы, чтобы корректно выбрать? Что нужно исследовать?

Ну например... как стратегия ведет себя при различных видах рынка, ну и сейчас... я сталкивался часто за год профит больше 2-х, а последний месяц слив и тенденция сохраняется.

Причина обращения: