来自一个 "傻瓜 "的问题 - 页 105

 
uncleVic:
更详细一点...日志中的下一行(或更好的几行)是什么?

2012.02.22 12:51:15 st (EURUSD,H1) CExpertBase::SetOtherSeries: 更改时间序列是禁止的
2012.02.22 12:51:15 st (EURUSD,H1) CExpertBase::SetPriceSeries: 更改时间序列是禁止的

无他

 
openlive:

2012.02.22 12:51:15 st (EURUSD,H1) CExpertBase::SetOtherSeries: 更改时间序列是禁止的
2012.02.22 12:51:15 st (EURUSD,H1) CExpertBase::SetPriceSeries: 更改时间序列是禁止的

无他

我在某个地方找到了一个旧模块。请附上你在向导中得到的专家顾问的代码。这不是秘密,是吗?
 
uncleVic:
某处有一个旧式的模块。请附上在向导中获得的EA代码。这不是什么秘密,是吗?
//+------------------------------------------------------------------+
//|                                               Expert_Candles.mq5 |
//|                        Copyright 2010, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2010, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Include                                                          |
//+------------------------------------------------------------------+
#include <Expert\Expert.mqh>
#include <Expert\Signal\SignalCandles.mqh>
#include <Expert\Trailing\TrailingNone.mqh>
#include <Expert\Money\MoneyFixedLot.mqh>
//+------------------------------------------------------------------+
//| Inputs                                                           |
//+------------------------------------------------------------------+
//--- inputs for expert
input string Inp_Expert_Title              ="Expert_Candles";
int          Expert_MagicNumber            =28148;
bool         Expert_EveryTick              =false;
//--- inputs for signal
input int    Inp_Signal_Candles_Range      =3;
input int    Inp_Signal_Candles_Minimum    =50;
input double Inp_Signal_Candles_ShadowBig  =0.5;
input double Inp_Signal_Candles_ShadowSmall=0.2;
input double Inp_Signal_Candles_Limit      =0.0;
input double Inp_Signal_Candles_StopLoss   =2.0;
input double Inp_Signal_Candles_TakeProfit =1.0;
input int    Inp_Signal_Candles_Expiration =4;
//--- inputs for money
input double Inp_Money_FixLot_Percent      =10.0;
input double Inp_Money_FixLot_Lots         =0.1;
//+------------------------------------------------------------------+
//| Global expert object                                             |
//+------------------------------------------------------------------+
CExpert ExtExpert;
//+------------------------------------------------------------------+
//| Initialization function of the expert                            |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- Initializing expert
   if(!ExtExpert.Init(Symbol(),Period(),Expert_EveryTick,Expert_MagicNumber))
     {
      //--- failed
      printf(__FUNCTION__+": error initializing expert");
      ExtExpert.Deinit();
      return(-1);
     }
//--- Creation of signal object
   CSignalCandles *signal=new CSignalCandles;
   if(signal==NULL)
     {
      //--- failed
      printf(__FUNCTION__+": error creating signal");
      ExtExpert.Deinit();
      return(-2);
     }
//--- Add signal to expert (will be deleted automatically))
   if(!ExtExpert.InitSignal(signal))
     {
      //--- failed
      printf(__FUNCTION__+": error initializing signal");
      ExtExpert.Deinit();
      return(-3);
     }
//--- Set signal parameters
   signal.Range(Inp_Signal_Candles_Range);
   signal.Minimum(Inp_Signal_Candles_Minimum);
   signal.ShadowBig(Inp_Signal_Candles_ShadowBig);
   signal.ShadowSmall(Inp_Signal_Candles_ShadowSmall);
   signal.Limit(Inp_Signal_Candles_Limit);
   signal.StopLoss(Inp_Signal_Candles_StopLoss);
   signal.TakeProfit(Inp_Signal_Candles_TakeProfit);
   signal.Expiration(Inp_Signal_Candles_Expiration);
//--- Check signal parameters
   if(!signal.ValidationSettings())
     {
      //--- failed
      printf(__FUNCTION__+": error signal parameters");
      ExtExpert.Deinit();
      return(-4);
     }
//--- Creation of trailing object
   CTrailingNone *trailing=new CTrailingNone;
   if(trailing==NULL)
     {
      //--- failed
      printf(__FUNCTION__+": error creating trailing");
      ExtExpert.Deinit();
      return(-5);
     }
//--- Add trailing to expert (will be deleted automatically))
   if(!ExtExpert.InitTrailing(trailing))
     {
      //--- failed
      printf(__FUNCTION__+": error initializing trailing");
      ExtExpert.Deinit();
      return(-6);
     }
//--- Set trailing parameters
//--- Check trailing parameters
   if(!trailing.ValidationSettings())
     {
      //--- failed
      printf(__FUNCTION__+": error trailing parameters");
      ExtExpert.Deinit();
      return(-7);
     }
//--- Creation of money object
   CMoneyFixedLot *money=new CMoneyFixedLot;
   if(money==NULL)
     {
      //--- failed
      printf(__FUNCTION__+": error creating money");
      ExtExpert.Deinit();
      return(-8);
     }
//--- Add money to expert (will be deleted automatically))
   if(!ExtExpert.InitMoney(money))
     {
      //--- failed
      printf(__FUNCTION__+": error initializing money");
      ExtExpert.Deinit();
      return(-9);
     }
//--- Set money parameters
   money.Percent(Inp_Money_FixLot_Percent);
   money.Lots(Inp_Money_FixLot_Lots);
//--- Check money parameters
   if(!money.ValidationSettings())
     {
      //--- failed
      printf(__FUNCTION__+": error money parameters");
      ExtExpert.Deinit();
      return(-10);
     }
//--- Tuning of all necessary indicators
   if(!ExtExpert.InitIndicators())
     {
      //--- failed
      printf(__FUNCTION__+": error initializing indicators");
      ExtExpert.Deinit();
      return(-11);
     }
//--- ok
   return(0);
  }
//+------------------------------------------------------------------+
//| Deinitialization function of the expert                          |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
   ExtExpert.Deinit();
  }
//+------------------------------------------------------------------+
//| Function-event handler "tick"                                    |
//+------------------------------------------------------------------+
void OnTick()
  {
   ExtExpert.OnTick();
  }
//+------------------------------------------------------------------+
//| Function-event handler "trade"                                   |
//+------------------------------------------------------------------+
void OnTrade()
  {
   ExtExpert.OnTrade();
  }
//+------------------------------------------------------------------+
//| Function-event handler "timer"                                   |
//+------------------------------------------------------------------+
void OnTimer()
  {
   ExtExpert.OnTimer();
  }
//+------------------------------------------------------------------+
 
mql5:
谢谢你,请允许我问一个简单的问题--两个进程从同一个网站上读取信息,这是否可以接受?
 
openlive:
奇怪的是,这段代码竟然可以编译。
#include <Expert\Signal\SignalCandles.mqh> - это старый модуль


PS 该文件可能只是附加的。

 
uncleVic:
奇怪的是,这段代码竟然可以编译。


PS 该文件可能只是附加的。

问题是,测试器用起来很好......但它在交易中能用吗?

据我所知,没有新的模块,那么我应该在这个模块中做什么,如果不难的话?

 
openlive:

问题是,测试器用起来很好......但它在交易中能用吗?

据我所知,没有新的模块? 那我在这个模块中要做什么,如果不难的话?

它将发挥作用。你必须在CSignalCandles::ValidationSettings()方法中插入它,在最开始。

//--- call of the method of the parent class
   if(!CExpertSignal::ValidationSettings()) return(false);
 
uncleVic:

它将发挥作用。为了避免它,在CSignalCandles::ValidationSettings()方法中插入它,在最开始。

bool CSignalCandles::ValidationSettings()
{
if(!CExpertSignal::ValidationSettings()) return(false);

if(m_range<=0)
{
printf(__FUNCTION__+": candles range must be greater than 0");
return(false);
}
//--- ok
return(true);
}
所以它已经存在了。
 
220Volt:
谢谢你,请允许我问一个简单的问题--两个进程从同一区域读取数据是否可以接受?
是的,阅读时没有任何问题。
 
openlive:

它已经在这里了。
任务...请附上信号模块(我没有)。让我们看一看。