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); }
你对MetaEditor5感到困惑吗?
我在MT4上交易,并通过存储与我工作中的电脑进行代码同步。我把金库放在MetaEditor4上运行。
你在MT5和MT4上有不同的登录方式吗?
你是否有不同的MT5和MT4登录?
你的MT5和MT4登录方式不同吗?
在MT4上,我输入了5sh论坛上的登录和密码。
为什么不在全局范围内创建类对象?
'CBaseClass' - 没有类型的声明 !Draft.mq5 12 1
这是个好办法。
这是个好办法。
或者说像这样?也就是说,在创建对象 之前,类的描述应该是严格的?
谢谢你。
好吧,我写的是为了让它发挥作用,以防你想在底部保留类的定义。
这样说对吗?也就是说,在创建对象 之前,类的描述应该是严格的?
好吧,我写了它,以备你想在底部保留类的定义。
在这种情况下,会检测到一个错误
'CBaseClass' - 结构未定义 !Draft.mq5 13 1
#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);
}