求教大佬,我mql5中调用iAlligator指标,回测的时候提示“无法加载指示器“Alligator”【4002】”,求解答。 新评论 Tang_daxia 2023.04.04 03:40 我mql5中调用iAlligator指标,回测的时候提示“无法加载指示器“Alligator”【4002】”,ima指标是正常的。 #property copyright "Copyright 2023, MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "1.00" #property strict #property tester_indicator "indicator_name.ex5" #property description "All the other parameters are similar to the standard Alligator." input int AlligatorJawPeriod = 13; input int AlligatorTeethPeriod = 8; input int AlligatorLipsPeriod = 5; input int AlligatorShif = 8; input int AlligatorMethod = MODE_SMMA; // Smoothed Moving Average input int AlligatorAppliedPrice = PRICE_MEDIAN; // Median price input int MAPeriod = 89; input int MAMethod = MODE_EMA; // Exponential Moving Average input int MAAppliedPrice = PRICE_CLOSE; // Close price int OnInit() { IndicatorSetInteger(INDICATOR_DIGITS, _Digits); return(INIT_SUCCEEDED); } void OnDeinit(const int reason) { } void OnTick() { int jawHandle = iAlligator(NULL, PERIOD_M12, AlligatorJawPeriod, 0, AlligatorLipsPeriod, 0, AlligatorTeethPeriod, 0, MODE_SMMA, PRICE_MEDIAN); int teethHandle = jawHandle + 1; int lipsHandle = jawHandle + 2; int maHandle = iMA(_Symbol, PERIOD_M12, MAPeriod, 0, MODE_EMA, MAAppliedPrice); double jaw[], teeth[], lips[], ma[]; ArraySetAsSeries(jaw, true); ArraySetAsSeries(teeth, true); ArraySetAsSeries(lips, true); ArraySetAsSeries(ma, true); CopyBuffer(jawHandle, 0, 0, 3, jaw); CopyBuffer(teethHandle, 0, 0, 3, teeth); CopyBuffer(lipsHandle, 0, 0, 3, lips); CopyBuffer(maHandle, 0, 0, 5, ma); bool isjawHandlegatorUp = jaw[0] > jaw[1] && teeth[0] > teeth[1] && lips[0] > lips[1]; bool isMAUp = ma[0] > ma[1] && ma[1] > ma[2] && ma[2] > ma[3]; if (isjawHandlegatorUp && isMAUp) { double stopLossPrice = NormalizeDouble(iLow(_Symbol, PERIOD_M12, iLowest(_Symbol, PERIOD_M12, MODE_LOW, 30, 1)), _Digits); double volume = 0.05; MqlTradeRequest request; MqlTradeResult result; ZeroMemory(request); request.action = TRADE_ACTION_DEAL; request.symbol = _Symbol; request.volume = volume; request.type = ORDER_TYPE_BUY; request.price = NormalizeDouble(SymbolInfoDouble(Symbol(),SYMBOL_ASK), _Digits); request.sl = stopLossPrice; request.tp = 0; request.deviation = 5; request.magic = 12345; request.expiration = 0; request.comment = "jawHandlegatorMA trade"; OrderSend(request, result); } } //+------------------------------------------------------------------+ 附加的文件: 17.png 192 kb 新评论 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录