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

 
VOLDEMAR:

You better write everything in English. If your code gets to an overseas trader, he won't understand anything...

I write code for a Russian and he asks me to write in Russian. And what I check here - I write for myself, and I do not care whether I write in Russian or in Martian. If I see a problem, I describe it.

I am writing it in English for Market.

 
pro_:
stringo:

Searched and found

.

Give me your example.



I have written to you in a private message. With an example of the problem I'm facing. ObjectFind was an attempt to solve the problem, and you're probably right,
ObjectFind itself works fine.

The problem is clear. Incorrect use of the ObjectFind function. ObjectFind returns the number of the subwindow in which the object is found. If no object is found, it returns -1. You are checking for "zero - zero".
 
Night63:

Hello!

We found the following problem.

We insert the block of switching from 4-digit quotes to 5-digit (the code works absolutely fine, it has been tested on dozens of Expert Advisors) :

From here you can see the following.

We bring up the input parameters of the Expert Advisor by pressing F7, everything is correct:

Press OK, then press F7 again:

Press OK, press F7 again:

Press OK, press F7 again:

And so on......

This bug does not disappear with updated builds. Appears with different users in the same way. The topic was discussed here


You can not change the input variables!

Use keyword input instead of extern, then the compiler will not let you do this.

We'll see what we can do to keep the old quadruple functionality

PS thank you very much for bringing this up

 
artmedia70:
So in the future Bars will not only be a predefined variable, but also a function with the same name: Bars() ?

It is quite possible. (In C/C++ this is allowed, by the way.)
 
stringo:

You can't change the input variables!



Here, can you explain in detail, what does it mean that input variables cannot be changed?

If input variable input int TakeProfit = 300 ;

then I can give it a different value in the code ???

I don't understand when I can't change it ???

 

Another question, how can I programmatically determine that the mouse cursor is on a bmp object ???

I have made code in which there is an area under the object where the cursor falls and the code understands that the cursor is over the bmp object ...

I am asking because I am looking for a simpler method of defining the cursor over a bmp object ...

 
VOLDEMAR:

Here, can you explain in more detail what it means that the input variables cannot be changed?

If input variable input int TakeProfit = 300 ;

then I can assign it a different value in the code ???

I don't understand, when can't I change ???

Software cannot be changed. Only by user in settings.

input int TakeProfit = 300;

int takeProfit;

int start() {

takeProfit=TakeProfit;

// And then modify takeProfit.

return(0);

}

 
artmedia70:

You cannot change it programmatically. Only by a user in the settings.

input int TakeProfit = 300;

int takeProfit;

int start() {

takeProfit=TakeProfit;

// And then modify takeProfit.

return(0);

}




Thank you !!! I'll know now ...
 
VOLDEMAR:

Here, can you explain in more detail what it means that the input variables cannot be changed?

If input variable input int TakeProfit = 300 ;

then I can assign it a different value in the code ???

I don't understand, when can't I change ???

Here is an example from our custom parabolic

input double InpSARStep=0.02;    // Step
input double InpSARMaximum=0.2;  // Maximum
//---- buffers
double       ExtSARBuffer[];
//--- global variables
double       ExtSarStep;
double       ExtSarMaximum;

...

void OnInit()
  {
//--- checking input data
   if(InpSARStep<0.0)
     {
      ExtSarStep=0.02;
      Print("Input parametr InpSARStep has incorrect value. Indicator will use value",
            ExtSarStep,"for calculations.");
     }
   else
      ExtSarStep=InpSARStep;
   if(InpSARMaximum<0.0)
     {
      ExtSarMaximum=0.2;
      Print("Input parametr InpSARMaximum has incorrect value. Indicator will use value",
            ExtSarMaximum,"for calculations.");
     }
   else
      ExtSarMaximum=InpSARMaximum;

...

And further we use ExtSarStep and ExtSarMaximum

 
stringo:
What's for sure is that it won't be soon at all


That's too bad. My experts need these events like air.

At each step, you have to go through a bunch of positions and figure out which ones have gone where and why.

Reason: