Download MetaTrader 5

'}' - not all control paths return a value - MetaEditor 5.00 Build 883 - page 2

To add comments, please log in or register
James Hodges
James Hodges  
This code .....
   TextLabel("multi1", Symbol() + ",  " + Per(_Period), 18, FontName, FontColor, 138, 37, CornerNumber);
   TextLabel("multi2", "Q u o t e  /   B a s e ,      P e r i o d", 8, FontName, FontColor, 140, 57, CornerNumber);
   TextLabel("multi3", "Bid(Sell): "+DoubleToStr(Bid,5), 10, FontName, FontColor, 138, 70, CornerNumber);
   TextLabel("multi4", "Ask(Buy): "+DoubleToStr(Ask,5), 10, FontName, FontColor, 138, 85, CornerNumber);
   TextLabel("multi5", "Spread: "+DoubleToStr( (MarketInfo (Symbol(),MODE_SPREAD)/10),1), 10, FontName, FontColor, 138, 100, CornerNumber);

Renders this result...

Download it and play with it and learn how to move it around...Have fun...PipPip..Jimdandy

label_1.mq4 3 kb

. . .
Of course we know that it HAS to be one of those periods... but still... that's the way it is..

No, it doesn't have to be one of those timeframes. Offline charts can use non-standard timeframes, e.g., M2, M6, M20, etc. See Chart Timeframes. If the chart's timeframe is non-standard, why not just return the custom timeframe? For example, the following code:

string Per(int thisperiod) {   
   switch (thisperiod) {
      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");
      default:         return(StringConcatenate("Custom TF: M", Period()));


To add comments, please log in or register