MQL4リファレンス

のんびりと日本語化中です。なお、リンク先(公式ページ)に手を付ける予定はありません。と思っていたら、既に日本語化している方がおりました。MT4でEA自作しちゃお~ T.Yさん、情報感謝です!

定義済み変数(Predefined Variables)
_Digits 小数点以下桁数
_Point 最小価格変動幅
_LastError 直近のエラーコード
_Period 時間枠
_RandomSeed 乱数の現在値
_StopFlag MQL4プログラム停止フラグ
_Symbol 通貨ペア名
_UninitReason 初期化解除の理由コード
Ask 買値
Bars バー数
Bid 売値
Close 終値の時系列配列
Digits 小数点以下桁数(互換用)
High 高値の時系列配列
Low 安値の時系列配列
Open 始値の時系列配列
Point 最小価格変動幅(互換用)
Time バー開始時刻の時系列配列
Volume ティック数の時系列配列
共通関数(Common Functions)
Alert ポップアップアラート
CheckPointer オブジェクトポインタの型
Comment チャート上コメント
CryptEncode 配列エンコード
CryptDecode 配列デコード
DebugBreak デバッグ時ブレイクポイント
ExpertRemove EA停止及びチャートから削除
GetPointer クラスオブジェクトポインタ
GetTickCount 経過時間(ミリ秒)
GetMicrosecondCount 経過時間(マイクロ秒)
MessageBox メッセージボックス
PeriodSeconds 期間内の秒数
PlaySound サウンドファイル再生
Print ログファイル出力
PrintFormat ログファイル出力(定義済フォーマット)
ResetLastError _LastError変数のゼロリセット
ResourceCreate 画像リソース作成
ResourceFree 動的作成リソース削除
ResourceReadImage リソースデータ読込み
ResourceSave リソースデータファイル保存
SendFTP FTP送信
SendMail メール送信
SendNotification プッシュ通知
Sleep プログラム実行一時停止(指定間隔)
TerminalClose MT4終了
TesterStatistics バックテスト統計値
WebRequest HTTP要求送信
ZeroMemory 参照渡し変数リセット
配列関数(Array Functions)
ArrayBsearch 数値配列検索
ArrayCopy 配列コピー
ArrayCompare 同型配列比較
ArrayFree 配列メモリ解放
ArrayGetAsSeries 配列インデックス方向
ArrayInitialize 配列既定値設定(全要素)
ArrayFill 配列既定値設定(特定要素)
ArrayIsSeries 時系列配列チェック
ArrayIsDynamic 動的配列チェック
ArrayMaximum 数値配列検索(最大値要素)
ArrayMinimum 数値配列検索(最小値要素)
ArrayRange 配列要素数(指定次元)
ArrayResize 配列要素数再設定
ArraySetAsSeries 配列インデックス方向設定
ArraySize 配列要素数
ArraySort 数値配列昇順ソート
ArrayCopyRates レート配列コピー
ArrayCopySeries 時系列配列コピー
ArrayDimension 配列次元数
型変換関数(Conversion Functions)
CharToString uchar文字コード→文字変換
DoubleToString 浮動小数点数→文字列変換
EnumToString 列挙値→文字列変換
NormalizeDouble 小数点以下の指定桁数丸め
StringToDouble 文字列→浮動小数点数変換
StringToInteger 文字列→整数変換
StringToTime 文字列→時刻変換
TimeToString 時刻→文字列変換
IntegerToString 整数→文字列変換
ShortToString ushort文字コード→文字変換
ShortArrayToString ushort配列→文字列変換
StringToShortArray 文字列→ushort配列
CharArrayToString uchar配列→文字列
StringToCharArray 文字列→uchar配列
ColorToARGB 色→ARGB変換
ColorToString 色→RGB文字列変換
StringToColor 文字列→色変換
StringFormat 文字列(定義済フォーマット)
CharToStr uchar文字コード→文字変換(互換用)
DoubleToStr 浮動小数点数→文字列変換(互換用)
StrToDouble 文字列→浮動小数点数変換(互換用)
StrToInteger 文字列→整数変換(互換用)
StrToTime 文字列→時刻変換(互換用)
TimeToStr 時刻→文字列変換(互換用)
数学関数(Math Functions)
MathAbs 絶対値
MathArccos アークコサイン
MathArcsin アークサイン
MathArctan アークタンジェント
MathCeil 切上げ整数
MathCos コサイン
MathExp eの塁乗
MathFloor 切捨て整数
MathLog 自然対数
MathLog10 底が10の対数
MathMax 2数の最大値
MathMin 2数の最小値
MathMod 剰余
MathPow 塁乗
MathRand 乱数
MathRound 丸め整数
MathSin サイン
MathSqrt 平方根
MathSrand 乱数初期値
MathTan タンジェント
MathIsValidNumber 数値チェック
文字列関数(String Functions)
StringAdd 文字列追加
StringBufferLen 文字列バッファ数
StringCompare 文字列比較
StringConcatenate 文字列連結
StringFill 文字書込み
StringFind 文字列検索
StringGetCharacter 指定位置文字
StringInit 文字列初期化
StringLen 文字数
StringReplace 文字列置換
StringSetCharacter 指定位置文字置換
StringSplit 文字列分割
StringSubstr 文字列抽出
StringToLower 大文字→小文字変換
StringToUpper 小文字→大文字変換
StringTrimLeft 左側スペース削除
StringTrimRight 右側スペース削除
StringGetChar 指定位置文字(互換用)
StringSetChar 指定位置文字置換(互換用)
日付・時刻(Date and Time)
TimeCurrent 現在のサーバー時間
TimeLocal PCのローカル時間
TimeGMT ローカルPCのGMT時間(サマータイム切替考慮)
※サーバー側ではない
TimeDaylightSavings ローカルPCのサマータイムの補正値
※サーバー側ではない
TimeGMTOffset GMT時間(サマータイム切替考慮)とローカルPC時間との差
※サーバー時間との差ではない
TimeToStruct datetime→MqlDateTime変換
StructToTime MqlDateTime→datetime変換
Year サーバー時間の年
Month サーバー時間の月
Day サーバー時間の日
Hour サーバー時間の時
Minute サーバー時間の分
Seconds サーバー時間の秒
DayOfWeek サーバー時間の曜日
DayOfYear サーバー時間の経過日数(1年)
TimeYear 指定時間の年
TimeMonth 指定時間の月
TimeDay 指定時間の日
TimeHour 指定時間の時
TimeMinute 指定時間の分
TimeSeconds 指定時間の秒
TimeDayOfWeek 指定時間の曜日
TimeDayOfYear 指定時間の経過日数(1年)
口座情報(Account Information)
AccountInfoDouble 口座のプロパティ取得(double型)
AccountInfoInteger 口座のプロパティ取得(int型)
AccountInfoString 口座のプロパティ取得(string型)
AccountBalance 口座残高
AccountCredit 口座クレジット
AccountCompany FX業者名
AccountCurrency 口座通貨名
AccountEquity 有効証拠金
AccountFreeMargin 余剰証拠金
AccountFreeMarginCheck 余剰証拠金チェック
AccountFreeMarginMode 余剰証拠金の計算モード
AccountLeverage 口座レバレッジ
AccountMargin 証拠金
AccountName 口座名
AccountNumber 口座番号
AccountProfit 損益
AccountServer 接続サーバー名
AccountStopoutLevel ストップアウトレベル(強制ロスカット)
AccountStopoutMode ストップアウトの計算モード
検査(Checkup)
GetLastError 直近のエラーコード
IsStopped MQL4プログラムの停止チェック
UninitializeReason 未初期化の理由コード
MQLInfoInteger MQL4プログラムのプロパティ取得(int型)
MQLInfoString MQL4プログラムのプロパティ取得(string型)
MQLSetInteger MQL4プログラム環境のプロパティ設定(int型)
TerminalInfoInteger ターミナルのプロパティ取得(int型)
TerminalInfoDouble ターミナルのプロパティ取得(double型)
TerminalInfoString ターミナルのプロパティ取得(string型)
Symbol 通貨ペア名
Period 時間足
Digits 価格の小数点以下桁数
Point 1ポイント当たりの価格の最小単位(小数点)
IsConnected サーバー接続チェック
IsDemo デモ口座チェック
IsDllsAllowed DLL許可チェック
IsExpertEnabled 自動売買許可チェック(全EA対象)
IsLibrariesAllowed ライブラリー許可チェック
IsOptimization 最適化モードチェック
IsTesting バックテストモードチェック
IsTradeAllowed 自動売買許可チェック(EA個別)
IsTradeContextBusy トレードビジーチェック
IsVisualMode ビジュアルモードチェック
TerminalCompany ターミナル提供会社名
TerminalName ターミナル名
TerminalPath ターミナルパス
市場情報(Market Info)
MarketInfo 「気配値表示」ウィンドウの各種情報
SymbolsTotal 「気配値表示」ウィンドウの通貨ペア数
SymbolName 「気配値表示」ウィンドウの通貨ペア名
SymbolSelect 「気配値表示」ウィンドウの通貨ペア追加・削除
SymbolInfoDouble 通貨ペアのプロパティ取得(double型)
SymbolInfoInteger 通貨ペアのプロパティ取得(int型)
SymbolInfoString 通貨ペアのプロパティ取得(string型)
SymbolInfoTick 特定通貨ペアの現在価格
SymbolInfoSessionQuote クォートセッション
SymbolInfoSessionTrade トレードセッション
時系列・インジケーターアクセス(Timeseries and Indicators Access)
SeriesInfoInteger Returns information about the state of historical data
RefreshRates Refreshing of data in pre-defined variables and series arrays
CopyRates Gets history data of the Rates structure for a specified symbol and period into an array
CopyTime Gets history data on bar opening time for a specified symbol and period into an array
CopyOpen Gets history data on bar opening price for a specified symbol and period into an array
CopyHigh Gets history data on maximal bar price for a specified symbol and period into an array
CopyLow Gets history data on minimal bar price for a specified symbol and period into an array
CopyClose Gets history data on bar closing price for a specified symbol and period into an array
CopyTickVolume Gets history data on tick volumes for a specified symbol and period into an array
Bars Returns the number of bars count in the history for a specified symbol and period
iBars Returns the number of bars on the specified chart
iBarShift Returns the index of the bar which covers the specified time
iClose Returns Close price value for the bar of specified symbol with timeframe and shift
iHigh Returns High price value for the bar of specified symbol with timeframe and shift
iHighest Returns the shift of the maximum value over a specific number of bars
iLow Returns Low price value for the bar of indicated symbol with timeframe and shift
iLowest Returns the shift of the lowest value over a specific number of bars
iOpen Returns Open price value for the bar of specified symbol with timeframe and shift
iTime Returns time value for the bar of specified symbol with timeframe and shift
iVolume Returns Tick Volume value for the bar of specified symbol with timeframe and shift
チャート操作(Chart Operations)
ChartApplyTemplate Applies a specific template from a specified file to the chart
ChartSaveTemplate Saves current chart settings in a template with a specified name
ChartWindowFind Returns the number of a subwindow where an indicator is drawn
ChartTimePriceToXY Converts the coordinates of a chart from the time/price representation to the X and Y coordinates
ChartXYToTimePrice Converts the X and Y coordinates on a chart to the time and price values
ChartOpen Opens a new chart with the specified symbol and period
ChartFirst Returns the ID of the first chart of the client terminal
ChartNext Returns the chart ID of the chart next to the specified one
ChartClose Closes the specified chart
ChartSymbol Returns the symbol name of the specified chart
ChartPeriod Returns the period value of the specified chart
ChartRedraw Calls a forced redrawing of a specified chart
ChartSetDouble Sets the double value for a corresponding property of the specified chart
ChartSetInteger Sets the integer value (datetime, int, color, bool or char) for a corresponding property of the specified chart
ChartSetString Sets the string value for a corresponding property of the specified chart
ChartGetDouble Returns the double value property of the specified chart
ChartGetInteger Returns the integer value property of the specified chart
ChartGetString Returns the string value property of the specified chart
ChartNavigate Performs shift of the specified chart by the specified number of bars relative to the specified position in the chart
ChartID Returns the ID of the current chart
ChartIndicatorDelete Removes an indicator with a specified name from the specified chart window
ChartIndicatorName Returns the short name of the indicator by the number in the indicators list on the specified chart window
ChartIndicatorsTotal Returns the number of all indicators applied to the specified chart window.
ChartWindowOnDropped Returns the number (index) of the chart subwindow the Expert Advisor or script has been dropped to
ChartPriceOnDropped Returns the price coordinate of the chart point the Expert Advisor or script has been dropped to
ChartTimeOnDropped Returns the time coordinate of the chart point the Expert Advisor or script has been dropped to
ChartXOnDropped Returns the X coordinate of the chart point the Expert Advisor or script has been dropped to
ChartYOnDropped Returns the Y coordinate of the chart point the Expert Advisor or script has been dropped to
ChartSetSymbolPeriod Changes the symbol value and a period of the specified chart
ChartScreenShot Provides a screenshot of the chart of its current state in a gif format
Period Returns timeframe of the current chart
Symbol Returns a text string with the name of the current financial instrument
WindowBarsPerChart Returns the amount of bars visible on the chart
WindowExpertName Returns the name of the executed Expert Advisor, script, custom indicator, or library
WindowFind Returns the window index containing this specified indicator
WindowFirstVisibleBar Returns index of the first visible bar in the current chart window
WindowHandle Returns the system handle of the chart window
WindowIsVisible Returns the visibility flag of the chart subwindow
WindowOnDropped Returns the window index where Expert Advisor, custom indicator or script was dropped
WindowPriceMax Returns the maximal value of the vertical scale of the specified subwindow of the current chart
WindowPriceMin Returns the minimal value of the vertical scale of the specified subwindow of the current chart
WindowPriceOnDropped Returns the price of the chart point where Expert Advisor or script was dropped
WindowRedraw Redraws the current chart forcedly
WindowScreenShot Saves current chart screen shot as a GIF, PNG or BMP file depending on specified extension
WindowTimeOnDropped Returns the time of the chart point where Expert Advisor or script was dropped
WindowsTotal Returns total number of indicator windows on the chart
WindowXOnDropped Returns the value at X axis in pixels for the chart window client area point at which the Expert Advisor or script was dropped
WindowYOnDropped Returns the value at Y axis in pixels for the chart window client area point at which the Expert Advisor or script was dropped
トレード関数(Trade Functions)
OrderClose Closes opened order
OrderCloseBy Closes an opened order by another opposite opened order
OrderClosePrice Returns close price of the currently selected order
OrderCloseTime Returns close time of the currently selected order
OrderComment Returns comment of the currently selected order
OrderCommission Returns calculated commission of the currently selected order
OrderDelete Deletes previously opened pending order
OrderExpiration Returns expiration date of the selected pending order
OrderLots Returns amount of lots of the selected order
OrderMagicNumber Returns an identifying (magic) number of the currently selected order
OrderModify Modification of characteristics of the previously opened or pending orders
OrderOpenPrice Returns open price of the currently selected order
OrderOpenTime Returns open time of the currently selected order
OrderPrint Prints information about the selected order in the log
OrderProfit Returns profit of the currently selected order
OrderSelect The function selects an order for further processing
OrderSend The main function used to open an order or place a pending order
OrdersHistoryTotal Returns the number of closed orders in the account history loaded into the terminal
OrderStopLoss Returns stop loss value of the currently selected order
OrdersTotal Returns the number of market and pending orders
OrderSwap Returns swap value of the currently selected order
OrderSymbol Returns symbol name of the currently selected order
OrderTakeProfit Returns take profit value of the currently selected order
OrderTicket Returns ticket number of the currently selected order
OrderType Returns order operation type of the currently selected order
トレードシグナル(Trade Signals)
SignalBaseGetDouble Returns the value of double type property for selected signal
SignalBaseGetInteger Returns the value of integer type property for selected signal
SignalBaseGetString Returns the value of string type property for selected signal
SignalBaseSelect Selects a signal from signals, available in terminal for further working with it
SignalBaseTotal Returns the total amount of signals, available in terminal
SignalInfoGetDouble Returns the value of double type property of signal copy settings
SignalInfoGetInteger Returns the value of integer type property of signal copy settings
SignalInfoGetString Returns the value of string type property of signal copy settings
SignalInfoSetDouble Sets the value of double type property of signal copy settings
SignalInfoSetInteger Sets the value of integer type property of signal copy settings
SignalSubscribe Subscribes to the trading signal
SignalUnsubscribe Cancels subscription
ターミナルのグローバル変数(Global Variables of the Terminal)
GlobalVariableCheck Checks the existence of a global variable with the specified name
GlobalVariableTime Returns time of the last accessing the global variable
GlobalVariableDel Deletes a global variable
GlobalVariableGet Returns the value of a global variable
GlobalVariableName Returns the name of a global variable by its ordinal number in the list of global variables
GlobalVariableSet Sets the new value to a global variable
GlobalVariablesFlush Forcibly saves contents of all global variables to a disk
GlobalVariableTemp Sets the new value to a global variable, that exists only in the current session of the terminal
GlobalVariableSetOnCondition Sets the new value of the existing global variable by condition
GlobalVariablesDeleteAll Deletes global variables with the specified prefix in their names
GlobalVariablesTotal Returns the total number of global variables
ファイル関数(File Functions)
FileFindFirst Starts the search of files in a directory in accordance with the specified filter
FileFindNext Continues the search started by the FileFindFirst() function
FileFindClose Closes search handle
FileOpen Opens a file with a specified name and flag
FileDelete Deletes a specified file
FileFlush Writes to a disk all data remaining in the input/output file buffer
FileGetInteger Gets an integer property of a file
FileIsEnding Defines the end of a file in the process of reading
FileIsLineEnding Defines the end of a line in a text file in the process of reading
FileClose Closes a previously opened file
FileIsExist Checks the existence of a file
FileCopy Copies the original file from a local or shared folder to another file
FileMove Moves or renames a file
FileReadArray Reads arrays of any type except for string from the file of the BIN type
FileReadBool Reads from the file of the CSV type a string from the current position till a delimiter (or till the end of a text line) and converts the read string to a value of bool type
FileReadDatetime Reads from the file of the CSV type a string of one of the formats: "YYYY.MM.DD HH:MM:SS", "YYYY.MM.DD" or "HH:MM:SS" - and converts it into a datetime value
FileReadDouble Reads a double value from the current position of the file pointer
FileReadFloat Reads a float value from the current position of the file pointer
FileReadInteger Reads int, short or char value from the current position of the file pointer
FileReadLong Reads a long type value from the current position of the file pointer
FileReadNumber Reads from the file of the CSV type a string from the current position till a delimiter (or til the end of a text line) and converts the read string into double value
FileReadString Reads a string from the current position of a file pointer from a file
FileReadStruct Reads the contents from a binary file  into a structure passed as a parameter, from the current position of the file pointer
FileSeek Moves the position of the file pointer by a specified number of bytes relative to the specified position
FileSize Returns the size of a corresponding open file
FileTell Returns the current position of the file pointer of a corresponding open file
FileWrite Writes data to a file of CSV or TXT type
FileWriteArray Writes arrays of any type except for string into a file of BIN type
FileWriteDouble Writes value of the double type from the current position of a file pointer into a binary file
FileWriteFloat Writes value of the float type from the current position of a file pointer into a binary file
FileWriteInteger Writes value of the int type from the current position of a file pointer into a binary file
FileWriteLong Writes value of the long type from the current position of a file pointer into a binary file
FileWriteString Writes the value of a string parameter into a BIN or TXT file starting from the current position of the file pointer
FileWriteStruct Writes the contents of a structure passed as a parameter into a binary file, starting from the current position of the file pointer
FolderCreate Creates a folder in the Files directory
FolderDelete Removes a selected directory. If the folder is not empty, then it can't be removed
FolderClean Deletes all files in the specified folder
FileOpenHistory Opens file in the current history directory or in its subfolders
カスタムインジケーター(Custom Indicators)
HideTestIndicators The function sets a flag hiding indicators called by the Expert Advisor
IndicatorSetDouble Sets the value of an indicator property of the double type
IndicatorSetInteger Sets the value of an indicator property of the int type
IndicatorSetString Sets the value of an indicator property of the string type
SetIndexBuffer Binds the specified indicator buffer with one-dimensional dynamic array of the double type
IndicatorBuffers Allocates memory for buffers used for custom indicator calculations
IndicatorCounted Returns the amount of bars not changed after the indicator had been launched last
IndicatorDigits Sets precision format to visualize indicator values
IndicatorShortName Sets the "short" name of a custom indicator to be shown in the DataWindow and in the chart subwindow
SetIndexArrow Sets an arrow symbol for indicators line of the DRAW_ARROW type
SetIndexDrawBegin Sets the bar number from which the drawing of the given indicator line must start
SetIndexEmptyValue Sets drawing line empty value
SetIndexLabel Sets drawing line description for showing in the DataWindow and in the tooltip
SetIndexShift Sets offset for the drawing line
SetIndexStyle Sets the new type, style, width and color for a given indicator line
SetLevelStyle Sets a new style, width and color of horizontal levels of indicator to be output in a separate window
SetLevelValue Sets a value for a given horizontal level of the indicator to be output in a separate window
オブジェクト関数(Object Functions)
ObjectCreate Creates an object of the specified type in a specified chart
ObjectName Returns the name of an object by its index in the objects list
ObjectDelete Removes the object having the specified name
ObjectsDeleteAll Removes all objects of the specified type from the specified chart subwindow
ObjectFind Searches for an object having the specified name
ObjectGetTimeByValue Returns the time value for the specified object price value
ObjectGetValueByTime Returns the price value of an object for the specified time
ObjectMove Changes the coordinates of the specified object anchor point
ObjectsTotal Returns the number of objects of the specified type
ObjectGetDouble Returns the double value of the corresponding object property
ObjectGetInteger Returns the integer value of the corresponding object property
ObjectGetString Returns the string value of the corresponding object property
ObjectSetDouble Sets the value of the corresponding object property
ObjectSetInteger Sets the value of the corresponding object property
ObjectSetString Sets the value of the corresponding object property
TextSetFont Sets the font for displaying the text using drawing methods (Arial 20 used by default)
TextOut Transfers the text to the custom array (buffer) designed for creation of a graphical resource
TextGetSize Returns the string's width and height at the current font settings
ObjectDescription Returns the object description
ObjectGet Returns the value of the specified object property
ObjectGetFiboDescription Returns the level description of a Fibonacci object
ObjectGetShiftByValue Calculates and returns bar index for the given price
ObjectGetValueByShift Calculates and returns the price value for the specified bar
ObjectSet Changes the value of the specified object property
ObjectSetFiboDescription Sets a new description to a level of a Fibonacci object
ObjectSetText Changes the object description
ObjectType Returns the object type
テクニカル指標(Technical Indicators)
iAC Accelerator Oscillator
iAD Accumulation/Distribution
iADX Average Directional Index
iAlligator Alligator
iAO Awesome Oscillator
iATR Average True Range
iBearsPower Bears Power
iBands Bollinger Bands®
iBandsOnArray Calculation of Bollinger Bands® indicator on data, stored in a numeric array
iBullsPower Bulls Power
iCCI Commodity Channel Index
iCCIOnArray Calculation of Commodity Channel Index indicator on data, stored in a numeric array
iCustom Custom indicator
iDeMarker DeMarker
iEnvelopes Envelopes
iEnvelopesOnArray Calculation of Envelopes indicator on data, stored in a numeric array
iForce Force Index
iFractals Fractals
iGator Gator Oscillator
iIchimoku Ichimoku Kinko Hyo
iBWMFI Market Facilitation Index by Bill Williams
iMomentum Momentum
iMomentumOnArray Calculation of Momentum indicator on data, stored in a numeric array
iMFI Money Flow Index
iMA Moving Average
iMAOnArray Calculation of Moving Average indicator on data, stored in a numeric array
iOsMA Moving Average of Oscillator (MACD histogram)
iMACD Moving Averages Convergence-Divergence
iOBV On Balance Volume
iSAR Parabolic Stop And Reverse System
iRSI Relative Strength Index
iRSIOnArray Calculation of Momentum indicator on data, stored in a numeric array
iRVI Relative Vigor Index
iStdDev Standard Deviation
iStdDevOnArray Calculation of Standard Deviation indicator on data, stored in a numeric array
iStochastic Stochastic Oscillator
iWPR Williams' Percent Range
イベント(Working with Events)
EventSetMillisecondTimer Launches event generator of the high-resolution timer with a period less than 1 second for the current chart
EventSetTimer Starts the timer event generator with the specified periodicity for the current chart
EventKillTimer Stops the generation of events by the timer in the current chart
EventChartCustom Generates a custom event for the specified chart