거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Facebook에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
라이브러리

Login To Trade Account - MetaTrader 5용 라이브러리

조회수:
9030
평가:
(35)
게시됨:
2016.10.10 15:41
업데이트됨:
2016.12.13 15:37
\MQL5\Include\ \MQL5\Experts\
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

After the "Account disabled" error occurs (this error on the weekends, when trade servers of exchanges are offline), it is necessary to manually log in to the trading account. To do that, go to "File" and select "Login to trade account". But doing this manually is uncomfortable and tedious. It also manually keeps track of connection loss after the "Account disabled" error.

The "LoginToTradeAccount.mqh" library allows to automate the process of connecting to a trade server.

Example of Use

The EA checks the connection to the trade server (the TERMINAL_CONNECTED identifier) every 12 seconds in the OnTimer() function. If the connection state is "0", the library is called:

//+------------------------------------------------------------------+
//|                                           TestAccountDisable.mq5 |
//|                        Copyright 2016, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"

#include <LoginToTradeAccount.mqh>
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- create timer
   EventSetTimer(12);

u//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//--- destroy timer
   EventKillTimer();

  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
u//---

  }
//+------------------------------------------------------------------+
//| Timer function                                                   |
//+------------------------------------------------------------------+
void OnTimer()
  {
u//---
   static bool cleaner=false;
   if(!cleaner)
     {
      long rezult=TerminalInfoInteger(TERMINAL_CONNECTED);
      Comment("TERMINAL_CONNECTED: ",IntegerToString(rezult));
      if(rezult==0)
         LoginToTradeAccount();
     }
   else
      Comment("");
   cleaner=!cleaner;
  }
//+------------------------------------------------------------------+

The "TestAccountDisable.mq5" example file is attached at the end of description.

MetaQuotes Ltd에서 러시아어로 번역함.
원본 코드: https://www.mql5.com/ru/code/16049

Exp_PFE_Extr Exp_PFE_Extr

The Exp_PFE_Extr breakout trading system based on the signals of the PFE oscillator.

MFIdivCandle MFIdivCandle

The MFIdivCandle indicator. Colors the candles based on the MFI oscillator.

Normalized_Volume_Oscillator_HTF Normalized_Volume_Oscillator_HTF

The Normalized_Volume_Oscillator indicator with the timeframe selection option available in input parameters.

PPO_Cloud PPO_Cloud

Oscillator that represents the relative smoothed rate of price change.