MetaTrader 4 Build 529 beta released with new compiler - page 27

 
Barbarian:

You probably didn't read my post above where I described what is being written to now using beta versions of MT4. In nix everyone works in their own sandboxes completely, only root user puts common programs and distributes rights for their use by other users. The ideology is completely different there, although it seems similar to Microsoft. By the way, I don't mind that beta version writes user settings in X:\Users\xxx\AppData\Roaming\MetaQuotes\Terminal\, I mind the following:

1. That it creates a subdirectory X:\Users\xxx\AppData\Roaming\MetaQuotes\Terminal\B5589D10299052C8D921603EBD1F9752\ which until you get there you will not know its name, in addition it changes its name with every update.

2. This path is used not only for writing user settings, but also for executable files - indicators, Expert Advisors, scripts, etc., in general, all the things for which you will not let a stranger on your PC, even under a different user name. Although this, of course, may be avoided later, but at what price.

I am most afraid of the first item, because using the read / write to files, code to use these operations will become more complicated.


I read it. I totally agree with you. What I wrote - it wouldn't be a bad idea to configure the path in the terminal. Sometimes it's useful to share settings, files, EAs... Sometimes not.
 
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 saw two.

It occurs when terminal downloads history of other TF.

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

 
ALXIMIKS:


I have described my idea (to change the graph by inserting the present into the past, at the same time inventing the future), if it is not very clear, then alas........

I would be happy if you could suggest another way to draw what is needed on the minus bars with adequate values on the plus bars.

What to put where is not important. What is important is what should be drawn as a result.

If you need a slice of the past and the future, you need one buffer and SetIndexShift for the necessary number of bars in the future (it is borrowed from the past).

If only future is needed - again one buffer, SetIndexShift( bars ), and fill only "bars" values.

And if you need past completely (critical, even leftmost bars should be filled) and a part of future, then 2 buffers, each for its own.

In general, I don't see the problem.

 

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 do 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 saw 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 do 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:

Corrected

Also corrected items 1 and 2

Point 3, we're working on the debugger.

For points 4, 5 we need to know how to reproduce. Step by step. It's not reproducible on the fly.

Thanks for the feedback. Code sent to servicedesk, #880536.
 

Documentation error:

datetime iVolume

should be

double iVolume


Reason: