エラー、バグ、質問 - ページ 1110

 
barabashkakvn:
MetaEditor5と迷っていませんか?
MT4で取引し、職場のパソコンとストレージ経由でコードを同期しています。私の金庫はMetaEditor4で動作します。
 
paladin800:
MT4で取引し、職場のパソコンとストレージ経由でコードを同期しています。MetaEditor4上のVaultを起動させています。

MT5とMT4でログインが違うのですか?

 
barabashkakvn:

MT5とMT4のログインは別々ですか?

MT4で、ここの5フォーラムと同じようにログインとパスワードを入力しました。4.のようにログインとパスワードの入力は必要ありません
 
barabashkakvn:

MT5とMT4のログインが違いますか?

paladin800 です。
MT4で、ここ5shのフォーラムと同じようにログインとパスワードを入力しました。
なんという奇跡でしょう。最初にリポジトリからファイルを引っ張ってこようと したのに対し、先にMetaEditor 4に追加しておけばよかったことが判明しました。
 

なぜクラスオブジェクトは グローバルに作成されないのですか?

'CBaseClass' - 型のない宣言 !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:

そういうことなんです。

#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:

そういうことなんです。

というか、こんな感じ?I.e. クラスの記述は、オブジェクトが作成さ れる前に厳密にしておく必要があるのでしょうか?

ありがとうございます。

#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:

まあ、クラス定義を一番下に置いておきたい場合のために、うまくいくように書きました。

シルエットに なります。

そうなんですか?I.e. クラスの記述は、オブジェクトが作成さ れる前に厳密にしておく必要があるのでしょうか?

宣言があれば、記述はどこでもいい。
 
TheXpert:

まあ、クラス定義を一番下に置いておきたい場合のために、動作するように書いておきました。

この場合、エラーが検出されます

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

 
2つのグラフィックコンストラクションに 4つの色を指定するにはどうすればよいですか?色を設定しても、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);
  }