当我尝试编译 EA 时,出现了两个错误:"INIT FAILED" - expression not boolean。
这两个错误是一样的。
INIT_FAILED" - expression not boolean Auto ADX.mq5 第 279 行第 20 列
INIT_FAILED"--表达式不是布尔值 Auto ADX.mq5 第 285 行第 17 列。
代码中的错误出在哪里?感谢您的帮助。
Hatee
Heinz Thieme :
当我尝试编译 EA 时,出现了两个错误:"INIT FAILED" - expression not boolean。
两个错误都一样。
INIT_FAILED" - expression not boolean Auto ADX.mq5 第 279 行第 20 列
INIT_FAILED' - 表达式非布尔 Auto ADX.mq5 第 285 行第 17 列。
代码中的错误出在哪里?感谢您的帮助。
Hatee
//+------------------------------------------------------------------+ //| 自由保证金交易的手数或风险(百分比) //| 自由保证金交易的手数或风险(百分比) //| 自由保证金交易的手数或风险(百分比) //... //+------------------------------------------------------------------+ bool LotsOrRisk(const double lots,const double risk,const int digits_adjust) { if(lots<0.0 && risk<0.0) { Print(__FUNCTION__,", ERROR: Parameter (\"lots\" or \"risk\") can't be less than zero"); return(false); } if(lots==0.0 && risk==0.0) { Print(__FUNCTION__,", ERROR: Trade is impossible: You have set \"lots\" == 0.0 and \"risk\" == 0.0"); return(false); } if(lots>0.0 && risk>0.0) { Print(__FUNCTION__,", ERROR: Trade is impossible: You have set \"lots\" > 0.0 and \"risk\" > 0.0"); return(false); } if(lots>0.0) { string err_text=""; if(!CheckVolumeValue(lots,err_text)) { Print(__FUNCTION__,", ERROR: ",err_text); return(false); } } else if(risk>0.0) { if(m_money!=NULL) delete m_money; m_money=new CMoneyFixedMargin; if(m_money!=NULL) { if(!m_money.Init(GetPointer(m_symbol),Period(),m_symbol.Point()*digits_adjust)) return(false); m_money.Percent(risk); } else { Print(__FUNCTION__,", ERROR: Object CMoneyFixedMargin is NULL"); return(false); } } //--- return(true); }
自动 ADX:
基于 iADX (平均方向运动指数,ADX) 指标的智能交易系统。
作者: Vladimir Karputov