Errors, bugs, questions - page 1110

 
barabashkakvn:
Are you confused with MetaEditor5?
I trade on MT4 and synchronise codes via storage with my computer at work. My vault works on MetaEditor4.
 
paladin800:
I trade on MT4 and synchronise codes via storage with my computer at work. I have the vault on MetaEditor4 running.

Do you have a different login on MT5 and MT4?

 
barabashkakvn:

Do you have a different MT5 and MT4 login?

On MT4 I entered login and password as here on the 5 forum. You don't need to enter login and password as on 4.
 
barabashkakvn:

Is your MT5 and MT4 login different?

paladin800:
On MT4 I entered the login and password as here on the 5sh forum.
What a miracle! It turned out that I should have added the file to MetaEditor4 first , while I tried to pull it from the repository first.
 

Why isn't the class object created globally?

'CBaseClass' - declaration without type !Draft.mq5 12 1


#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
CBaseClass BaseClass; 
//+------------------------------------------------------------------+
int OnInit()
  {

   return(INIT_SUCCEEDED);
  }

//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {

  }
//+------------------------------------------------------------------+
void OnTick()
  {

  }
//+------------------------------------------------------------------+
class CBaseClass
 {
   protected:
   
   public:
   CBaseClass() {};
   ~CBaseClass() {};
 };
 
silhouette:

That's the way to do it.

#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
class CBaseClass;
CBaseClass BaseClass; 
//+------------------------------------------------------------------+
int OnInit()
  {

   return(INIT_SUCCEEDED);
  }

//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {

  }
//+------------------------------------------------------------------+
void OnTick()
  {

  }
//+------------------------------------------------------------------+
class CBaseClass
 {
   protected:
   
   public:
   CBaseClass() {};
   ~CBaseClass() {};
 };
 
TheXpert:

That's the way to do it.

Or rather like this? I.e. the class description should be strictly before the object is created?

Thank you.

#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
class CBaseClass
 {
   protected:
   
   public:
   CBaseClass() {};
   ~CBaseClass() {};
 };
CBaseClass BaseClass; 
//+------------------------------------------------------------------+
int OnInit()
  {

   return(INIT_SUCCEEDED);
  }

//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {

  }
//+------------------------------------------------------------------+
void OnTick()
  {

  }
//+------------------------------------------------------------------+
 
silhouette:

Well I wrote to make it work in case you want to keep the class definition at the bottom.

silhouette:

Is that correct? I.e. the class description should be strictly before the object is created?

if there is a declaration, the description can be anywhere.
 
TheXpert:

Well I wrote it to work in case you want to keep the class definition at the bottom.

In this case an error is detected

'CBaseClass' - struct undefined !Draft.mq5 13 1

 
How do I specify four colours for two graphical constructions? I set the colours, but then I can only get 2.


#property indicator_separate_window

#property indicator_buffers 10
#property indicator_plots 2                    
#property indicator_type1 DRAW_COLOR_CANDLES 
#property indicator_type2 DRAW_COLOR_CANDLES 



//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
        PlotIndexSetInteger(0,PLOT_LINE_COLOR,0, clrBlue);
        PlotIndexSetInteger(0,PLOT_LINE_COLOR,1, clrYellow);
       
        PlotIndexSetInteger(1,PLOT_LINE_COLOR,0, clrGreen);
        PlotIndexSetInteger(1,PLOT_LINE_COLOR,1, clrRed);
       
        Print("00 = " + PlotIndexGetInteger(0, PLOT_LINE_COLOR,0));
        Print("01 = " + PlotIndexGetInteger(0, PLOT_LINE_COLOR,1));
        Print("10 = " + PlotIndexGetInteger(1, PLOT_LINE_COLOR,0));
        Print("11 = " + PlotIndexGetInteger(1, PLOT_LINE_COLOR,1));
       
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const int begin,
                const double &price[])
  {
//---
  
//--- return value of prev_calculated for next call
   return(rates_total);
  }

Reason: