第十八节 标准变量Word文档下载推荐.docx
《第十八节 标准变量Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《第十八节 标准变量Word文档下载推荐.docx(45页珍藏版)》请在冰豆网上搜索。
6
Weightedcloseprice,(high+low+close+close)/4.
TheGetLastError()functionreturncodes.Errorcodeconstantsdefinedatstderror.mqhfile.ToprinttextmessagesuseErrorDescription()functiondefinedatstdlib.mqhfile.
#include<
stdlib.mqh>
voidSendMyMessage(stringtext)
{
intcheck;
SendMail("
somesubject"
text);
check=GetLastError();
if(check!
=ERR_NO_MQLERROR)Print(Can'
tsendmessage,error:
"
ErrorDescription(check));
}
Errorcodesreturnedfromtradeserver.
ERR_NO_ERROR
Noerrorreturned.
ERR_NO_RESULT
Noerrorreturned,butresultisunknown.
ERR_COMMON_ERROR
Commonerror.
ERR_INVALID_TRADE_PARAMETERS
Invalidtradeparameters.
ERR_SERVER_BUSY
Tradeserverisbusy.
ERR_OLD_VERSION
Oldversionoftheclientterminal.
ERR_NO_CONNECTION
Noconnectionwithtradeserver.
ERR_NOT_ENOUGH_RIGHTS
7
Notenoughrights.
ERR_TOO_FREQUENT_REQUESTS
8
Toofrequentrequests.
ERR_MALFUNCTIONAL_TRADE
9
Malfunctionaltradeoperation.
ERR_ACCOUNT_DISABLED
64
Accountdisabled.
ERR_INVALID_ACCOUNT
65
Invalidaccount.
ERR_TRADE_TIMEOUT
128
Tradetimeout.
ERR_INVALID_PRICE
129
Invalidprice.
ERR_INVALID_STOPS
130
Invalidstops.
ERR_INVALID_TRADE_VOLUME
131
Invalidtradevolume.
ERR_MARKET_CLOSED
132
Marketisclosed.
ERR_TRADE_DISABLED
133
Tradeisdisabled.
ERR_NOT_ENOUGH_MONEY
134
Notenoughmoney.
ERR_PRICE_CHANGED
135
Pricechanged.
ERR_OFF_QUOTES
136
Offquotes.
ERR_BROKER_BUSY
137
Brokerisbusy.
ERR_REQUOTE
138
Requote.
ERR_ORDER_LOCKED
139
Orderislocked.
ERR_LONG_POSITIONS_ONLY_ALLOWED
140
Longpositionsonlyallowed.
ERR_TOO_MANY_REQUESTS
141
Toomanyrequests.
MQL4runtimeerrorcodes
ERR_NO_MQLERROR
4000
Noerror.
ERR_WRONG_FUNCTION_POINTER
4001
Wrongfunctionpointer.
ERR_ARRAY_INDEX_OUT_OF_RANGE
4002
Arrayindexisoutofrange.
ERR_NO_MEMORY_FOR_FUNCTION_CALL_STACK
4003
Nomemoryforfunctioncallstack.
ERR_RECURSIVE_STACK_OVERFLOW
4004
Recursivestackoverflow.
ERR_NOT_ENOUGH_STACK_FOR_PARAMETER
4005
Notenoughstackforparameter.
ERR_NO_MEMORY_FOR_PARAMETER_STRING
4006
Nomemoryforparameterstring.
ERR_NO_MEMORY_FOR_TEMP_STRING
4007
Nomemoryfortempstring.
ERR_NOT_INITIALIZED_STRING
4008
Notinitializedstring.
ERR_NOT_INITIALIZED_ARRAYSTRING
4009
Notinitializedstringinarray.
ERR_NO_MEMORY_FOR_ARRAYSTRING
4010
Nomemoryforarray'
sstring.
ERR_TOO_LONG_STRING
4011
Toolongstring.
ERR_REMAINDER_FROM_ZERO_DIVIDE
4012
Remainderfromzerodivide.
ERR_ZERO_DIVIDE
4013
Zerodivide.
ERR_UNKNOWN_COMMAND
4014
Unknowncommand.
ERR_WRONG_JUMP
4015
Wrongjump(nevergeneratederror).
ERR_NOT_INITIALIZED_ARRAY
4016
Notinitializedarray.
ERR_DLL_CALLS_NOT_ALLOWED
4017
DLLcallsarenotallowed.
ERR_CANNOT_LOAD_LIBRARY
4018
Cannotloadlibrary.
ERR_CANNOT_CALL_FUNCTION
4019
Cannotcallfunction.
ERR_EXTERNAL_EXPERT_CALLS_NOT_ALLOWED
4020
Expertfunctioncallsarenotallowed.
ERR_NOT_ENOUGH_MEMORY_FOR_RETURNED_STRING
4021
Notenoughmemoryfortempstringreturnedfromfunction.
ERR_SYSTEM_BUSY
4022
Systemisbusy(nevergeneratederror).
ERR_INVALID_FUNCTION_PARAMETERS_COUNT
4050
Invalidfunctionparameterscount.
ERR_INVALID_FUNCTION_PARAMETER_VALUE
4051
Invalidfunctionparametervalue.
ERR_STRING_FUNCTION_INTERNAL_ERROR
4052
Stringfunctioninternalerror.
ERR_SOME_ARRAY_ERROR
4053
Somearrayerror.
ERR_INCORRECT_SERIES_ARRAY_USING
4054
Incorrectseriesarrayusing.
ERR_CUSTOM_INDICATOR_ERROR
4055
Customindicatorerror.
ERR_INCOMPATIBLE_ARRAYS
4056
Arraysareincompatible.
ERR_GLOBAL_VARIABLES_PROCESSING_ERROR
4057
Globalvariablesprocessingerror.
ERR_GLOBAL_VARIABLE_NOT_FOUND
4058
Globalvariablenotfound.
ERR_FUNCTION_NOT_ALLOWED_IN_TESTING_MODE
4059
Functionisnotallowedintestingmode.
ERR_FUNCTION_NOT_CONFIRMED
4060
Functionisnotconfirmed.
ERR_SEND_MAIL_ERROR
4061
Sendmailerror.
ERR_STRING_PARAMETER_EXPECTED
4062
Stringparameterexpected.
ERR_INTEGER_PARAMETER_EXPECTED
4063
Integerparameterexpected.
ERR_DOUBLE_PARAMETER_EXPECTED
4064
Doubleparameterexpected.
ERR_ARRAY_AS_PARAMETER_EXPECTED
4065
Arrayasparameterexpected.
ERR_END_OF_FILE
4099
Endoffile.
ERR_SOME_FILE_ERROR
4100
Somefileerror.
ERR_WRONG_FILE_NAME
4101
Wrongfilename.
ERR_TOO_MANY_OPENED_FILES
4102
Toomanyopenedfiles.
ERR_CANNOT_OPEN_FILE
4103
Cannotopenfile.
ERR_INCOMPATIBLE_ACCESS_TO_FILE
4104
Incompatibleaccesstoafile.
ERR_NO_ORDER_SELECTED
4105
Noorderselected.
ERR_UNKNOWN_SYMBOL
4106
Unknownsymbol.
4107
ERR_INVALID_TICKET
4108
Invalidticket.
ERR_TRADE_NOT_ALLOWED
4109
Tradeisnotallowed.
ERR_LONGS__NOT_ALLOWED
4110
Longsarenotallowed.
ERR_SHORTS_NOT_ALLOWED
4111
Shortsarenotallowed.
ERR_OBJECT_ALREADY_EXISTS
4200
Objectisalreadyexist.
ERR_UNKNOWN_OBJECT_PROPERTY
4201
Unknownobjectproperty.
ERR_OBJECT_DOES_NOT_EXIST
4202
Objectisnotexist.
ERR_UNKNOWN_OBJECT_TYPE
4203
Unknownobjecttype.
ERR_NO_OBJECT_NAME
4204
Noobjectname.
ERR_OBJECT_COORDINATES_ERROR
4205
Objectcoordinateserror.
ERR_NO_SPECIFIED_SUBWINDOW
4206
Nospecifiedsubwindow.
Indicator'
slineidentifiersusediniMACD(),iRVI()andiStochastic()indicators.
It'
scanbeoneofthefollowingvalues:
MODE_MAIN
Baseindicatorline.
MODE_SIGNAL
Signalline.
slineidentifiersusediniADX()indicator.
MODE_PLUSDI
Baseindicatorline+di.
MODE_MINUSDI
Baseindicatorline-di.
slineidentifiersusediniBands(),iEnvelopes(),iEnvOnArray(),iFractals()andiGator()indicators.
MODE_UPPER
Upperline.
MODE_LOWER
Lowerline.
Marketinformationidentifiers,usedwithMarketInfo()function.
Itcanbeanyoneofthefollowingvalues:
MODE_LOW
Lowdayprice.
MODE_HIGH
Highdayprice.
MODE_TIME
Lastincomingquotetime.
MODE_BID
Lastincomingbidprice.
MODE_ASK
10
Lastincomingaskprice.
MODE_POINT
11
Pointsize.
MODE_DIGITS
12
Digitsafterdecimalpoint.
MODE_SPREAD
13
Spreadvalueinpoints.
MODE_STOPLEVEL
14
Stoplevelinpoints.
TheMessageBox()functionreturncodes.
IfamessageboxhasaCancelbutton,thefunctionreturnstheIDCANCELvalueifeithertheESCkeyispressedortheCancelbuttonisselected.IfthemessageboxhasnoCancelbutton,pressingESChasnoeffect.
Note:
MessageBoxreturncodesdefinedintheWinUser32.mqhfile
IDOK
OKbuttonwasselected.
IDCANCEL
Cancelbuttonwasselected.
IDABORT
Abortbuttonwasselected.
IDRETRY
Retrybuttonwasselected.
IDIGNORE
Ignorebuttonwasselected.
IDYES
Yesbuttonwasselected.
IDNO
Nobuttonwasselected.
IDTRYAGAIN
TryAgainbuttonwasselected.
IDCONTINUE
Continuebuttonwasselected.
TheMessageBoxfunctionflagsspecifiesthecontentsandbehaviorofthedialogbox.Thisvaluecanbeacombinationofflagsfromthefollowinggroupsofflags.
Toindicatethebuttonsdisplayedinthemessagebox,specifyoneofthefollowingvalues.
MB_OK
0x00000000
Themessageboxcontainsonepushbutton:
OK.Thisisthedefault.
MB_OKCANCEL
0x00000001
Themessageboxcontainstwopushbuttons:
OKandCancel.
MB_ABORTRETRYIGNORE
0x00000002
Themessageboxcontainsthreepushbuttons:
Abort,Retry,andIgnore.
MB_YESNOCANCEL
0x00000003
Yes,No,andCancel.
MB_YESNO
0x00000004
YesandNo.
MB_RETRYCANCEL
0x00000005
RetryandCancel.
MB_CANCELTRYCONTINUE
0x00000006
Windows2000:
Themessageboxcontainsthreepushbuttons:
Cancel,TryAgain,Continue.UsethismessageboxtypeinsteadofMB_ABORTRETRYIGNORE.
Todisplayaniconinthemessagebox,specifyoneofthefollowingvalues.
MB_ICONSTOP,MB_ICONERROR,MB_ICONHAND
0x00000010
Astop-signiconappearsinthemessagebox.
MB_ICONQUESTION
0x00000020
Aquestion-markiconappearsinthemessagebox.
MB_ICONEXCLAMATION,MB_ICONWARNING
0x00000030
Anexclamation-pointiconappearsinthemessagebox.
MB_ICONINFORMATION,MB_ICONASTERISK
0x00000040
Aniconconsistingofalowercaseletteriinacircleappearsinthemessagebox.
Toindicatethedefaultbutton,specifyoneofthefollowingvalues.
MB_DEFBUTTON1
Thefirstbuttonisthedefaultbutton.MB_DEFBUTTON1isthedefaultunlessMB_DEFBUTTON2,MB_DEFBUTTON3,orMB_DEFBUTTON4isspecified.
MB_DEFBUTTON2