MT4
求各位大虾看一下这个ea 无法挂上去 平台信息查询
回复:0  浏览:331
  • 楼主admin 圈主
  • 2019-05-05 12:58
#property indicator_separate_window
int init()
   {
      return(0);
   }
int deinit()
   {
      ObjectsDeleteAll(WindowFind(WindowExpertName()),OBJ_LABEL);
      Comment("");
      return(0);
   }
int start()
   {
      iMain();
      return(0);
   }
void iMain()
   {
      //账户信息
      iDisplayInfo("AccountInfo1","公司名称:"+AccountCompany(),0,10,20,8,"",SeaGreen);
      iDisplayInfo("AccountInfo2","杠杆比例:1:"+AccountLeverage(),0,10,35,8,"",SeaGreen);
      iDisplayInfo("AccountInfo3","账户名称:"+AccountName(),0,10,50,8,"",SeaGreen);
      iDisplayInfo("AccountInfo4","账户编号:"+AccountNumber(),0,10,65,8,"",SeaGreen);
      iDisplayInfo("AccountInfo5","服务器名:"+AccountServer(),0,10,80,8,"",SeaGreen);
      iDisplayInfo("AccountInfo6","停止水平:"+AccountStopoutLevel(),0,200,50,8,"",SeaGreen);
      //平台规则
      iDisplayInfo("PlatformRule1","交易点差:"+DoubleToStr(MarketInfo(Symbol(),MODE_SPREAD),0),0,200,20,8,"",SeaGreen);
      iDisplayInfo("PlatformRule2","最小开仓:"+DoubleToStr(MarketInfo(Symbol(),MODE_MINLOT),2),0,200,65,8,"",SeaGreen);
      iDisplayInfo("PlatformRule3","最大开仓:"+DoubleToStr(MarketInfo(Symbol(),MODE_MAXLOT),2),0,200,80,8,"",SeaGreen);
      iDisplayInfo("PlatformRule4","单点价值:"+DoubleToStr(MarketInfo(Symbol(),MODE_MARGINREQUIRED),2),0,200,35,8,"",SeaGreen);
      if (MarketInfo(Symbol(),MODE_TRADEALLOWED)==1)
         {
            iDisplayInfo("PlatformRule5","智能交易:允许",0,200,95,8,"",SeaGreen);
         }
         else iDisplayInfo("PlatformRule5","智能交易:禁止",0,200,95,8,"",SeaGreen);
      if (IsDemo())
         {
            iDisplayInfo("PlatformRule6","账户类型:模拟",0,10,95,8,"",SeaGreen);
         }
         else iDisplayInfo("PlatformRule6","账户类型:真实",0,10,95,8,"",SeaGreen);
   }


void iDisplayInfo(string LableName,string LableDoc,int Corner,int LableX,int LableY,int DocSize,string DocStyle,color DocColor)
   {
      if (Corner == -1) return(0);
      int myWindowsHandle = WindowFind(WindowExpertName()); //获取当前指标名称所在窗口序号
      LableName=LableName+DoubleToStr(myWindowsHandle,0);
      ObjectCreate(LableName, OBJ_LABEL, myWindowsHandle, 0, 0); //建立卷标对象
      ObjectSetText(LableName, LableDoc, DocSize, DocStyle,DocColor); //定义对象属性
      ObjectSet(LableName, OBJPROP_CORNER, Corner); //确定坐标原点,0-左上角,1-右上角,2-左下角,3-右下角,-1-不显示
      ObjectSet(LableName, OBJPROP_XDISTANCE, LableX); //定义横坐标,单位像素
      ObjectSet(LableName, OBJPROP_YDISTANCE, LableY); //定义纵坐标,单位像素
   }