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

 
The 540 is out...
 
VOLDEMAR:
Guys, if you have a minute, please send me the web install of the latest version, thanks.


Here's the 540.

from C:\Users\XXXXX\AppData\Roaming

 
ENUM_TIMEFRAMES gives you the choice of the timeframe mass, will all timeframes work or only the standard mt4 timeframes ????
 

After upgrading to 540. The ME is lost. The terminal is started with the /portable switch. ME should also start with the /portable switch. From the terminal ME does not start with F4:


The screenshot opens the data directory from the terminal. It is correct and the editor is in place.

After restarting the terminal, ME opened by pressing F4 in the terminal.

Interesting how this works:

  1. Terminal can't see the update. Restarting the terminal. 1.
  2. Terminal says update downloaded. Restarting the terminal. 2.
  3. Terminal loads and asks to make changes. I allow it. Terminal restarts itself. 3.
  4. After automated restart, terminal forgets about its settings and opens with random configuration - no former windows, indicators and templates. Restarting the terminal. 4.
  5. After restarting, the terminal "recalls" its former settings: it opens the required charts with indicators and templates, but ... the terminal "loses" the editor and writes in the journal that it is not found. I restart the terminal. 5.
  6. The terminal loads and now everything is fine - my charts, my settings, my templates, my indicators. ME is found and runs. 6.
A total of six restarts of the terminal to update and continue in the same mode.
 
artmedia70:

After upgrading to 540. The ME is lost. The terminal is started with the /portable switch. ME should also start with the /portable switch. From terminal ME does not start with F4:


Thanks for asking, we'll check it out.
 
extern string     symbol        = ""  ;

void OnTick()
  {
string sy = sym();
double ask = MarketInfo(sy,MODE_ASK);
  }

string sym    ()
{ 
 string symm = symbol;
 if ( symm == "" ) 
 symm=Symbol () ;
 
 return (symm);

Inundated with messages

 

I apologise here... What does the warning that not all control paths return a value mean ?

Because such varnings appeared when compiling in this beta, and what and about what, I don't understand.

Thanks.

 
St0nE:

I apologise here... What does the warning that not all control paths return a value mean ?

Because such varnings appeared when compiling in this beta, and what and about what, I don't understand.

Thanks.

some variants that the code algorithm could run on might not return a value.

For example, you have a Switch () function but no option at default: where return() should be.

 

Thanks for the reply, can you check out a piece of code where there might be such a bug, I can't seem to get a handle on it...

bool isDodgi(string TypeOrder, int NumBar) // 
{ 
  double Price1=0, Price2=0, Price3=0;

  if (TypeOrder=="BUY") {
    if (Cut_Digits(Open[NumBar])==Cut_Digits(Close[NumBar])) {
      return(true);
    }
    if (Cut_Digits(Open[NumBar])>Cut_Digits(Close[NumBar])) {
      Price1=Open[NumBar];
      Price2=Close[NumBar];
      Price3=Low[NumBar];
    }
    if (Cut_Digits(Close[NumBar])>Cut_Digits(Open[NumBar])) {
      Price1=Close[NumBar];
      Price2=Open[NumBar];
      Price3=Low[NumBar];
    }
    if (((Price2-Price3)/(Price1-Price2))>=2) {
      return(true);
    }
  }
  if (TypeOrder=="SELL") {
    if (Cut_Digits(Open[NumBar])==Cut_Digits(Close[NumBar])) {
      return(true);
    }
    if (Cut_Digits(Open[NumBar])>Cut_Digits(Close[NumBar])) {
      Price1=Open[NumBar];
      Price2=Close[NumBar];
      Price3=High[NumBar];
    }
    if (Cut_Digits(Close[NumBar])>Cut_Digits(Open[NumBar])) {
      Price1=Close[NumBar];
      Price2=Open[NumBar];
      Price3=High[NumBar];
    }
    if (((Price3-Price1)/(Price1-Price2))>=2) {
      return(true);
    }
  }
}
 
St0nE:

Thanks for the reply, can you check out a piece of code where there might be such a bug, I can't seem to get a handle on it...

bool isDodgi(string TypeOrder, int NumBar) // 
{ 
  double Price1=0, Price2=0, Price3=0;

  if (TypeOrder=="BUY") {
    if (Cut_Digits(Open[NumBar])==Cut_Digits(Close[NumBar])) {
      return(true);
    }
    if (Cut_Digits(Open[NumBar])>Cut_Digits(Close[NumBar])) {
      Price1=Open[NumBar];
      Price2=Close[NumBar];
      Price3=Low[NumBar];
    }
    if (Cut_Digits(Close[NumBar])>Cut_Digits(Open[NumBar])) {
      Price1=Close[NumBar];
      Price2=Open[NumBar];
      Price3=Low[NumBar];
    }
    if (((Price2-Price3)/(Price1-Price2))>=2) {
      return(true);
    }
  }
  if (TypeOrder=="SELL") {
    if (Cut_Digits(Open[NumBar])==Cut_Digits(Close[NumBar])) {
      return(true);
    }
    if (Cut_Digits(Open[NumBar])>Cut_Digits(Close[NumBar])) {
      Price1=Open[NumBar];
      Price2=Close[NumBar];
      Price3=High[NumBar];
    }
    if (Cut_Digits(Close[NumBar])>Cut_Digits(Open[NumBar])) {
      Price1=Close[NumBar];
      Price2=Open[NumBar];
      Price3=High[NumBar];
    }
    if (((Price3-Price1)/(Price1-Price2))>=2) {
      return(true);
    }
  }
  ТУТ КОСяК ( return() где?)
}
Reason: