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

MySQL wrapper - MetaTrader 4용 라이브러리

조회수:
22037
평가:
(10)
게시됨:
2008.12.15 07:13
업데이트됨:
2016.11.22 07:32
\MQL4\Include\
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

Author:

Russell

There are a few solutions around for reading and writing to MySQL databases. Writing to MySQL is in general not a big problem in MT4. But the reading part is kinda hard. MT4 can't handle C++ structures very well, only the native types such as int, double and string are supported. Other solutions use a SELECT statement CONCATing the wanted fields. I found this solution unstable and therefor a high error risk. The wrapper translates two MySQL structures to the types MT4 can handle. All orignal functions of libmysql are exported in the wrapper as well. Full sourcecode available in zip-file.

Example:

#include <mysql_v2.0.4.mqh>

int init(){
   Print(MT4_mysql_wrapper_version());
   MySQL_Init();
   getDB();
   return(0);
}

int deinit(){
   MySQL_DeInit();
   return(0);
}

int start(){
   return(0);
}

void getDB(){ 
   //--------------v    set this to the number of fields you're selecting
   string lsData[][2];
   string lsQuery = "SELECT tableid,some_value FROM `mytable` INNER JOIN .... WHERE ... ORDER BY ...";
   MySQL_FetchArray(lsQuery, lsData); 
   for (int i = 0; i < ArrayRange(lsData,0); i++){
      for (int j = 0; j < ArrayRange(lsData,1); j++){
         Print(i+","+j+": "+lsData[i][j]);
      }
   }
}

Credits:

https://www.mql5.com/en/users/gc1 for pointing out some bugs


Install:

mysql_v2.0.2.mqh - goes to your include directory

mysql_wrapper_v1.0.2.zip

- open the zip

- extract mysql_wrapper_v1.0.2.zip\mysql_wrapper\Debug\mysql_wrapper.dll to C:\Windows\system32\


Discussion:

https://www.mql5.com/en/forum/111508


Update:

mysql_v2.0.4.mqh - has some extra error checks

mysql_wrapper_v1.0.3.zip - repack VS2008



Exoticwavein Exoticwavein

The indicator writes the history to the CSV file.

Internal Bar Strength (IBS) Internal Bar Strength (IBS)

It is calculated as the moving average of the values of the internal bars strength.

OrdersSuite Revision 2 OrdersSuite Revision 2

Functions for processing the orders of Spot currency pairs, Spot Gold and Spot Silver with error handling. OrderProcess() strengthened. New functions Lots, OrderCloseByRetracement, OrderModifyTS and OrderSendI added. Revision 2 has been used to run expert

Candle Patterns Candle Patterns

Visual and Audio alerts when reversal or continuation candle patterns occur.