Выпущена бета-версия MetaTrader 4 Build 529 с новым компилятором - страница 27

 
Barbarian:

Вы наверное не читали моего поста выше, где я описывал что куда пишется сейчас используя бета версии МТ4. В nix`ах все работают в своих песочницах полностью, программы общие для всех ставит только root пользователь и распределяет права на их использование другими пользователями. Там идеология совершенно другая, хоть и кажется на первый взгляд похожая с Майкрософтом. Я кстати не против того, что в бета версия пишет пользовательские настройки в X:\Users\xxx\AppData\Roaming\MetaQuotes\Terminal\, я против следующего:

1. Что создается такой подкаталог X:\Users\xxx\AppData\Roaming\MetaQuotes\Terminal\B5589D10299052C8D921603EBD1F9752\ который пока не залезешь туда не узнаешь его названия, к тому же он при каждом обновлении меняет свое название.

2. По данному пути пишутся не только настройки пользователя, но и исполняемые файлы - индикаторы, советники, скрипты и т.д., в общем все то, ради чего не пустишь постороннего на свой ПК даже под другим именем пользователя. Хотя и это конечно обойдем в последствии, но какой ценой.

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


Читал. я полностю с вами согласен. Что я и писал - было бы не плохо путь в терминале настраивать. Иногда полезно для несколких терминалов общие настройки, файлы,советники... иногда нет.
 
Antonsan:

I write in Spanish. And I translate with Google.

The translation into English is just as bad, that the Russian translation.

This indicator is prepared to EA and draws only a few bars.
Changing the timeframe I have observed that sometimes the indicator is often repeated on the screen.
Sometimes it seems to run several times and draw the line correctly, other times it seems they are identical copies arranged in history.

This had three identical copies in history, but to reduce the screenshot, only seen two.

It occurs when terminal downloads history of other TF.

You should clear whole buffer after indicator initialization. Or draw all the bars.

 
ALXIMIKS:


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

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

Что куда совать - не важно. Важно - что нужно в итоге нарисовать.

Если нужно кусок прошлого и будущее - тогда один буфер и SetIndexShift на необходимое в будущем количество баров (оно повзаимствуется из прошлого).

Если нужно только будущее - опять таки один буфер, SetIndexShift( барс ), и заполнять только "барс" значений.

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

Вообще проблемы не вижу.

 

Now the bug that external parameters declared as string were losing values are fixed. Thanks

The next problem is with iCustom() calls. If the called indicator contains string parameters the following error is happening :


Code for "_master" :

#property indicator_chart_window
#property indicator_buffers 1

extern string TestString = "whatever value that we want initially set";

double firstBuffer[];

int OnInit() { SetIndexBuffer(0,firstBuffer); return(0); }
int deinit() {                                return(0); }
int start ()
{
   firstBuffer[0] = iCustom(NULL,0,"_slave","",0,0);
   Comment(firstBuffer[0]);
   return(0);
}

Code for _slave" :

#property indicator_chart_window
#property indicator_buffers 1

extern string TestString = "whatever value that we want initially set";

double firstBuffer[];

int OnInit() { SetIndexBuffer(0,firstBuffer); return(0); }
int deinit() {                                return(0); }
int start()
{
   firstBuffer[0] = 1;
   return(0);
}

Different error happens when parameter is not a string type

When it is declared as integer it reloads the "_slave" instance over and over (as in the case when the parameter type is wrong)

Code for "_master integer" (using one integer type parameter in iCustom() call :

#property indicator_chart_window
#property indicator_buffers 1

double firstBuffer[];

int OnInit() { SetIndexBuffer(0,firstBuffer); return(0); }
int deinit() {                                return(0); }
int start ()
{
   firstBuffer[0] = iCustom(NULL,0,"_slave integer",(int)0,0,0);
   Comment(firstBuffer[0]);
   return(0);
}

And the code for "_slave integer" :

#property indicator_chart_window
#property indicator_buffers 1

extern int dummy = 0;

double firstBuffer[];

int OnInit() { SetIndexBuffer(0,firstBuffer); return(0); }
int deinit() {                                return(0); }
int start()
{
   firstBuffer[0] = 1;
   return(0);
}

When parameter in the called indicator is declared as double then it works OK

 

I think there must be some problem with the terminal, that does not erase the data memory properly, or any other problems you not know.

If these situations can happen to an expert, surely receive erroneous data.

This is more like a drawing program for Christmas trees.

 
mladen:

When parameter in the called indicator is declared as double then it works OK


We'll check it ASAP. Thank you
 
Antonsan:

I write in Spanish. And I translate with Google.

The translation into English is just as bad, that the Russian translation.

This indicator is prepared to EA and draws only a few bars.
Changing the timeframe I have observed that sometimes the indicator is often repeated on the screen.
Sometimes it seems to run several times and draw the line correctly, other times it seems they are identical copies arranged in history.

This had three identical copies in history, but to reduce the screenshot, only seen two.

Hola! Escriba en el español! Se lo traduciré al ruso! Suerte!
 
Antonsan:

I think there must be some problem with the terminal, that does not erase the data memory properly, or any other problems you not know.

If these situations can happen to an expert, surely receive erroneous data.

This is more like a drawing program for Christmas trees.

Terminal should not clear your buffers. Just initialize them once after indicator launch.
 
stringo:

Исправлено

Также исправлены пункты 1 и 2

Пункт 3. Отладчиком занимаемся

Для пунктов 4, 5 нам надо знать, как воспроизвести. По шагам. С ходу не воспроизводится

Спасибо за фидбэк. Код отправил в сервисдеск, #880536.
 

Ошибка в документации:

datetime iVolume

должно быть

double iVolume