Hull Suite By Insilico for MT4 外汇EA

Hull Suite By Insilico for MT4 外汇EA-EA侦探社 - 全球领先的MQL5官网外汇EA机器人MT4自动化交易EA资源免费分享网站
Hull Suite By Insilico for MT4 外汇EA
此内容为免费资源,请登录后查看
0积分
免费资源

如果免费资源下载的文件为TXT文档

请联系站长更新!站长微信:Lv596999  Telegram:@eapoj

“Mql5官网”板块的EA基本都有,大部分是无限制NODLL版,NODLL版本MT1420升级,大多数不可用!这些EA来源为国外花钱买过来的

有需要,请联系站长!

“EA测评”板块资源全部现有,看见不错的,可以联系站长看EA在确定是否收费

“无限制EA”板块,大部分免费,下载文件全部存在,都可以免费下载

站长硬盘EA太多,因大部分时间做交易,做风控,没太多时间更新下载地址,请谅解!

需要更新下载文件,请联系站长微信!国外朋友请联系Telegram。


To get access to MT5 version please click here.

– This is a conversion from TradingView: “Hull Suite” By “Insilico”.

– This is a light-load processing and non-repaint indicator.

– You can message in private chat for further changes you need.

note: Color filled areas and colored candles are not supported in MT4 version.

Here is the source code of a simple Expert Advisor operating based on signals from Hull Suite.

#property strict

input string EA_Setting="";
input int magic_number=1234;
input double fixed_lot_size=0.01; // select fixed lot size

enum MA_TYPE{HMA, THMA, EHMA};
input string    HULL_Setting="";
input MA_TYPE modeSwitch = HMA; //Hull Variation
input ENUM_APPLIED_PRICE src =PRICE_CLOSE; //Source
input int length = 55 ; //Length
input int lengthMult = 1; //Multiplier
input bool useAlert=false; //Enable Alerts
input bool usePushNotification=false; //Enable Mobile Notification

void OnTick()
  {
      if(!isNewBar()) return;
         
      bool buy_condition=true;
      buy_condition &= (BuyCount()==0);
      buy_condition &= (IsHULLBuy(1));
      if(buy_condition) 
      {
         CloseSell();
         Buy();
      }
         
      bool sell_condition=true;
      sell_condition &= (SellCount()==0);
      sell_condition &= (IsHULLSell(1));
      if(sell_condition) 
      {
         CloseBuy();
         Sell();
      }
  }

bool IsHULLBuy(int index)
{
   double val1=iCustom(_Symbol, PERIOD_CURRENT,
    "Market\\Hull Suite By Insilico for MT4",
    modeSwitch, src, length, lengthMult, useAlert, usePushNotification, 15, index);
   double val2=iCustom(_Symbol, PERIOD_CURRENT,
    "Market\\Hull Suite By Insilico for MT4",
    modeSwitch, src, length, lengthMult, useAlert, usePushNotification, 15, index+2);
   return val1>val2;
}

bool IsHULLSell(int index)
{
   double val1=iCustom(_Symbol, PERIOD_CURRENT,
    "Market\\Hull Suite By Insilico for MT4",
    modeSwitch, src, length, lengthMult, useAlert, usePushNotification, 15, index);
   double val2=iCustom(_Symbol, PERIOD_CURRENT,
    "Market\\Hull Suite By Insilico for MT4",
    modeSwitch, src, length, lengthMult, useAlert, usePushNotification, 15, index+2);
   return val1<val2;
}

int BuyCount()
{
   int counter=0;
   for(int i=0;i<OrdersTotal();i++)
   {
      if(OrderSelect(i, SELECT_BY_POS)==false) continue;
      if(OrderSymbol()!=_Symbol) continue;
      if(OrderMagicNumber()!=magic_number) continue;
      if(OrderType()==OP_BUY) counter++;
   }
   return counter;
}

int SellCount()
{
   int counter=0;
   for(int i=0;i<OrdersTotal();i++)
   {
      if(OrderSelect(i, SELECT_BY_POS)==false) continue;
      if(OrderSymbol()!=_Symbol) continue;
      if(OrderMagicNumber()!=magic_number) continue;
      if(OrderType()==OP_SELL) counter++;
   }
   return counter;
}

void Buy()
{
   if(OrderSend(_Symbol, OP_BUY, fixed_lot_size, Ask, 3, 0, 0, NULL, magic_number, 0, clrNONE)==-1)
   {
      Print("Error Executing Order: ", GetLastError());
      //ExpertRemove();
   }
}

void Sell()
{
   if(OrderSend(_Symbol, OP_SELL, fixed_lot_size, Bid, 3, 0, 0, NULL, magic_number, 0, clrNONE)==-1)
   {
      Print("Error Executing Order: ", GetLastError());
      //ExpertRemove();
   }
}

void CloseBuy()
{
   for(int i=OrdersTotal()-1;i>=0;i--)
   {
      if(OrderSelect(i, SELECT_BY_POS)==false) continue;
      if(OrderSymbol()!=_Symbol) continue;
      if(OrderMagicNumber()!=magic_number) continue;
      if(OrderType()==OP_BUY) 
         if(OrderClose(OrderTicket(), OrderLots(), Bid, 3, clrNONE)==false)
         {
            Print("Error Closing Position: ", GetLastError());
         }
   }
}

void CloseSell()
{
   for(int i=OrdersTotal()-1;i>=0;i--)
   {
      if(OrderSelect(i, SELECT_BY_POS)==false) continue;
      if(OrderSymbol()!=_Symbol) continue;
      if(OrderMagicNumber()!=magic_number) continue;
      if(OrderType()==OP_SELL) 
         if(OrderClose(OrderTicket(), OrderLots(), Ask, 3, clrNONE)==false)
         {
            Print("Error Closing Position: ", GetLastError());
         }
   }
}

datetime timer=NULL;
bool isNewBar()
{
   datetime candle_start_time= (int)(TimeCurrent()/(PeriodSeconds()))*PeriodSeconds();
   if(timer==NULL) {}
   else if(timer==candle_start_time) return false;
   timer=candle_start_time;
   return true;
}

© 版权声明
THE END
喜欢就支持一下吧
点赞18 分享
相关推荐