MT4 tester does not give information from other timeframes - page 7

 
vladv002 >>:

Я извиняюсь, но тему я начал с того что в советнике на тесте данные не те, потому стал проверять что там и где,
в итоге оказывается что неверные данные в тестере хоть в индикаторе хоть в советнике.
Это я проверял и на своем коде и на готовых индикаторах поставленных на эксперта в режиме тестирования,
НО увы результат - только с одного ТФ.
iCustom() - Это первое что я применял, потом перебрал почти все из справки, резутьтат тот же!


Show me your code. You should also have seen the indicator

 
Rosh wrote:>>
Call the indicator from the EA and make sure everything works correctly. Stop trolling, there will be a ban.

What is the trolling? Trying to make sense of the situation.
If we are wrong, help us.
But if you use Victor's EA code, call invert and look at what it works with in the file, the conclusions will not change.
Correct or ban ;)

//+------------------------------------------------------------------+
//| VininE_test |
//| Copyright © 2010, Victor Nicolaev |
//| e-mail: vinin@mail.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2010, Victor Nicolaev"
#property link "e-mail: vinin@mail.ru"


//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init() {return(0);}

//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit() {return(0); }


//+------------------------------------------------------------------+
//Работа по отдельной ТС
//+------------------------------------------------------------------+
int start() {
static int prevtime=0;
if (Time[0]==prevtime) return(0);
if (prevtime==0) {
prevtime=Time[0];
return(0);
}
prevtime=Time[0];

switch (Period()) {
case PERIOD_M1: myPrint(PERIOD_M1);
case PERIOD_M5: myPrint(PERIOD_M5);
case PERIOD_M15: myPrint(PERIOD_M15);
case PERIOD_M30: myPrint(PERIOD_M30);
case PERIOD_H1: myPrint(PERIOD_H1);
case PERIOD_H4: myPrint(PERIOD_H4);
case PERIOD_D1: myPrint(PERIOD_D1);
case PERIOD_W1: myPrint(PERIOD_W1);
case PERIOD_MN1: myPrint(PERIOD_MN1);
}
return(0);
}

void myPrint(int TimeFrame){
Print(PeriodToStr(TimeFrame)+": ",
TimeToStr(iTime( NULL, TimeFrame, 0),TIME_DATE)," ",
TimeToStr(iTime( NULL, TimeFrame, 0),TIME_MINUTES), "; ",
iOpen( NULL, TimeFrame, 0), "; ",
iHigh( NULL, TimeFrame, 0), "; ",
iLow( NULL, TimeFrame, 0), "; ",
iClose(NULL, TimeFrame, 0),"; ",
iCustom(NULL,TimeFrame,"invert",0,0));

}

string PeriodToStr(int TimeFrame){
switch (TimeFrame){
case PERIOD_M1 : return("M1");
case PERIOD_M5 : return("M5");
case PERIOD_M15: return("M15");
case PERIOD_M30: return("M30");
case PERIOD_H1 : return("H1");
case PERIOD_H4 : return("H4");
case PERIOD_D1 : return("D1");
case PERIOD_W1 : return("W1");
case PERIOD_MN1: return("MN1");
}
}
Files:
invert_2.mq4  4 kb
 
Vinin >>:


При правильном подходе все работает нормально.

That's right - I confirm.

 
YuraZ >>:

верно - подтверждаю


Did you notice in Victor's log that the monthly TF gives out 0?

Why?

 
avatara >>:

Вы заметили в логе Виктора, что месячный ТФ выдает 0?

Почему?


The number of bars is insufficient to calculate the values, I suppose that's an option.
 
yuripk >>:


Количества баров не хватает для расчёта значений, полагаю такой вариант.

for opener and other then-correct info is enough. or wait for the end of the bar?

 
avatara писал(а) >>
What's the trollishness? Trying to make sense of the situation.
If we are wrong, please help.
But if you use Victor's EA code, call invert and look at what it works with in the file - conclusions won't change.
Correct or ban ;)


Did you put your indicator on the chart?
I'll just take a couple of lines

for (i=Period()-1; i>=0; i--)
          Value=iClose(PARA,0,i+k*Period());
i+k*Period());
In fact you are looking for a bar with the number Period()^2 (at most), and there may not be so many bars in the history
 
vladv002 >>:

Ваш код как есть запустил - работает НО данные по всем строкам одинаковые!!! Т.е. с одного ТФ!
Минутку, у Вас все цыфиры по ТФ разные и меняются? Может что с моим МТ4, здесь вер-220.
Пожалуйста проверьте на счет цыфир, а еще лучше смените вывод на[0][0]:
"\n", " -----------1------ = ",arr1[0][1]," - ", arr1[0][1], Хотя разницы особо нет.
Подставил Ваши блоки - меняются цыфиры только того ТФ на котором идет тест!
Но всеравно спасибо.


You have to change it carefully, everything changes as it should. I've given a working example, change what you need and deal with ArrayCopyRates, you can get values not only from other timeframes but from other symbols as well.

 
Vinin >>:


Ты свой индикатор на график выкладывал?

Yeah.

I don't know... something's wrong. try again. maybe it's a history glitch?

Or the build is new.

But my M1 zero bar was last seen on 2/04/2010. I can't help it.

 
avatara писал(а) >>

Yeah.

I don't know... something's wrong. try again. maybe it's a history glitch?

Or the build is new.

But my M1 zero bar was last seen on 2/04/2010. I can't help it.

I corrected myself in the post above.
You'd better tell me what you wanted to get?
Reason: