[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 427

 
costy_ >>:
Вернее int startBar =iBarShift(NULL,PERIOD_D1, iTime(NULL,PERIOD_D1, N),false); // N - номер бара от текущего момента на дневном тф =))


there's no need to get so complicated and tautological...

Why search for bar N via iBarShift when it is already there?

The time of this bar is always there, if there is a history of course, but the time of the bar may not be there, because the time can fall on a hole in the history or the time of the weekend...

 
keekkenen >>:


не нужно так усложнять и заниматься тавтологией..

зачем искать бар N через iBarShift, когда он и так есть ?

время по этому бару всегда есть, если конечно есть история, а вот по времени бара может и не быть, т.к. время может попасть на дыру в истории или время выходных..

LOL =))

Just loop 60 bars on iLow... at 1440 and that's it =))

 
costy_ >>:

Ржу нимагу =))

Explain what? I'll laugh too.

 
keekkenen >>:

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

если нужно начать с 60 бара так и берите время с него

int startTime = iTime(NULL,PERIOD_D1, N); // N - номер бара от текущего момента на дневном тф



Task statement: There is an Expert Advisor and we want to optimise it on the last 40 bars in the strategy tester, for example. These forty bars can be on an hourly, 4-hour, daily or other timeframe. The strategy tester works: The time interval at which it works is specified in the tester panel. This way of setting the operation time does not meet the above task - to test for 40 bars. It means we need to change the Expert Advisor so that it is not the tester that defines the test time (its capabilities are not satisfied), but the code itself.

Your suggestion will not work, because for the tester, the time that was N bars ago is the current time.

 
ikatsko >>:

Постановка задачи: имеется советник, есть желание его оптимизировать на последних, например, 40-ка барах в тестере стратегий. Эти сорок баров могут быть на часовом, 4-х часовом, дневном или другом ТФ. Работает тестер стратегий: промежуток времени на котором он работае указывается на панели тестера. Этот способ задания времени работы не выполняет поставленной выше задачи - тест на 40-ка барах. Значит надо внести изменения в советника так, чтобы выполняя код не тестер определял время тестирования (его возможности не устраивают), а сам код.

Ваше предложение работать не будет, так как для тестера время, которое было N баров назад является текущим.

Oh it is a problem statement and it is easily solved on any frame but only in an EA!

if(Time[0]>iTime(0,1440,60))
функция
 
costy_ >>:

if(Time[0]>iTime(0,1440,60,false))

C U E R ! ! ! But it seems to have 3 parameters? datetime iTime( string symbol, int timeframe, int shift)

I stand corrected, I got excited too early. For the current time the tester will calculate the time of opening of the specified bar (backward) starting from the current time. I.e. again it will not solve the problem. We need N bars backward from today's (momentary) bar, not from the current time of the tester




 
I hope this is not optimising the EA as it tests the Optimatic library.
 
ikatsko >>:

C У П Е Р ! ! ! Но у него вроде как 3 параметра? datetime iTime( string symbol, int timeframe, int shift)


Sorry, I'm not writing in a meta-editor but from memory.

 

I'm afraid this construction if(Time[0]>iTime(0,1440,60)) will always return true, because this iTime(0,1440,60) value will be 60 bars to the left of Time[0]...

what does the test show ?

 
costy_ >>:
Надеюсь это не оптимизация советника по ходу тестирования Библиотека Optimatic.

Confirmed, it's not "it".

Your previous sentence I have rethought (see above).

Reason: