無料でロボットをダウンロードする方法を見る
Telegram上で私たちを見つけてください。
私たちのファンページに参加してください
興味深いスクリプト?
それではリンクにそれを投稿してください。-
他の人にそれを評価してもらいます
記事を気に入りましたか?MetaTrader 5ターミナルの中でそれを試してみてください。
ライブラリ

MySQL wrapper - MetaTrader 4のためのライブラリ

ビュー:
22117
評価:
(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.