├── .gitignore ├── .vs ├── ProjectSettings.json ├── VSWorkspaceState.json ├── mql-snippets │ └── v15 │ │ └── .suo └── slnx.sqlite ├── .vscode └── launch.json ├── .vscodeignore ├── CHANGELOG.md ├── README.md ├── package.json ├── snippets └── snippets.json └── vsc-extension-quickstart.md /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .vsix 3 | snippets/snippets_with_comments.json 4 | -------------------------------------------------------------------------------- /.vs/ProjectSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "CurrentProjectSetting": null 3 | } -------------------------------------------------------------------------------- /.vs/VSWorkspaceState.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExpandedNodes": [ 3 | "" 4 | ], 5 | "PreviewInSolutionExplorer": false 6 | } -------------------------------------------------------------------------------- /.vs/mql-snippets/v15/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicholishen/mql-snippets-for-VScode/39b4b5a2865392c7930edf31aa788a3598e0c7e2/.vs/mql-snippets/v15/.suo -------------------------------------------------------------------------------- /.vs/slnx.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicholishen/mql-snippets-for-VScode/39b4b5a2865392c7930edf31aa788a3598e0c7e2/.vs/slnx.sqlite -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that launches the extension inside a new window 2 | { 3 | "version": "0.1.0", 4 | "configurations": [ 5 | { 6 | "name": "Extension", 7 | "type": "extensionHost", 8 | "request": "launch", 9 | "runtimeExecutable": "${execPath}", 10 | "args": ["--extensionDevelopmentPath=${workspaceRoot}" ] 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | .gitignore 4 | vsc-extension-quickstart.md 5 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to the "mql-snippets" extension will be documented in this file. 3 | 4 | 5 | ## [Unreleased] 6 | - Initial release -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mql-snippets README 2 | 3 | Snippets for MQL built-in functions, ENUMS, predefined variables, and keywords. 4 | 5 | ## Prefix keywords to invoke snippets 6 | ``` 7 | mqlfunctionname - typed in lower case will bring up suggestions 8 | _symbolinfodouble - words starting with underscore will bring up suggestions for MQL ENUM_... 9 | mqltemplate - brings up templates 10 | for - snippets for common for-loops 11 | functionheader - create a new function and description at the same time 12 | ``` 13 | 14 | 15 | ## Requirements 16 | 17 | 18 | ## Extension Settings 19 | 20 | 21 | ## Known Issues 22 | 23 | Only programmed about 80% of the library so far so you may find some snippets are missing. 24 | 25 | ## Release Notes 26 | 27 | BETA 28 | 29 | ### 0.0.8 30 | 31 | Added about 50 new snippets 32 | 33 | 34 | ### For more information 35 | 36 | * [MQ5 thread](https://www.mql5.com/en/forum/222553) 37 | * [Github](https://github.com/nicholishen/mql-snippets-for-VScode) 38 | **Enjoy!** -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mql-snippets", 3 | "displayName": "MQL Snippets", 4 | "description": "Snippets for the built-in MQL functions, constants, predefined variables, and common patterns", 5 | "version": "0.1.2", 6 | "publisher": "nicholishen", 7 | "engines": { 8 | "vscode": "^0.10.1" 9 | }, 10 | "categories": [ 11 | "Snippets" 12 | ], 13 | "contributes": { 14 | "snippets": [ 15 | { 16 | "language": "cpp", 17 | "path": "./snippets/snippets.json" 18 | } 19 | ] 20 | }, 21 | "repository": { 22 | "type": "git", 23 | "url": "https://github.com/nicholishen/mql-snippets-for-VScode" 24 | } 25 | } -------------------------------------------------------------------------------- /snippets/snippets.json: -------------------------------------------------------------------------------- 1 | { 2 | // default types 3 | "datetime": { 4 | "prefix": "datetime", 5 | "body": "datetime" 6 | }, 7 | "color": { 8 | "prefix": "color", 9 | "body": "color" 10 | }, 11 | "ulong": { 12 | "prefix": "ulong", 13 | "body": "ulong" 14 | }, 15 | "ushort": { 16 | "prefix": "ushort", 17 | "body": "ushort" 18 | }, 19 | "uchar": { 20 | "prefix": "uchar", 21 | "body": "uchar" 22 | }, 23 | "uint": { 24 | "prefix": "uint", 25 | "body": "uint" 26 | }, 27 | "string": { 28 | "prefix": "string", 29 | "body": "string" 30 | }, 31 | "NULL": { 32 | "prefix": "null", 33 | "body": "NULL" 34 | }, 35 | "include": { 36 | "prefix": "include", 37 | "body": "#include <${1:file_name.mqh}>$0", 38 | "description": "preprocessor include directive" 39 | }, 40 | "dynamic_cast":{ 41 | "prefix":"dynamic_cast", 42 | "body":"dynamic_cast<${1:type-id}>(${2:expression})$0", 43 | "description":["Dynamic typecasting is performed using dynamic_cast operator that can be applied only to pointers to classes.", 44 | "Type validation is performed at runtime. This means that the compiler does not check the data type applied for typecasting when dynamic_cast operator is used.", 45 | "If a pointer is converted to a data type which is not the actual type of an object, the result is NULL." 46 | ] 47 | } 48 | // enum_timeframes 49 | "ENUM_TIMEFRAMES": { 50 | "prefix":"enumtimeframes", 51 | "body":"ENUM_TIMEFRAMES", 52 | "description": "Timeframe enum" 53 | }, 54 | "PERIOD_M1": { 55 | "prefix":"period", 56 | "body":"PERIOD_M1", 57 | }, 58 | "PERIOD_M5": { 59 | "prefix":"period", 60 | "body":"PERIOD_M5", 61 | }, 62 | "PERIOD_M15": { 63 | "prefix":"period", 64 | "body":"PERIOD_M15", 65 | }, 66 | "PERIOD_M30": { 67 | "prefix":"period", 68 | "body":"PERIOD_M30", 69 | }, 70 | "PERIOD_H1": { 71 | "prefix":"period", 72 | "body":"PERIOD_H1", 73 | }, 74 | "PERIOD_H4": { 75 | "prefix":"period", 76 | "body":"PERIOD_H4", 77 | }, 78 | "PERIOD_D1": { 79 | "prefix":"period", 80 | "body":"PERIOD_D1", 81 | }, 82 | "PERIOD_W1": { 83 | "prefix":"period", 84 | "body":"PERIOD_W1", 85 | }, 86 | "PERIOD_MN1": { 87 | "prefix":"period", 88 | "body":"PERIOD_MN1", 89 | }, 90 | // order commands 91 | "OP_BUY": { 92 | "prefix":"opbuy", 93 | "body":"OP_BUY", 94 | }, 95 | "OP_BUYLIMIT": { 96 | "prefix":"opbuylimit", 97 | "body":"OP_BUYLIMIT", 98 | }, 99 | "OP_BUYSTOP": { 100 | "prefix":"opbuystop", 101 | "body":"OP_BUYSTOP", 102 | }, 103 | "OP_SELL": { 104 | "prefix":"opsell", 105 | "body":"OP_SELL", 106 | }, 107 | "OP_SELLLIMIT": { 108 | "prefix":"opselllimit", 109 | "body":"OP_SELLLIMIT", 110 | }, 111 | "OP_SELLSTOP": { 112 | "prefix":"opsellstop", 113 | "body":"OP_SELLSTOP", 114 | }, 115 | 116 | // enum ma method 117 | "ENUM_MA_METHOD": { 118 | "prefix":"enummamethod", 119 | "body":"ENUM_TIMEFRAMES", 120 | "description": "Timeframe enum" 121 | }, 122 | "MODE_SMA": { 123 | "prefix":"ma_method", 124 | "body":"MODE_SMA", 125 | "description":"Simple averaging" 126 | }, 127 | "MODE_EMA": { 128 | "prefix":"ma_method", 129 | "body":"MODE_EMA", 130 | "description":"Exponential averaging" 131 | }, 132 | "MODE_SMMA": { 133 | "prefix":"ma_method", 134 | "body":"MODE_SMMA", 135 | "description":"Smoothed averaging" 136 | }, 137 | "MODE_LWMA": { 138 | "prefix":"ma_method", 139 | "body":"MODE_LWMA", 140 | "description":"Linear-weighted averaging" 141 | }, 142 | 143 | // enum applied price 144 | "ENUM_APPLIED_PRICE": { 145 | "prefix":"enumappliedprice", 146 | "body":"ENUM_APPLIED_PRICE", 147 | "description": "Applied price enum" 148 | }, 149 | "PRICE_CLOSE": { 150 | "prefix":"applied_price", 151 | "body":"PRICE_CLOSE", 152 | 153 | }, 154 | "PRICE_OPEN": { 155 | "prefix":"applied_price", 156 | "body":"PRICE_OPEN", 157 | 158 | }, 159 | "PRICE_HIGH": { 160 | "prefix":"applied_price", 161 | "body":"PRICE_HIGH", 162 | 163 | }, 164 | "PRICE_LOW": { 165 | "prefix":"applied_price", 166 | "body":"PRICE_LOW", 167 | }, 168 | "PRICE_MEDIAN": { 169 | "prefix":"applied_price", 170 | "body":"PRICE_MEDIAN", 171 | 172 | }, 173 | "PRICE_TYPICAL": { 174 | "prefix":"applied_price", 175 | "body":"PRICE_TYPICAL", 176 | 177 | }, 178 | "PRICE_WEIGHTED": { 179 | "prefix":"applied_price", 180 | "body":"PRICE_WEIGHTED", 181 | }, 182 | 183 | // MQL structs 184 | "MqlDateTime": { 185 | "prefix": "mqldatetime", 186 | "body": "MqlDateTime $0", 187 | "description": " structure contains eight fields of the int type" 188 | }, 189 | "MqlParam": { 190 | "prefix": "mqlparam", 191 | "body": "MqlParam $0", 192 | "description": " The MqlParam structure has been specially designed to provide input parameters when creating the handle of a technical indicator using the IndicatorCreate() function." 193 | }, 194 | "MqlRates": { 195 | "prefix": "mqlrates", 196 | "body": "MqlRates $0", 197 | "description": " structure stores information about the prices, volumes and spread." 198 | }, 199 | "MqlBookInfo": { 200 | "prefix": "mqlbookinfo", 201 | "body": "MqlBookInfo $0", 202 | "description": " provides information about the market depth data" 203 | }, 204 | "MqlTradeRequest": { 205 | "prefix": "mqltraderequest", 206 | "body": "MqlTradeRequest $0", 207 | "description": " Interaction between the client terminal and a trade server for executing the order placing operation is performed by using trade requests. " 208 | }, 209 | "MqlTradeCheckResult": { 210 | "prefix": "mqltradecheckresult", 211 | "body": "MqlTradeCheckResult $0", 212 | "description": " Before sending a request for a trade operation to a trade server, it is recommended to check it. The check is performed using the OrderCheck() function, to which the checked request and a variable of the MqlTradeCheckResult structure type are passed. The check result will be written to this variable." 213 | }, 214 | "MqlTradeResult": { 215 | "prefix": "mqltraderesult", 216 | "body": "MqlTradeResult $0", 217 | "description": " As result of a trade request, a trade server returns data about the trade request processing result as a special predefined structure of MqlTradeResult type." 218 | }, 219 | "MqlTick": { 220 | "prefix": "mqltick", 221 | "body": "MqlTick $0", 222 | "description": " This is a structure for storing the latest prices of the symbol. It is designed for fast retrieval of the most requested information about current prices." 223 | }, 224 | // Predefined variables 225 | "_Symbol":{ 226 | "prefix":"symbol", 227 | "body":"_Symbol", 228 | "description":" Returns the string value of the current symbol." 229 | }, 230 | "_Digits": { 231 | "prefix": "digits", 232 | "body": "_Digits$0", 233 | "description": " Number of decimal places" 234 | }, 235 | "_Point": { 236 | "prefix": "point", 237 | "body": "_Point$0", 238 | "description": " Size of the current symbol point in the quote currency" 239 | }, 240 | "_LastError": { 241 | "prefix": "lasterror", 242 | "body": "_LastError$0", 243 | "description": " last error code" 244 | }, 245 | "_Period": { 246 | "prefix": "period", 247 | "body": "_Period$0", 248 | "description": " value of the timeframe of the current chart." 249 | }, 250 | "_RandomSeed": { 251 | "prefix": "randomseed", 252 | "body": "_RandomSeed$0", 253 | "description": " Variable for storing the current state when generating pseudo-random integers" 254 | }, 255 | "_StopFlag": { 256 | "prefix": "stopflag", 257 | "body": "_StopFlag$0", 258 | "description": " contains the flag of the mql5-program stop" 259 | }, 260 | "_UninitReason": { 261 | "prefix": "uninitreason", 262 | "body": "_UninitReason$0", 263 | "description": " contains the code of the program uninitialization reason." 264 | }, 265 | "Bid": { 266 | "prefix": "bid", 267 | "body": "Bid$0", 268 | "description": " bid" 269 | }, 270 | "Ask": { 271 | "prefix": "ask", 272 | "body": "Ask$0", 273 | "description": " ask" 274 | }, 275 | // MQL4 built-in arrays 276 | "Open[]": { 277 | "prefix": "Open", 278 | "body": "Open[${1:i}]$0", 279 | "description": " Series array that contains open prices of each bar of the current chart" 280 | }, 281 | "High[]": { 282 | "prefix": "High", 283 | "body": "High[${1:i}]$0", 284 | "description": " Series array that contains high prices of each bar of the current chart" 285 | }, 286 | "Low[]": { 287 | "prefix": "Low", 288 | "body": "Low[${1:i}]$0", 289 | "description": " Series array that contains low prices of each bar of the current chart" 290 | }, 291 | "Close[]": { 292 | "prefix": "Close", 293 | "body": "Close[${1:i}]$0", 294 | "description": " Series array that contains close prices of each bar of the current chart" 295 | }, 296 | "Time[]": { 297 | "prefix": "Time", 298 | "body": "Time[${1:i}]$0", 299 | "description": " Series array that contains time of each bar of the current chart" 300 | }, 301 | "Volume[]": { 302 | "prefix": "Volume", 303 | "body": "Volume[${1:i}]$0", 304 | "description": " Series array that contains volume of each bar of the current chart" 305 | }, 306 | // Common functions 307 | "Alert": { 308 | "prefix": "alert", 309 | "body": "Alert(${1:argument, ...})$0", 310 | "description": " Displays a message in a separate window." 311 | }, 312 | "Check Pointer": { 313 | "prefix": "checkpointer", 314 | "body": "CheckPointer(${1:object* anytype})$0", 315 | "description": " The function returns the type of the object pointer." 316 | }, 317 | "Comment": { 318 | "prefix": "comment", 319 | "body": "Comment(${1:argument, ...})$0", 320 | "description": " outputs a comment defined by a user in the top left corner of a chart." 321 | }, 322 | "DebugBreak": { 323 | "prefix": "debugbreak", 324 | "body": "DebugBreak()$0", 325 | "description": " sets a debug break point" 326 | }, 327 | "ExpertRemove": { 328 | "prefix": "expertremove", 329 | "body": "ExpertRemove()$0", 330 | "description": " stops an Expert Advisor and unloads it from a chart." 331 | }, 332 | "GetPointer": { 333 | "prefix": "getpointer", 334 | "body": "GetPointer(${1:object anytype})$0", 335 | "description": " returns the object pointer." 336 | }, 337 | "GetTickCount": { 338 | "prefix": "gettickcount", 339 | "body": "GetTickCount()$0", 340 | "description": " returns the number of milliseconds that elapsed since the system start" 341 | }, 342 | "GetMicrosecondCount": { 343 | "prefix": "getmicrosecondcount", 344 | "body": "GetMicrosecondCount()$0", 345 | "description": " returns the number of microseconds that have elapsed since the start of MQL5-program." 346 | }, 347 | "MessageBox": { 348 | "prefix": "messagebox", 349 | "body": "MessageBox(${1:string text}, ${2:caption=NULL}, ${3:int flags})$0", 350 | "description": " creates and shows a message box and manages it.." 351 | }, 352 | "PeriodSeconds": { 353 | "prefix": "periodseconds", 354 | "body": "PeriodSeconds(${1:ENUM_TIMEFRAMES=PERIOD_CURRENT})$0", 355 | "description": " number of seconds in a period." 356 | }, 357 | "PlaySound": { 358 | "prefix": "playsound", 359 | "body": "PlaySound(${1:string filename})$0", 360 | "description": " plays a sound file." 361 | }, 362 | "Print": { 363 | "prefix": "print", 364 | "body": "Print(${1:argument, ...})$0", 365 | "description": " enters a message in the Expert Advisor log. Parameters can be of any type." 366 | }, 367 | "PrintFormat": { 368 | "prefix": "printformat", 369 | "body": "PrintFormat(${1:string format_string}, ${2: ...})$0", 370 | "description": " formats and enters sets of symbols and values in the Expert Advisor log in accordance with a preset format." 371 | }, 372 | "ResetLastError": { 373 | "prefix": "resetlasterror", 374 | "body": "ResetLastError()$0", 375 | "description": " Sets the value of the predefined variable _LastError into zero." 376 | }, 377 | "SendNotification": { 378 | "prefix": "sendnotification", 379 | "body": "SendNotification(${1:string text})$0", 380 | "description": " Sends push notifications to the mobile terminals, whose MetaQuotes IDs are specified in the \"Notifications\" tab.." 381 | }, 382 | "SendMail": { 383 | "prefix": "sendmail", 384 | "body": "SendMail(${1:string subject}, ${2:string text})$0", 385 | "description": " Sends an email at the address specified in the settings window of the Email tab." 386 | }, 387 | "Sleep": { 388 | "prefix": "sleep", 389 | "body": "Sleep(${1:int milliseconds})$0", 390 | "description": " The function suspends execution of the current Expert Advisor or script within a specified interval." 391 | }, 392 | "TranslateKey": { 393 | "prefix": "translatekey", 394 | "body": "TranslateKey(${1:int key_code})$0", 395 | "description": " Returns a Unicode character by a virtual key code considering the current input language and the status of control keys." 396 | }, 397 | "WebRequest": { 398 | "prefix": "webrequest", 399 | "body": "WebRequest(${1:see docs})$0", 400 | "description": " sends an HTTP request to a specified server. The function has two versions:" 401 | }, 402 | "ZeroMemory": { 403 | "prefix": "zeromem", 404 | "body": "ZeroMemory(${1:void &variable})$0", 405 | "description": " resets a variable passed to it by reference." 406 | }, 407 | // Array functions 408 | "ArraySize": { 409 | "prefix": "arraysize", 410 | "body": "ArraySize(${1:const void& array[]})", 411 | "description": " The function returns the number of elements of a selected array.." 412 | }, 413 | "ArrayGetAsSeries": { 414 | "prefix": "arraygetasseries", 415 | "body": "ArrayGetAsSeries(${1:const void& array[]})$0", 416 | "description": " It checks direction of an array index.." 417 | }, 418 | "ArraySetAsSeries": { 419 | "prefix": "arraysetasseries", 420 | "body": "ArraySetAsSeries(${1:const void& array[]}, ${bool flag})$0", 421 | "description": " The function sets the AS_SERIES flag to a selected object of a dynamic array, and elements will be indexed like in timeseries." 422 | }, 423 | "ArrayResize": { 424 | "prefix": "arrayresize", 425 | "body": "ArrayResize(${1:void& array[]}, ${2:int new_size},${3:reserved_size=0})$0", 426 | "description": " The function sets a new size for the first dimension" 427 | }, 428 | "ArrayInitialize": { 429 | "prefix": "arrayinit", 430 | "body": "ArrayInitialize(${1:T array[]}, ${2:T value})$0", 431 | "description": " initializes a numeric array by a preset value." 432 | }, 433 | // Conversion functions 434 | "CharToString": { 435 | "prefix": "chartostring", 436 | "body": "CharToString(${1:uchar char_code})$0", 437 | "description": " Converting a symbol code into a one-character string." 438 | }, 439 | "CharArrayToString": { 440 | "prefix": "chararraytostring", 441 | "body": "CharArrayToString(${1:uchar array[]}, ${2:int start}, ${3:int count=1}, ${4:uint code_page=CP_ACP})$0", 442 | "description": " It copies and converts part of array of uchar type into a returned string.." 443 | }, 444 | "ColorToString": { 445 | "prefix": "colortostring", 446 | "body": "ColorToString(${1:color color}, ${2:bool show_color_name})$0", 447 | "description": " It converts color value into string of R,G,B form." 448 | }, 449 | "DoubleToString": { 450 | "prefix": "doubletostring", 451 | "body": "DoubleToString(${1:double value}, ${2:int digits=8})$0", 452 | "description": " Converting numeric value into text string." 453 | }, 454 | "EnumToString": { 455 | "prefix": "enumtostring", 456 | "body": "EnumToString(${1:any_enum value})$0", 457 | "description": " Converting an enumeration value of any type to a text form." 458 | }, 459 | "TimeToString": { 460 | "prefix": "timetostring", 461 | "body": "TimeToString(${1:datetime value}, ${2:int mode=TIME_DATE|TIME_MINUTES})$0", 462 | "description": " Converting a value containing time in seconds elapsed since 01.01.1970 into a string of yyyy.mm.dd hh:mi format." 463 | }, 464 | "NormalizeDouble": { 465 | "prefix": "normalizedouble", 466 | "body": "NormalizeDouble(${1:double value}, ${2:int digits})$0", 467 | "description": " Rounding floating point number to a specified accuracy." 468 | }, 469 | "StringToCharArray": { 470 | "prefix": "stringtochararray", 471 | "body": "StringToCharArray(${1:string text_string}, ${2:uchar& array[]}, ${3:int start=0}, ${4:int count=-1}, ${5:uint codepage=CP_ACP})$0", 472 | "description": " Symbol-wise copies a string converted from Unicode to ANSI, to a selected place of array of uchar type. It returns the number of copied elements." 473 | }, 474 | "StringToTime": { 475 | "prefix": "stringtitime", 476 | "body": "StringToTime(${1:string value})$0", 477 | "description": " converts a string containing time or date in yyyy.mm.dd [hh:mi] format into datetime type." 478 | }, 479 | "StringFormat": { 480 | "prefix": "stringformat", 481 | "body": "StringFormat(${1:string format}, ${2:params...})$0", 482 | "description": " The function formats obtained parameters and returns a string." 483 | }, 484 | // Math functions 485 | "MathAbs": { 486 | "prefix": "math", 487 | "body": "fabs(${1:double value})$0", 488 | "description": " The function returns the absolute value (modulus) of the specified numeric value." 489 | }, 490 | "MathPow": { 491 | "prefix": "math", 492 | "body": "pow(${1:double base}, ${2:double exponent})$0", 493 | "description": " The function returns the absolute value (modulus) of the specified numeric value." 494 | }, 495 | "MathArcsin": { 496 | "prefix": "math", 497 | "body": "asin(${1:double value})$0", 498 | "description": " returns the arc sine of x within the range of -π/2 to π/2 radians." 499 | }, 500 | "MathArccos": { 501 | "prefix": "math", 502 | "body": "acos(${1:double value})$0", 503 | "description": " returns the arccosine of x within the range 0 to π in radians." 504 | }, 505 | "MathCeil": { 506 | "prefix": "math", 507 | "body": "ceil(${1:double value})$0", 508 | "description": " returns integer numeric value closest from above." 509 | }, 510 | "MathFloor": { 511 | "prefix": "math", 512 | "body": "floor(${1:double value})$0", 513 | "description": " returns integer numeric value closest from below." 514 | }, 515 | "MathLog": { 516 | "prefix": "math", 517 | "body": "log(${1:double value})$0", 518 | "description": " returns a natural logarithm." 519 | }, 520 | "MathLog10": { 521 | "prefix": "math", 522 | "body": "log10(${1:double value})$0", 523 | "description": " Returns the logarithm of a number by base 10." 524 | }, 525 | "MathMax": { 526 | "prefix": "math", 527 | "body": "fmax(${1:double value1}, ${2:double value2})$0", 528 | "description": " returns the maximal value of two values." 529 | }, 530 | "MathMin": { 531 | "prefix": "math", 532 | "body": "fmin(${1:double value1}, ${2:double value2})$0", 533 | "description": " returns the minimal value of two values." 534 | }, 535 | "MathRand": { 536 | "prefix": "math", 537 | "body": "rand()$0", 538 | "description": " Returns a pseudorandom integer within the range of 0 to 32767." 539 | }, 540 | "MathSrand": { 541 | "prefix": "math", 542 | "body": "srand(${int seed})$0", 543 | "description": " Sets the starting point for generating a series of pseudorandom integers." 544 | }, 545 | "MathRound": { 546 | "prefix": "math", 547 | "body": "round(${1:double value})$0", 548 | "description": " returns a value rounded off to the nearest integer of the specified numeric value." 549 | }, 550 | "MathIsValidNumber": { 551 | "prefix": "math", 552 | "body": "MathIsValidNumber(${1:double value})$0", 553 | "description": " checks the correctness of a real number" 554 | }, 555 | "MathSqrt": { 556 | "prefix": "math", 557 | "body": "sqrt(${1:double value})$0", 558 | "description": " Returns the square root of a number." 559 | }, 560 | // Time functions 561 | "TimeCurrentStruct": { 562 | "prefix": "timecurrent", 563 | "body": "TimeCurrent(${1:MqlDateTime struct})$0", 564 | "description": " MqlDateTime structure type variable has been passed as a parameter, it is filled accordingly" 565 | }, 566 | "TimeCurrent": { 567 | "prefix": "timecurrent", 568 | "body": "TimeCurrent()$0", 569 | "description": " Returns the last known server time" 570 | }, 571 | "TimeTradeServer": { 572 | "prefix": "timetradeserver", 573 | "body": "TimeTradeServer()$0", 574 | "description": " Returns the calculated current time of the trade server" 575 | }, 576 | "TimeLocal": { 577 | "prefix": "timelocal", 578 | "body": "TimeLocal()$0", 579 | "description": " Returns the local time of a computer" 580 | }, 581 | "TimeLocal Struct": { 582 | "prefix": "timelocal", 583 | "body": "TimeLocal(${1:MqlDateTime &struct})$0", 584 | "description": " Returns the local time of a computer; fills struct" 585 | }, 586 | "TimeGMT": { 587 | "prefix": "timegmt", 588 | "body": "TimeGMT()$0", 589 | "description": " Returns the GMT, which is calculated taking into account the DST switch by the local time on the computer where the client terminal is running." 590 | }, 591 | "TimeGMT Struct": { 592 | "prefix": "timegmt", 593 | "body": "TimeGMT(${1:MqlDateTime &struct})$0", 594 | "description": " Returns the GMT, which is calculated taking into account the DST switch by the local time on the computer where the client terminal is running." 595 | }, 596 | "TimeDaylightSavings": { 597 | "prefix": "timedaylight", 598 | "body": "TimeDaylightSavings()$0", 599 | "description": " Returns correction for daylight saving time in seconds, if the switch to summer time has been made." 600 | }, 601 | "TimeGMTOffset": { 602 | "prefix": "timegmtoffest", 603 | "body": "TimeGMTOffset()$0", 604 | "description": " Returns the current difference between GMT time and the local computer time in seconds" 605 | }, 606 | "TimeToStruct": { 607 | "prefix": "timetostruct", 608 | "body": "TimeToStruct(${1:datetime dt}, ${2:MqlDateTime &struct})$0", 609 | "description": " Converts a value of datetime type (number of seconds since 01.01.1970) into a structure variable MqlDateTime." 610 | }, 611 | "StructToTime": { 612 | "prefix": "structotime", 613 | "body": "StructToTime(${1:MqlDateTime &struct})$0", 614 | "description": " Converts a structure variable MqlDateTime into a value of datetime type and returns the resulting value." 615 | }, 616 | // String Functions 617 | "StringAdd": { 618 | "prefix": "stringadd", 619 | "body": "StringAdd(${1:string& str_var}, ${2:string add_substring})$0", 620 | "description": " adds a substring to the end of a string." 621 | }, 622 | "StringBufferLen": { 623 | "prefix": "stringbufferlen", 624 | "body": "StringBufferLen(${1:string string_var})$0", 625 | "description": " returns the size of buffer allocated for the string." 626 | }, 627 | "StringCompare": { 628 | "prefix": "stringcompare", 629 | "body": "StringCompare(${1:string str1}, ${2:string str2},${bool case_sensitive=true})$0", 630 | "description": " compares two strings and returns the comparison result in form of an integer.Case sensitivity mode selection. If it is true, then A>a. If it is false, then A=a." 631 | }, 632 | "StringFill": { 633 | "prefix": "stringfill", 634 | "body": "StringFill(${1:string& str_var}, ${2:ushort character})$0", 635 | "description": " It fills out a selected string by specified symbols" 636 | }, 637 | "StringFind": { 638 | "prefix": "stringfind", 639 | "body": "StringFind(${1:string value}, ${2:string match_substring},${3:int start_pos=0})$0", 640 | "description": " Search for a substring in a string." 641 | }, 642 | "StringGetCharacter": { 643 | "prefix": "stringgetchar", 644 | "body": "StringGetCharacter(${1:string str_var}, ${2:int pos})$0", 645 | "description": " returns value of a symbol, located in the specified position of a string." 646 | }, 647 | "StringLen": { 648 | "prefix": "stringlen", 649 | "body": "StringLen(${1:string str_var})$0", 650 | "description": " Returns the number of symbols in a string" 651 | }, 652 | "StringReplace": { 653 | "prefix": "stringreplace", 654 | "body": "StringReplace(${1:string& str}, ${2:string find}, ${3:string replace})$0", 655 | "description": [ 656 | " replaces all the found substrings of a string by a set sequence of symbols.", 657 | "The function returns the number of replacements in case of success, otherwise -1. To get an error code call the GetLastError() function." 658 | ] 659 | }, 660 | "StringSplit": { 661 | "prefix": "stringsplit", 662 | "body": "StringSplit(${1:string str}, ${2:ushort separator}, ${3:string &result[]})$0", 663 | "description": " Gets substrings by a specified separator from the specified string, returns the number of substrings obtained." 664 | }, 665 | "StringSubstr": { 666 | "prefix": "stringsub", 667 | "body": "StringSubstr(${1:string str}, ${2:int start_pos}, ${3:int length=-1)$0", 668 | "description": " Extracts a substring from a text string starting from the specified position." 669 | }, 670 | "StringToLower": { 671 | "prefix": "stringtolower", 672 | "body": "StringToLower(${1:string& str})$0", 673 | "description": " Transforms all symbols of a selected string into lowercase." 674 | }, 675 | "StringToUpper": { 676 | "prefix": "stringtoupper", 677 | "body": "StringToUpper(${1:string& str})$0", 678 | "description": " Transforms all symbols of a selected string into capitals." 679 | }, 680 | "StringTrimRight": { 681 | "prefix": "stringtrimright", 682 | "body": "StringTrimRight(${1:string& str})$0", 683 | "description": " The function cuts line feed characters, spaces and tabs in the right part of the string after the last meaningful symbol. The string is modified at place." 684 | }, 685 | "StringTrimLeft": { 686 | "prefix": "stringtrimleft", 687 | "body": "StringTrimLeft(${1:string& str})$0", 688 | "description": " The function cuts line feed characters, spaces and tabs in the left part of the string till the first meaningful symbol. The string is modified at place." 689 | }, 690 | // Account info 691 | "AccountInfoDouble": { 692 | "prefix": "accountinfodouble", 693 | "body": "AccountInfoDouble(${1:ENUM_ACOUNT_INFO_DOUBLE property_id})$0", 694 | "description": " Returns the value of the corresponding account property." 695 | }, 696 | "AccountInfoInteger": { 697 | "prefix": "accountinfoint", 698 | "body": "AccountInfoInteger(${1:ENUM_ACOUNT_INFO_INTEGER property_id})$0", 699 | "description": " Returns the value of the corresponding account property." 700 | }, 701 | "AccountInfoString": { 702 | "prefix": "accountinfostring", 703 | "body": "AccountInfoString(${1:ENUM_ACOUNT_INFO_STRING property_id})$0", 704 | "description": " Returns the value of the corresponding account property." 705 | }, 706 | "AccountBalance": { 707 | "prefix": "accountbalance", 708 | "body": "AccountBalance()$0", 709 | "description": " Returns balance value of the current account." 710 | }, 711 | "AccountCredit": { 712 | "prefix": "accountcredit", 713 | "body": "AccountCredit()$0", 714 | "description": " Returns credit value of the current account." 715 | }, 716 | "AccountCompany": { 717 | "prefix": "accountcompany", 718 | "body": "AccountCompany()$0", 719 | "description": " Returns the brokerage company name where the current account was registered." 720 | }, 721 | "AccountCurrency": { 722 | "prefix": "accountcurrency", 723 | "body": "AccountCurrency()$0", 724 | "description": " Returns currency name of the current account." 725 | }, 726 | "AccountEquity": { 727 | "prefix": "accountequity", 728 | "body": "AccountEquity()$0", 729 | "description": " Returns equity value of the current account." 730 | }, 731 | "AccountFreeMargin": { 732 | "prefix": "accountfreemargin", 733 | "body": "AccountFreeMargin()$0", 734 | "description": " Returns free margin value of the current account." 735 | }, 736 | "AccountFreeMarginCheck": { 737 | "prefix": "accountfreemargincheck", 738 | "body": "AccountFreeMarginCheck(${1:string symbol}, ${2:int trade_operation}, ${3:double volume})$0", 739 | "description": " Returns free margin that remains after the specified order has been opened at the current price on the current account." 740 | }, 741 | "AccountFreeMarginMode": { 742 | "prefix": "accountfreemarginmode", 743 | "body": "AccountFreeMarginMode()$0", 744 | "description":[" Returns the calculation mode of free margin allowed to open orders on the current account.", 745 | "The calculation mode can take the following values", 746 | "0 - floating profit/loss is not used for calculation", 747 | "1 - both floating profit and loss on opened orders on the current account are used for free margin calculation", 748 | "2 - only profit value is used for calculation, the current loss on opened orders is not considered", 749 | "3 - only loss value is used for calculation, the current floating profit on opened orders is not considered." 750 | ] 751 | }, 752 | "AccountLeverage": { 753 | "prefix": "accountleverage", 754 | "body": "AccountLeverage()$0", 755 | "description": " Returns leverage of the current account." 756 | }, 757 | "AccountMargin": { 758 | "prefix": "accountmargin", 759 | "body": "AccountMargin()$0", 760 | "description": " Returns margin value of the current account." 761 | }, 762 | "AccountName": { 763 | "prefix": "accountname", 764 | "body": "AccountName()$0", 765 | "description": " Returns the current account name." 766 | }, 767 | "AccountNumber": { 768 | "prefix": "accountnumber", 769 | "body": "AccountNumber()$0", 770 | "description": " Returns the current account number." 771 | }, 772 | "AccountProfit": { 773 | "prefix": "accountprofit", 774 | "body": "AccountProfit()$0", 775 | "description": " Returns profit value of the current account." 776 | }, 777 | "AccountServer": { 778 | "prefix": "accountserver", 779 | "body": "AccountServer()$0", 780 | "description": " Returns the connected server name." 781 | }, 782 | "AccountStopoutLevel": { 783 | "prefix": "accountstopoutlevel", 784 | "body": "AccountStopoutLevel()$0", 785 | "description": " Returns the value of the Stop Out level." 786 | }, 787 | "AccountStopoutMode": { 788 | "prefix": "accountstopoutmode", 789 | "body": "AccountStopoutMode()$0", 790 | "description":[" Returns the calculation mode for the Stop Out level.", 791 | "Calculation mode can take the following values:", 792 | "0 - calculation of percentage ratio between margin and equity;", 793 | "1 - comparison of the free margin level to the absolute value." 794 | ] 795 | }, 796 | // Account int enums 797 | "ACCOUNT_LOGIN": { 798 | "prefix": "_account_int", 799 | "body": "ACCOUNT_LOGIN$0", 800 | "description": " Account number" 801 | }, 802 | "ACCOUNT_TRADE_MODE": { 803 | "prefix": "_account_int", 804 | "body": "ACCOUNT_TRADE_MODE$0", 805 | "description": " Account trade mode" 806 | }, 807 | "ACCOUNT_LEVERAGE": { 808 | "prefix": "_account_int", 809 | "body": "ACCOUNT_LEVERAGE$0", 810 | "description": " Account leverage" 811 | }, 812 | "ACCOUNT_LIMIT_ORDERS": { 813 | "prefix": "_account_int", 814 | "body": "ACCOUNT_LIMIT_ORDERS$0", 815 | "description": " Maximum allowed number of active pending orders" 816 | }, 817 | "ACCOUNT_MARGIN_SO_MODE": { 818 | "prefix": "_account_int", 819 | "body": "ACCOUNT_MARGIN_SO_MODE$0", 820 | "description": " Mode for setting the minimal allowed margin" 821 | }, 822 | "ACCOUNT_TRADE_ALLOWED": { 823 | "prefix": "_account_int", 824 | "body": "ACCOUNT_TRADE_ALLOWED$0", 825 | "description": " Allowed trade for the current account" 826 | }, 827 | "ACCOUNT_TRADE_EXPERT": { 828 | "prefix": "_account_int", 829 | "body": "ACCOUNT_TRADE_EXPERT$0", 830 | "description": " Allowed trade for an Expert Advisor" 831 | }, 832 | "ACCOUNT_MARGIN_MODE": { 833 | "prefix": "_account_int", 834 | "body": "ACCOUNT_MARGIN_MODE$0", 835 | "description": " Margin calculation mode" 836 | }, 837 | // Terminal Info 838 | "GetLastError": { 839 | "prefix": "getlasterror", 840 | "body": "GetLastError()$0", 841 | "description": " Returns the contents of the system variable _LastError" 842 | }, 843 | "IsStopped": { 844 | "prefix": "isstopped", 845 | "body": "IsStopped()$0", 846 | "description": " Checks the forced shutdown of an mql5 program" 847 | }, 848 | "UninitializeReason": { 849 | "prefix": "uninitreason", 850 | "body": "UninitializeReason()$0", 851 | "description": " Returns the code of a reason for deinitialization." 852 | }, 853 | "TerminalInfoInteger": { 854 | "prefix": "terminalinfoint", 855 | "body": "TerminalInfoInteger(${1:int property_id})$0", 856 | "description": " Returns the value of a corresponding property of the mql5 program environment" 857 | }, 858 | "TerminalInfoDouble": { 859 | "prefix": "terminalinfodouble", 860 | "body": "TerminalInfoDouble(${1:int property_id})$0", 861 | "description": " Returns the value of a corresponding property of the mql5 program environment" 862 | }, 863 | "TerminalInfoString": { 864 | "prefix": "terminalinfostring", 865 | "body": "TerminalInfoString(${1:int property_id})$0", 866 | "description": " Returns the value of a corresponding property of the mql5 program environment" 867 | }, 868 | "MQLInfoInteger": { 869 | "prefix": "mqlinfoint", 870 | "body": "MQLInfoInteger(${1:int property_id})$0", 871 | "description": " Returns the value of a corresponding property of a running mql5 program." 872 | }, 873 | "MQLInfoString": { 874 | "prefix": "mqlinfostring", 875 | "body": "MQLInfoString(${1:int property_id})$0", 876 | "description": " Returns the value of a corresponding property of a running mql5 program." 877 | }, 878 | //Symbol info 879 | "SymbolsTotal": { 880 | "prefix": "symbolstotal", 881 | "body": "SymbolsTotal(${1:bool selected})$0", 882 | "description": " Returns the number of available (selected in Market Watch or all) symbols." 883 | }, 884 | "SymbolName": { 885 | "prefix": "symbolname", 886 | "body": "SymbolName(${1:int pos}, ${2:bool selected})$0", 887 | "description": " returns the name of the symbol from the marketwatch window." 888 | }, 889 | "SymbolSelect": { 890 | "prefix": "symbolselect", 891 | "body": "SymbolSelect(${1:string name}, ${2:bool select})$0", 892 | "description": " Selects a symbol in the Market Watch window or removes a symbol from the window." 893 | }, 894 | "SymbolIsSynchronized": { 895 | "prefix": "symbolissync", 896 | "body": "SymbolIsSynchronized(${1:string name})$0", 897 | "description": " The function checks whether data of a selected symbol in the terminal are synchronized with data on the trade server." 898 | }, 899 | "SymbolInfoTick": { 900 | "prefix": "symbolinfotick", 901 | "body": "SymbolInfoTick(${1:string name}, ${2:MqlTick& tick})$0", 902 | "description": " returns current prices of a specified symbol in a variable of the MqlTick type." 903 | }, 904 | "MarketBookAdd": { 905 | "prefix": "marketbookadd", 906 | "body": "MarketBookAdd(${1:string name})$0", 907 | "description": " Provides opening of Depth of Market for a selected symbol, and subscribes for receiving notifications of the DOM changes." 908 | }, 909 | "MarketBookRelease": { 910 | "prefix": "marketbookrelease", 911 | "body": "MarketBookRelease(${1:string name})$0", 912 | "description": " Provides closing of Depth of Market for a selected symbol, and cancels the subscription for receiving notifications of the DOM changes." 913 | }, 914 | "MarketBookGet": { 915 | "prefix": "marketbookget", 916 | "body": "MarketBookGet(${1:string name}, ${2:MqlBookInfo& book[]})$0", 917 | "description": " Returns a structure array MqlBookInfo containing records of the Depth of Market of a specified symbol." 918 | }, 919 | "SymbolInfoInteger": { 920 | "prefix": "symbolinfoint", 921 | "body": "SymbolInfoInteger(${1:string name}, ${2:ENUM_SYMBOL_INFO_STRING prop_id})$0", 922 | "description": " Returns the corresponding property of a specified symbol." 923 | }, 924 | "SymbolInfoString": { 925 | "prefix": "symbolinfostr", 926 | "body": "SymbolInfoString(${1:string name}, ${2:ENUM_SYMBOL_INFO_INTEGER prop_id})$0", 927 | "description": " Returns the corresponding property of a specified symbol." 928 | }, 929 | "SymbolInfoDouble": { 930 | "prefix": "symbolinfodouble", 931 | "body": "SymbolInfoDouble(${1:string name}, ${2:ENUM_SYMBOL_INFO_DOUBLE prop_id})$0", 932 | "description": " Returns the corresponding property of a specified symbol." 933 | }, 934 | // symbol info double enums 935 | "SYMBOL_BID":{ 936 | "prefix": "_symbolinfodouble", 937 | "body": "SYMBOL_BID", 938 | "description":" Bid" 939 | }, 940 | "SYMBOL_ASK":{ 941 | "prefix": "_symbolinfodouble", 942 | "body": "SYMBOL_ASK", 943 | "description":" Ask" 944 | }, 945 | "SYMBOL_POINT":{ 946 | "prefix": "_symbolinfodouble", 947 | "body": "SYMBOL_POINT", 948 | "description":" Symbol point value." 949 | }, 950 | "SYMBOL_TRADE_TICK_VALUE":{ 951 | "prefix": "_symbolinfodouble", 952 | "body": "SYMBOL_TRADE_TICK_VALUE", 953 | "description":" Value of one tick" 954 | }, 955 | "SYMBOL_TRADE_TICK_SIZE":{ 956 | "prefix": "_symbolinfodouble", 957 | "body": "SYMBOL_TRADE_TICK_SIZE", 958 | "description":" Minimal price change" 959 | }, 960 | "SYMBOL_VOLUME_MIN":{ 961 | "prefix": "_symbolinfodouble", 962 | "body": "SYMBOL_VOLUME_MIN", 963 | "description":" Minimal volume for a deal" 964 | }, 965 | "SYMBOL_VOLUME_MAX":{ 966 | "prefix": "_symbolinfodouble", 967 | "body": "SYMBOL_VOLUME_MAX", 968 | "description":" Maximum volume for a deal." 969 | }, 970 | "SYMBOL_VOLUME_STEP":{ 971 | "prefix": "_symbolinfodouble", 972 | "body": "SYMBOL_VOLUME_STEP", 973 | "description":" Minimal volume change step for deal execution" 974 | }, 975 | "SYMBOL_MARGIN_INITIAL":{ 976 | "prefix": "_symbolinfodouble", 977 | "body": "SYMBOL_MARGIN_INITIAL", 978 | "description":" Initial margin means the amount in the margin currency required for opening an order with the volume of one lot. It is used for checking a client's assets when he or she enters the market." 979 | }, 980 | 981 | // symbol info string enums 982 | "SYMBOL_CURRENCY_BASE":{ 983 | "prefix": "_symbolinfostring", 984 | "body": "SYMBOL_CURRENCY_BASE", 985 | "description":" Basic currency of a symbol." 986 | }, 987 | 988 | "SYMBOL_CURRENCY_PROFIT":{ 989 | "prefix": "_symbolinfostring", 990 | "body": "SYMBOL_CURRENCY_PROFIT", 991 | "description":" Profit/counter currency of a symbol." 992 | }, 993 | "SYMBOL_CURRENCY_MARGIN":{ 994 | "prefix": "_symbolinfostring", 995 | "body": "SYMBOL_CURRENCY_MARGIN", 996 | "description":" Margin Currency" 997 | }, 998 | "SYMBOL_DESCRIPTION":{ 999 | "prefix": "_symbolinfostring", 1000 | "body": "SYMBOL_DESCRIPTION", 1001 | "description":" Symbol Description." 1002 | }, 1003 | 1004 | // symbol info int enums 1005 | "SYMBOL_SELECT":{ 1006 | "prefix": "_symbolinfoint", 1007 | "body": "SYMBOL_SELECT", 1008 | "description":" Symbol is selected in Market Watch. Some symbols can be hidden in Market Watch, but still they are considered as selected." 1009 | }, 1010 | "SYMBOL_DIGITS":{ 1011 | "prefix": "_symbolinfoint", 1012 | "body": "SYMBOL_DIGITS", 1013 | "description":" Number of decimal places in the symbol quote." 1014 | }, 1015 | "SYMBOL_TIME":{ 1016 | "prefix": "_symbolinfoint", 1017 | "body": "SYMBOL_TIME", 1018 | "description":" Time of the last quote." 1019 | }, 1020 | 1021 | 1022 | // series info integer 1023 | "SeriesInfoInteger": { 1024 | "prefix": "seriesinfoint", 1025 | "body": "SeriesInfoInteger(${1:string name}, ${2:ENUM_TIMEFRAMES timeframe}, ${3:ENUM_SERIES_INFO_INTEGER prop_id})$0", 1026 | "description": " Returns information about the state of historical data." 1027 | }, 1028 | // series info enums 1029 | "SERIES_BARS_COUNT":{ 1030 | "prefix": "_seriesinfoint", 1031 | "body": "SERIES_BARS_COUNT", 1032 | "description":" Bars count for the symbol-period for the current moment" 1033 | }, 1034 | "SERIES_FIRSTDATE":{ 1035 | "prefix": "_seriesinfoint", 1036 | "body": "SERIES_FIRSTDATE", 1037 | "description":" The very first date for the symbol-period for the current moment" 1038 | }, 1039 | "SERIES_LASTBAR_DATE":{ 1040 | "prefix": "_seriesinfoint", 1041 | "body": "SERIES_LASTBAR_DATE", 1042 | "description":" Open time of the last bar of the symbol-period" 1043 | }, 1044 | "SERIES_SERVER_FIRSTDATE":{ 1045 | "prefix": "_seriesinfoint", 1046 | "body": "SERIES_SERVER_FIRSTDATE", 1047 | "description":" The very first date in the history of the symbol on the server regardless of the timeframe" 1048 | }, 1049 | // bars 1050 | "Bars_From_To": { 1051 | "prefix": "bars", 1052 | "body": "Bars(${1:string name}, ${2:ENUM_TIMEFRAMES timeframe}, ${3:datetime start_time}, ${4:datetime stop_time})$0", 1053 | "description": " Returns the number of bars count in the history for a specified symbol and period." 1054 | }, 1055 | "Bars": { 1056 | "prefix": "bars", 1057 | "body": "Bars(${1:string name}, ${2:ENUM_TIMEFRAMES timeframe})$0", 1058 | "description": " Returns the number of bars count in the history for a specified symbol and period." 1059 | }, 1060 | "BarsCalculated": { 1061 | "prefix": "barscalculated", 1062 | "body": "BarsCalculated(${1:int ind_handle})$0", 1063 | "description": " Returns the number of calculated data for the specified indicator" 1064 | }, 1065 | "IndicatorRelease": { 1066 | "prefix": "indicatorrelease", 1067 | "body": "IndicatorRelease(${1:int ind_handle})$0", 1068 | "description": " removes an indicator handle and releases the calculation block of the indicator, if it's not used by anyone else." 1069 | }, 1070 | "CopyTicks": { 1071 | "prefix": "copyticks", 1072 | "body": "CopyTicks(${1:string symbol}, ${2:MqlTick& tickarray[]}, ${3:uint flags=COPY_TICKS_ALL}, ${4:ulong from=0}, ${5:uint count=0})$0", 1073 | "description": " receives ticks in the MqlTick format into ticks_array." 1074 | }, 1075 | "CopyBuffer": { 1076 | "prefix": "copybuffer", 1077 | "body": "CopyBuffer(${1:int handle}, ${2:int buffer_number}, ${3:int start_pos|datetime start_time}, ${4:int count|datetime stop_time}, ${5:double buffer[]})$0", 1078 | "description": " Gets data of a specified buffer of a certain indicator in the necessary quantity." 1079 | }, 1080 | "CopyRates": { 1081 | "prefix": "copyrates", 1082 | "body": "CopyRates(${1:string symbol}, ${2:ENUM_TIMEFRAMES timeframe}, ${3:int start_pos|datetime start_time}, ${4:int count|datetime stop_time}, ${5:MqlRates rates_array[]})$0", 1083 | "description": " Gets history data of MqlRates structure of a specified symbol-period in specified quantity into the rates_array array. The elements ordering of the copied data is from present to the past, i.e., starting position of 0 means the current bar." 1084 | }, 1085 | "EventSetMillisecondTimer": { 1086 | "prefix": "eventsetmillisecond", 1087 | "body": "EventSetMillisecondTimer(${1:int milliseconds})$0", 1088 | "description": " indicates to the client terminal that timer events should be generated at intervals less than one second for this Expert Advisor or indicator." 1089 | }, 1090 | "EventSetTimer": { 1091 | "prefix": "eventsetimer", 1092 | "body": "EventSetTimer(${1:int seconds})$0", 1093 | "description": " indicates to the client terminal, that for this indicator or Expert Advisor, events from the timer must be generated with the specified periodicity." 1094 | }, 1095 | "EventKillTimer": { 1096 | "prefix": "eventkilltimer", 1097 | "body": "EventKillTimer()$0", 1098 | "description": " Specifies the client terminal that is necessary to stop the generation of events from Timer." 1099 | }, 1100 | "EventChartCustom": { 1101 | "prefix": "eventchartcustom", 1102 | "body": "EventChartCustom()$0", 1103 | "description": " The function generates a custom event for the specified chart." 1104 | }, 1105 | // MQL4 order functions 1106 | "OrderClose": { 1107 | "prefix": "orderclose", 1108 | "body": "OrderClose(${1:int ticket}, ${2:double lots}, ${3:double price}, ${4:int slippage}, ${5:color arrow_color=clrNone})$0", 1109 | "description": " Closes opened order." 1110 | }, 1111 | "OrderCloseBy": { 1112 | "prefix": "orderclose", 1113 | "body": "OrderCloseBy(${1:int ticket}, ${2:int opposite}, ${3:color arrow_color=clrNone})$0", 1114 | "description": " Closes an opened order by another opposite opened order." 1115 | }, 1116 | 1117 | "OrderClosePrice": { 1118 | "prefix": "ordercloseprice", 1119 | "body": "OrderClosePrice()$0", 1120 | "description": " Returns close price of the currently selected order. If the order is live this will return the price of which it is to be closed." 1121 | }, 1122 | "OrderCloseTime": { 1123 | "prefix": "orderclosetime", 1124 | "body": "OrderCloseTime(${1:int ticket}, ${2:double lots}, ${3:double price}, ${4:int slippage}, ${5:color arrow_color})$0", 1125 | "description": " Returns close time of the currently selected order." 1126 | }, 1127 | 1128 | "OrderComment": { 1129 | "prefix": "ordercomment", 1130 | "body": "OrderComment()$0", 1131 | "description": " Returns comment of the currently selected order." 1132 | }, 1133 | 1134 | "OrderCommission": { 1135 | "prefix": "ordercommission", 1136 | "body": "OrderCommission()$0", 1137 | "description": " Returns calculated commission of the currently selected order." 1138 | }, 1139 | 1140 | "OrderDelete": { 1141 | "prefix": "orderdelete", 1142 | "body": "OrderDelete(${1:int ticket}, ${5:color arrow_color=clrNone})$0", 1143 | "description": " Deletes previously opened pending order." 1144 | }, 1145 | 1146 | "OrderExpiration": { 1147 | "prefix": "orderexpiration", 1148 | "body": "OrderExpiration()$0", 1149 | "description": " Returns expiration date of the selected pending order." 1150 | }, 1151 | 1152 | "OrderLots": { 1153 | "prefix": "orderlots", 1154 | "body": "OrderLots()$0", 1155 | "description": " Returns amount of lots of the selected order." 1156 | }, 1157 | 1158 | "OrderMagicNumber": { 1159 | "prefix": "ordermagicnumber", 1160 | "body": "OrderMagicNumber()$0", 1161 | "description": " Returns an identifying (magic) number of the currently selected order." 1162 | }, 1163 | "OrderModify": { 1164 | "prefix": "ordermodify", 1165 | "body": "OrderModify(${1:int ticket}, ${2:double price}, ${3:double stoploss}, ${4:double takeprofit}, ${5:datetime expiration}, ${6:color arrow_color=clrNone})$0", 1166 | "description": " Modification of characteristics of the previously opened or pending orders." 1167 | }, 1168 | "OrderOpenPrice": { 1169 | "prefix": "orderopenprice", 1170 | "body": "OrderOpenPrice()$0", 1171 | "description": " Returns open price of the currently selected order." 1172 | }, 1173 | "OrderOpenTime": { 1174 | "prefix": "orderopentime", 1175 | "body": "OrderOpenTime()$0", 1176 | "description": " Returns open time of the currently selected order." 1177 | }, 1178 | "OrderPrint": { 1179 | "prefix": "orderprint", 1180 | "body": "OrderPrint()$0", 1181 | "description": " Prints information about the selected order in the log." 1182 | }, 1183 | "OrderProfit": { 1184 | "prefix": "orderprofit", 1185 | "body": "OrderProfit()$0", 1186 | "description": " Returns profit of the currently selected order." 1187 | }, 1188 | "OrderSelect": { 1189 | "prefix": "orderselect", 1190 | "body": "OrderSelect(${1:int position|int ticket}, ${2:SELECT_BY_POS|SELECT_BY_TICKET}, ${3:int pool=MODE_TRADES|MODE_HISTORY})$0", 1191 | "description": " The function selects an order for further processing." 1192 | }, 1193 | "OrderSend": { 1194 | "prefix": "ordersend", 1195 | "body": "OrderSend(${1:string symbol}, ${2:int cmd}, ${3:double volume}, ${4:double price}, ${5:int slippage}, ${6:double stoploss}, ${7:double takeprofit}, ${8:string comment=NULL}, ${9:int magic=0}, ${10:datetime expiration=0}, ${11:color arrow_color=clrNONE})$0", 1196 | "description": " The main function used to open market or place a pending order. Returns number of the ticket assigned to the order by the trade server or -1 if it fails." 1197 | }, 1198 | "OrdersHistoryTotal": { 1199 | "prefix": "ordershistorytotal", 1200 | "body": "OrdersHistoryTotal)$0", 1201 | "description": " Returns the number of closed orders in the account history loaded into the terminal. " 1202 | }, 1203 | "OrderStopLoss": { 1204 | "prefix": "orderstoploss", 1205 | "body": "OrderStopLoss(${1:int ticket}, ${2:double lots}, ${3:double price}, ${4:int slippage}, ${5:color arrow_color})$0", 1206 | "description": " Returns stoploss of the currently selected order." 1207 | }, 1208 | "OrdersTotal": { 1209 | "prefix": "orderstotal", 1210 | "body": "OrdersTotal()$0", 1211 | "description": " Returns the number of market and pending orders." 1212 | }, 1213 | "OrderSwap": { 1214 | "prefix": "orderswap", 1215 | "body": "OrderSwap()$0", 1216 | "description": " Returns swap value of the currently selected order." 1217 | }, 1218 | "OrderTakeProfit": { 1219 | "prefix": "ordertakeprofit", 1220 | "body": "OrderTakeProfit()$0", 1221 | "description": " Returns take profit value of the currently selected order." 1222 | }, 1223 | "OrderSymbol": { 1224 | "prefix": "ordersymbol", 1225 | "body": "OrderSymbol()$0", 1226 | "description": " Returns symbol of the currently selected order." 1227 | }, 1228 | "OrderTicket": { 1229 | "prefix": "orderticket", 1230 | "body": "OrderTicket()$0", 1231 | "description": " Returns order ticket number of the currently selected order." 1232 | }, 1233 | "OrderType": { 1234 | "prefix": "ordertype", 1235 | "body": "OrderType()$0", 1236 | "description": " Returns order operation type of the currently selected order. OP_BUY=buy-order, OP_SELL=sell-order, OP_BUYLIMIT=buy-limit, OP_BUYSTOP=buy-stop, OP_SELLLIMIT=sell-limit, OP_SELLSTOP=sell-stop." 1237 | }, 1238 | 1239 | // iIndicators 1240 | "iATR":{ 1241 | "prefix":"indicator", 1242 | "body":"iATR(${1:string symbol}, ${2:int timeframe}, ${3:int period}, ${4:int shift})$0", 1243 | "description":" Calculates the Average True Range indicator and returns its value" 1244 | }, 1245 | "iADX":{ 1246 | "prefix":"indicator", 1247 | "body":"iADX(${1:string symbol}, ${2:int timeframe}, ${3:int period}, ${4:int applied_price}, ${5:int mode}, ${6:int shift})$0", 1248 | "description":" Calculates the Average Directional Movement Index indicator and returns its value." 1249 | }, 1250 | "iBands":{ 1251 | "prefix":"indicator", 1252 | "body":"iBands(${1:string symbol}, ${2:int timeframe}, ${3:int period}, ${4:double deviation}, ${5:int bands_shift}, ${6:int applied_price}, ${7:int mode}, ${8:int shift})$0", 1253 | "description":" Calculates the Bollinger Bands® indicator and returns its value." 1254 | }, 1255 | "iCustom":{ 1256 | "prefix":"indicator", 1257 | "body":"iCustom(${1:string symbol}, ${2:int timeframe}, ${3:string name}, ${4: ... }, ${5:int buffer_index}, ${6:int shift})$0", 1258 | "description":" Calculates the specified custom indicator and returns its value. The custom indicator must be compiled (*.EX4 file) and be in the terminal_directory\\MQL4\\Indicators\\ directory." 1259 | }, 1260 | 1261 | "iMA":{ 1262 | "prefix":"indicator", 1263 | "body":"iMA(${1:string symbol}, ${2:int timeframe}, ${3:int ma_period}, ${4:int ma_shift}, ${5:int ma_method}, ${6:int applied_price}, ${7:int shift})$0", 1264 | "description":" Calculates the Moving Average indicator and returns its value. eg. iMA(NULL,0,13,8,MODE_SMMA,PRICE_MEDIAN,i);" 1265 | }, 1266 | 1267 | "iRSI":{ 1268 | "prefix":"indicator", 1269 | "body":"iRSI(${1:string symbol}, ${2:int timeframe}, ${3:int period}, ${4:int applied_price}, ${5:int shift})$0", 1270 | "description":" Calculates the RSI indicator and returns its value." 1271 | }, 1272 | "iStochastic":{ 1273 | "prefix":"indicator", 1274 | "body":"iStochastic(${1:string symbol}, ${2:int timeframe}, ${3:int Kperiod}, ${4:int Dperiod}, ${5:int slowing}, ${5:int method}, ${6:int price_field}, ${7:int mode}, ${8:int shift})$0", 1275 | "description":" Calculates the Moving Average indicator and returns its value. eg. iMA(NULL,0,13,8,MODE_SMMA,PRICE_MEDIAN,i);" 1276 | }, 1277 | // chart event enums 1278 | "ENUM_CHART_EVENT":{ 1279 | "prefix":"enumchartevent", 1280 | "body":"ENUM_CHART_EVENT", 1281 | "description":"There are 9 types of events that can be processed using the predefined function OnChartEvent(). " 1282 | }, 1283 | "CHARTEVENT_KEYDOWN":{ 1284 | "prefix":"_chartevent", 1285 | "body":"CHARTEVENT_KEYDOWN", 1286 | "description":"Keystrokes" 1287 | }, 1288 | "CHARTEVENT_MOUSE_MOVE":{ 1289 | "prefix":"_chartevent", 1290 | "body":"CHARTEVENT_MOUSE_MOVE", 1291 | "description":"Mouse move, mouse clicks (if CHART_EVENT_MOUSE_MOVE=true is set for the chart)" 1292 | }, 1293 | "CHARTEVENT_OBJECT_CREATE":{ 1294 | "prefix":"_chartevent", 1295 | "body":"CHARTEVENT_OBJECT_CREATE", 1296 | "description":"Graphical object created (if CHART_EVENT_OBJECT_CREATE=true is set for the chart)" 1297 | }, 1298 | "CHARTEVENT_OBJECT_DELETE":{ 1299 | "prefix":"_chartevent", 1300 | "body":"CHARTEVENT_OBJECT_DELETE", 1301 | "description":"Graphical object deleted (if CHART_EVENT_OBJECT_DELETE=true is set for the chart)" 1302 | }, 1303 | "CHARTEVENT_OBJECT_CHANGE":{ 1304 | "prefix":"_chartevent", 1305 | "body":"CHARTEVENT_OBJECT_CHANGE", 1306 | "description":"Graphical object property changed via the properties dialog" 1307 | }, 1308 | "CHARTEVENT_CLICK":{ 1309 | "prefix":"_chartevent", 1310 | "body":"CHARTEVENT_CLICK", 1311 | "description":"Clicking on a graphical object" 1312 | }, 1313 | "CHARTEVENT_OBJECT_DRAG":{ 1314 | "prefix":"_chartevent", 1315 | "body":"CHARTEVENT_OBJECT_DRAG", 1316 | "description":"Drag and drop of a graphical object" 1317 | }, 1318 | "CHARTEVENT_OBJECT_ENDEDIT":{ 1319 | "prefix":"_chartevent", 1320 | "body":"CHARTEVENT_OBJECT_ENDEDIT", 1321 | "description":"End of text editing in the graphical object Edit" 1322 | }, 1323 | "CHARTEVENT_CHART_CHANGE":{ 1324 | "prefix":"_chartevent", 1325 | "body":"CHARTEVENT_CHART_CHANGE", 1326 | "description":"Change of the chart size or modification of chart properties through the Properties dialog" 1327 | }, 1328 | "CHARTEVENT_CUSTOM":{ 1329 | "prefix":"_chartevent", 1330 | "body":"CHARTEVENT_CUSTOM", 1331 | "description":"Initial number of an event from a range of custom events" 1332 | }, 1333 | "CHARTEVENT_CUSTOM_LAST":{ 1334 | "prefix":"_chartevent", 1335 | "body":"CHARTEVENT_CUSTOM_LAST", 1336 | "description":"The final number of an event from a range of custom events" 1337 | }, 1338 | 1339 | 1340 | // Common MQL4 code snippets 1341 | "for forward": { 1342 | "prefix": "for", 1343 | "body": [ 1344 | "for(int i=0;i < ${1:int max_iter};i++)", 1345 | "{", 1346 | " $0", 1347 | "}" 1348 | ], 1349 | "description": "mql4 orderselect loop" 1350 | }, 1351 | "for backward": { 1352 | "prefix": "for", 1353 | "body": [ 1354 | "for(int i=${1:int max_iter} - 1;i >= 0 ;i--)", 1355 | "{", 1356 | " $0", 1357 | "}" 1358 | ], 1359 | "description": "mql4 orderselect loop" 1360 | }, 1361 | "for OrdersTotal": { 1362 | "prefix": "for", 1363 | "body": [ 1364 | "for(int i=OrdersTotal()-1;i>=0;i--)", 1365 | "{", 1366 | " if(OrderSelect(i,SELECT_BY_POS) && OrderSymbol() == _Symbol ${1: other conditions})", 1367 | " {", 1368 | " $0", 1369 | " }", 1370 | "}" 1371 | ], 1372 | "description": "mql4 orderselect loop" 1373 | }, 1374 | "for OrdersHistoryTotal": { 1375 | "prefix": "for", 1376 | "body": [ 1377 | "for(int i=OrdersHistoryTotal()-1;i>=0;i--)", 1378 | "{", 1379 | " if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY) && OrderSymbol() == _Symbol ${1: other conditions})", 1380 | " {", 1381 | " $0", 1382 | " }", 1383 | "}" 1384 | ], 1385 | "description": "mql4 orderselect loop" 1386 | }, 1387 | "OnStart": { 1388 | "prefix": "onstart", 1389 | "body": [ 1390 | "void OnStart()", 1391 | "{", 1392 | " $0", 1393 | "}" 1394 | ], 1395 | "description": "Script entry point" 1396 | }, 1397 | "Script_Template": { 1398 | "prefix": "mqltemplate_script", 1399 | "body": [ 1400 | "//+------------------------------------------------------------------+", 1401 | "//| ${1:file_name.mq4}.mq4", 1402 | "//| Copyright 2017, ${2:Author Name}", 1403 | "//| ${3:Link}", 1404 | "//+------------------------------------------------------------------+", 1405 | "#property copyright \"Copyright 2017, ${2:Author Name}\"", 1406 | "#property link \"${3:Link}\"", 1407 | "#property version \"1.00\"", 1408 | "#property strict", 1409 | "$4", 1410 | " ", 1411 | " ", 1412 | "void OnStart()", 1413 | "{", 1414 | " $5", 1415 | "}", 1416 | "$0" 1417 | ] 1418 | }, 1419 | "Expert_Template": { 1420 | "prefix": "mqltemplate_expert", 1421 | "body": [ 1422 | "//+------------------------------------------------------------------+", 1423 | "//| ${1:file_name.mq4}.mq4", 1424 | "//| Copyright 2017, ${2:Author Name}", 1425 | "//| ${3:Link}", 1426 | "//+------------------------------------------------------------------+", 1427 | "#property copyright \"Copyright 2017, ${2:Author Name}\"", 1428 | "#property link \"${3:Link}\"", 1429 | "#property version \"1.00\"", 1430 | "#property strict", 1431 | "$4", 1432 | " ", 1433 | "//+------------------------------------------------------------------+", 1434 | "//| Expert initialization function |", 1435 | "//+------------------------------------------------------------------+", 1436 | "int OnInit()", 1437 | "{", 1438 | " EventSetTimer(60);", 1439 | " ", 1440 | " return(INIT_SUCCEEDED);", 1441 | "}", 1442 | "//+------------------------------------------------------------------+", 1443 | "//| Expert deinitialization function |", 1444 | "//+------------------------------------------------------------------+", 1445 | ",void OnDeinit(const int reason)", 1446 | "{", 1447 | " EventKillTimer();", 1448 | " ", 1449 | "}", 1450 | "//+------------------------------------------------------------------+", 1451 | "//| Expert tick function |", 1452 | "//+------------------------------------------------------------------+", 1453 | "void OnTick()", 1454 | "{", 1455 | " ", 1456 | "}", 1457 | "//+------------------------------------------------------------------+", 1458 | "//| Timer function |", 1459 | "//+------------------------------------------------------------------+", 1460 | "void OnTimer()", 1461 | "{", 1462 | " ", 1463 | "}", 1464 | "//+------------------------------------------------------------------+", 1465 | "//| ChartEvent function |", 1466 | "//+------------------------------------------------------------------+", 1467 | "void OnChartEvent(const int id,", 1468 | " const long &lparam,", 1469 | " const double &dparam,", 1470 | " const string &sparam)", 1471 | "{", 1472 | " ", 1473 | "}", 1474 | "//+------------------------------------------------------------------+", 1475 | ], 1476 | "description":"expert advisor template" 1477 | }, 1478 | 1479 | "Function Header": { 1480 | "prefix": "functionheader", 1481 | "body": [ 1482 | "//+------------------------------------------------------------------+", 1483 | "//| ${1:type} ${2:FuntionName} : ${3:description}", 1484 | "//+------------------------------------------------------------------+", 1485 | "${1:type} ${2:FunctionName}($4)", 1486 | "{", 1487 | " $0", 1488 | "}" 1489 | ] 1490 | } 1491 | } 1492 | ======= 1493 | { 1494 | // default types 1495 | "datetime": { 1496 | "prefix": "datetime", 1497 | "body": "datetime" 1498 | }, 1499 | "color": { 1500 | "prefix": "color", 1501 | "body": "color" 1502 | }, 1503 | "ulong": { 1504 | "prefix": "ulong", 1505 | "body": "ulong" 1506 | }, 1507 | "ushort": { 1508 | "prefix": "ushort", 1509 | "body": "ushort" 1510 | }, 1511 | "uchar": { 1512 | "prefix": "uchar", 1513 | "body": "uchar" 1514 | }, 1515 | "uint": { 1516 | "prefix": "uint", 1517 | "body": "uint" 1518 | }, 1519 | "string": { 1520 | "prefix": "string", 1521 | "body": "string" 1522 | }, 1523 | "NULL": { 1524 | "prefix": "null", 1525 | "body": "NULL" 1526 | }, 1527 | "include": { 1528 | "prefix": "include", 1529 | "body": "#include <${1:file_name.mqh}>$0", 1530 | "description": "preprocessor include directive" 1531 | }, 1532 | 1533 | 1534 | "dynamic_cast":{ 1535 | "prefix":"dynamic_cast", 1536 | "body":"dynamic_cast<${1:type-id}>(${2:expression})$0", 1537 | "description":["Dynamic typecasting is performed using dynamic_cast operator that can be applied only to pointers to classes.", 1538 | "Type validation is performed at runtime. This means that the compiler does not check the data type applied for typecasting when dynamic_cast operator is used.", 1539 | "If a pointer is converted to a data type which is not the actual type of an object, the result is NULL." 1540 | ] 1541 | } 1542 | // enum_timeframes 1543 | "ENUM_TIMEFRAMES": { 1544 | "prefix":"enumtimeframes", 1545 | "body":"ENUM_TIMEFRAMES", 1546 | "description": "Timeframe enum" 1547 | }, 1548 | "PERIOD_M1": { 1549 | "prefix":"period", 1550 | "body":"PERIOD_M1", 1551 | }, 1552 | "PERIOD_M5": { 1553 | "prefix":"period", 1554 | "body":"PERIOD_M5", 1555 | }, 1556 | "PERIOD_M15": { 1557 | "prefix":"period", 1558 | "body":"PERIOD_M15", 1559 | }, 1560 | "PERIOD_M30": { 1561 | "prefix":"period", 1562 | "body":"PERIOD_M30", 1563 | }, 1564 | "PERIOD_H1": { 1565 | "prefix":"period", 1566 | "body":"PERIOD_H1", 1567 | }, 1568 | "PERIOD_H4": { 1569 | "prefix":"period", 1570 | "body":"PERIOD_H4", 1571 | }, 1572 | "PERIOD_D1": { 1573 | "prefix":"period", 1574 | "body":"PERIOD_D1", 1575 | }, 1576 | "PERIOD_W1": { 1577 | "prefix":"period", 1578 | "body":"PERIOD_W1", 1579 | }, 1580 | "PERIOD_MN1": { 1581 | "prefix":"period", 1582 | "body":"PERIOD_MN1", 1583 | }, 1584 | // order commands 1585 | "OP_BUY": { 1586 | "prefix":"opbuy", 1587 | "body":"OP_BUY", 1588 | }, 1589 | "OP_BUYLIMIT": { 1590 | "prefix":"opbuylimit", 1591 | "body":"OP_BUYLIMIT", 1592 | }, 1593 | "OP_BUYSTOP": { 1594 | "prefix":"opbuystop", 1595 | "body":"OP_BUYSTOP", 1596 | }, 1597 | "OP_SELL": { 1598 | "prefix":"opsell", 1599 | "body":"OP_SELL", 1600 | }, 1601 | "OP_SELLLIMIT": { 1602 | "prefix":"opselllimit", 1603 | "body":"OP_SELLLIMIT", 1604 | }, 1605 | "OP_SELLSTOP": { 1606 | "prefix":"opsellstop", 1607 | "body":"OP_SELLSTOP", 1608 | }, 1609 | 1610 | // enum ma method 1611 | "ENUM_MA_METHOD": { 1612 | "prefix":"enummamethod", 1613 | "body":"ENUM_TIMEFRAMES", 1614 | "description": "Timeframe enum" 1615 | }, 1616 | "MODE_SMA": { 1617 | "prefix":"ma_method", 1618 | "body":"MODE_SMA", 1619 | "description":"Simple averaging" 1620 | }, 1621 | "MODE_EMA": { 1622 | "prefix":"ma_method", 1623 | "body":"MODE_EMA", 1624 | "description":"Exponential averaging" 1625 | }, 1626 | "MODE_SMMA": { 1627 | "prefix":"ma_method", 1628 | "body":"MODE_SMMA", 1629 | "description":"Smoothed averaging" 1630 | }, 1631 | "MODE_LWMA": { 1632 | "prefix":"ma_method", 1633 | "body":"MODE_LWMA", 1634 | "description":"Linear-weighted averaging" 1635 | }, 1636 | 1637 | // enum applied price 1638 | "ENUM_APPLIED_PRICE": { 1639 | "prefix":"enumappliedprice", 1640 | "body":"ENUM_APPLIED_PRICE", 1641 | "description": "Applied price enum" 1642 | }, 1643 | "PRICE_CLOSE": { 1644 | "prefix":"applied_price", 1645 | "body":"PRICE_CLOSE", 1646 | 1647 | }, 1648 | "PRICE_OPEN": { 1649 | "prefix":"applied_price", 1650 | "body":"PRICE_OPEN", 1651 | 1652 | }, 1653 | "PRICE_HIGH": { 1654 | "prefix":"applied_price", 1655 | "body":"PRICE_HIGH", 1656 | 1657 | }, 1658 | "PRICE_LOW": { 1659 | "prefix":"applied_price", 1660 | "body":"PRICE_LOW", 1661 | }, 1662 | "PRICE_MEDIAN": { 1663 | "prefix":"applied_price", 1664 | "body":"PRICE_MEDIAN", 1665 | 1666 | }, 1667 | "PRICE_TYPICAL": { 1668 | "prefix":"applied_price", 1669 | "body":"PRICE_TYPICAL", 1670 | 1671 | }, 1672 | "PRICE_WEIGHTED": { 1673 | "prefix":"applied_price", 1674 | "body":"PRICE_WEIGHTED", 1675 | }, 1676 | 1677 | // MQL structs 1678 | "MqlDateTime": { 1679 | "prefix": "mqldatetime", 1680 | "body": "MqlDateTime $0", 1681 | "description": " structure contains eight fields of the int type" 1682 | }, 1683 | "MqlParam": { 1684 | "prefix": "mqlparam", 1685 | "body": "MqlParam $0", 1686 | "description": " The MqlParam structure has been specially designed to provide input parameters when creating the handle of a technical indicator using the IndicatorCreate() function." 1687 | }, 1688 | "MqlRates": { 1689 | "prefix": "mqlrates", 1690 | "body": "MqlRates $0", 1691 | "description": " structure stores information about the prices, volumes and spread." 1692 | }, 1693 | "MqlBookInfo": { 1694 | "prefix": "mqlbookinfo", 1695 | "body": "MqlBookInfo $0", 1696 | "description": " provides information about the market depth data" 1697 | }, 1698 | "MqlTradeRequest": { 1699 | "prefix": "mqltraderequest", 1700 | "body": "MqlTradeRequest $0", 1701 | "description": " Interaction between the client terminal and a trade server for executing the order placing operation is performed by using trade requests. " 1702 | }, 1703 | "MqlTradeCheckResult": { 1704 | "prefix": "mqltradecheckresult", 1705 | "body": "MqlTradeCheckResult $0", 1706 | "description": " Before sending a request for a trade operation to a trade server, it is recommended to check it. The check is performed using the OrderCheck() function, to which the checked request and a variable of the MqlTradeCheckResult structure type are passed. The check result will be written to this variable." 1707 | }, 1708 | "MqlTradeResult": { 1709 | "prefix": "mqltraderesult", 1710 | "body": "MqlTradeResult $0", 1711 | "description": " As result of a trade request, a trade server returns data about the trade request processing result as a special predefined structure of MqlTradeResult type." 1712 | }, 1713 | "MqlTick": { 1714 | "prefix": "mqltick", 1715 | "body": "MqlTick $0", 1716 | "description": " This is a structure for storing the latest prices of the symbol. It is designed for fast retrieval of the most requested information about current prices." 1717 | }, 1718 | // Predefined variables 1719 | "_Symbol":{ 1720 | "prefix":"symbol", 1721 | "body":"_Symbol", 1722 | "description":" Returns the string value of the current symbol." 1723 | }, 1724 | "_Digits": { 1725 | "prefix": "digits", 1726 | "body": "_Digits$0", 1727 | "description": " Number of decimal places" 1728 | }, 1729 | "_Point": { 1730 | "prefix": "point", 1731 | "body": "_Point$0", 1732 | "description": " Size of the current symbol point in the quote currency" 1733 | }, 1734 | "_LastError": { 1735 | "prefix": "lasterror", 1736 | "body": "_LastError$0", 1737 | "description": " last error code" 1738 | }, 1739 | "_Period": { 1740 | "prefix": "period", 1741 | "body": "_Period$0", 1742 | "description": " value of the timeframe of the current chart." 1743 | }, 1744 | "_RandomSeed": { 1745 | "prefix": "randomseed", 1746 | "body": "_RandomSeed$0", 1747 | "description": " Variable for storing the current state when generating pseudo-random integers" 1748 | }, 1749 | "_StopFlag": { 1750 | "prefix": "stopflag", 1751 | "body": "_StopFlag$0", 1752 | "description": " contains the flag of the mql5-program stop" 1753 | }, 1754 | "_UninitReason": { 1755 | "prefix": "uninitreason", 1756 | "body": "_UninitReason$0", 1757 | "description": " contains the code of the program uninitialization reason." 1758 | }, 1759 | "Bid": { 1760 | "prefix": "bid", 1761 | "body": "Bid$0", 1762 | "description": " bid" 1763 | }, 1764 | "Ask": { 1765 | "prefix": "ask", 1766 | "body": "Ask$0", 1767 | "description": " ask" 1768 | }, 1769 | // MQL4 built-in arrays 1770 | "Open[]": { 1771 | "prefix": "Open", 1772 | "body": "Open[${1:i}]$0", 1773 | "description": " Series array that contains open prices of each bar of the current chart" 1774 | }, 1775 | "High[]": { 1776 | "prefix": "High", 1777 | "body": "High[${1:i}]$0", 1778 | "description": " Series array that contains high prices of each bar of the current chart" 1779 | }, 1780 | "Low[]": { 1781 | "prefix": "Low", 1782 | "body": "Low[${1:i}]$0", 1783 | "description": " Series array that contains low prices of each bar of the current chart" 1784 | }, 1785 | "Close[]": { 1786 | "prefix": "Close", 1787 | "body": "Close[${1:i}]$0", 1788 | "description": " Series array that contains close prices of each bar of the current chart" 1789 | }, 1790 | "Time[]": { 1791 | "prefix": "Time", 1792 | "body": "Time[${1:i}]$0", 1793 | "description": " Series array that contains time of each bar of the current chart" 1794 | }, 1795 | "Volume[]": { 1796 | "prefix": "Volume", 1797 | "body": "Volume[${1:i}]$0", 1798 | "description": " Series array that contains volume of each bar of the current chart" 1799 | }, 1800 | // Common functions 1801 | "Alert": { 1802 | "prefix": "alert", 1803 | "body": "Alert(${1:argument, ...})$0", 1804 | "description": " Displays a message in a separate window." 1805 | }, 1806 | "Check Pointer": { 1807 | "prefix": "checkpointer", 1808 | "body": "CheckPointer(${1:object* anytype})$0", 1809 | "description": " The function returns the type of the object pointer." 1810 | }, 1811 | "Comment": { 1812 | "prefix": "comment", 1813 | "body": "Comment(${1:argument, ...})$0", 1814 | "description": " outputs a comment defined by a user in the top left corner of a chart." 1815 | }, 1816 | "DebugBreak": { 1817 | "prefix": "debugbreak", 1818 | "body": "DebugBreak()$0", 1819 | "description": " sets a debug break point" 1820 | }, 1821 | "ExpertRemove": { 1822 | "prefix": "expertremove", 1823 | "body": "ExpertRemove()$0", 1824 | "description": " stops an Expert Advisor and unloads it from a chart." 1825 | }, 1826 | "GetPointer": { 1827 | "prefix": "getpointer", 1828 | "body": "GetPointer(${1:object anytype})$0", 1829 | "description": " returns the object pointer." 1830 | }, 1831 | "GetTickCount": { 1832 | "prefix": "gettickcount", 1833 | "body": "GetTickCount()$0", 1834 | "description": " returns the number of milliseconds that elapsed since the system start" 1835 | }, 1836 | "GetMicrosecondCount": { 1837 | "prefix": "getmicrosecondcount", 1838 | "body": "GetMicrosecondCount()$0", 1839 | "description": " returns the number of microseconds that have elapsed since the start of MQL5-program." 1840 | }, 1841 | "MessageBox": { 1842 | "prefix": "messagebox", 1843 | "body": "MessageBox(${1:string text}, ${2:caption=NULL}, ${3:int flags})$0", 1844 | "description": " creates and shows a message box and manages it.." 1845 | }, 1846 | "PeriodSeconds": { 1847 | "prefix": "periodseconds", 1848 | "body": "PeriodSeconds(${1:ENUM_TIMEFRAMES=PERIOD_CURRENT})$0", 1849 | "description": " number of seconds in a period." 1850 | }, 1851 | "PlaySound": { 1852 | "prefix": "playsound", 1853 | "body": "PlaySound(${1:string filename})$0", 1854 | "description": " plays a sound file." 1855 | }, 1856 | "Print": { 1857 | "prefix": "print", 1858 | "body": "Print(${1:argument, ...})$0", 1859 | "description": " enters a message in the Expert Advisor log. Parameters can be of any type." 1860 | }, 1861 | "PrintFormat": { 1862 | "prefix": "printformat", 1863 | "body": "PrintFormat(${1:string format_string}, ${2: ...})$0", 1864 | "description": " formats and enters sets of symbols and values in the Expert Advisor log in accordance with a preset format." 1865 | }, 1866 | "ResetLastError": { 1867 | "prefix": "resetlasterror", 1868 | "body": "ResetLastError()$0", 1869 | "description": " Sets the value of the predefined variable _LastError into zero." 1870 | }, 1871 | "SendNotification": { 1872 | "prefix": "sendnotification", 1873 | "body": "SendNotification(${1:string text})$0", 1874 | "description": " Sends push notifications to the mobile terminals, whose MetaQuotes IDs are specified in the \"Notifications\" tab.." 1875 | }, 1876 | "SendMail": { 1877 | "prefix": "sendmail", 1878 | "body": "SendMail(${1:string subject}, ${2:string text})$0", 1879 | "description": " Sends an email at the address specified in the settings window of the Email tab." 1880 | }, 1881 | "Sleep": { 1882 | "prefix": "sleep", 1883 | "body": "Sleep(${1:int milliseconds})$0", 1884 | "description": " The function suspends execution of the current Expert Advisor or script within a specified interval." 1885 | }, 1886 | "TranslateKey": { 1887 | "prefix": "translatekey", 1888 | "body": "TranslateKey(${1:int key_code})$0", 1889 | "description": " Returns a Unicode character by a virtual key code considering the current input language and the status of control keys." 1890 | }, 1891 | "WebRequest": { 1892 | "prefix": "webrequest", 1893 | "body": "WebRequest(${1:see docs})$0", 1894 | "description": " sends an HTTP request to a specified server. The function has two versions:" 1895 | }, 1896 | "ZeroMemory": { 1897 | "prefix": "zeromem", 1898 | "body": "ZeroMemory(${1:void &variable})$0", 1899 | "description": " resets a variable passed to it by reference." 1900 | }, 1901 | // Array functions 1902 | "ArraySize": { 1903 | "prefix": "arraysize", 1904 | "body": "ArraySize(${1:const void& array[]})", 1905 | "description": " The function returns the number of elements of a selected array.." 1906 | }, 1907 | "ArrayGetAsSeries": { 1908 | "prefix": "arraygetasseries", 1909 | "body": "ArrayGetAsSeries(${1:const void& array[]})$0", 1910 | "description": " It checks direction of an array index.." 1911 | }, 1912 | "ArraySetAsSeries": { 1913 | "prefix": "arraysetasseries", 1914 | "body": "ArraySetAsSeries(${1:const void& array[]}, ${bool flag})$0", 1915 | "description": " The function sets the AS_SERIES flag to a selected object of a dynamic array, and elements will be indexed like in timeseries." 1916 | }, 1917 | "ArrayResize": { 1918 | "prefix": "arrayresize", 1919 | "body": "ArrayResize(${1:void& array[]}, ${2:int new_size},${3:reserved_size=0})$0", 1920 | "description": " The function sets a new size for the first dimension" 1921 | }, 1922 | "ArrayInitialize": { 1923 | "prefix": "arrayinit", 1924 | "body": "ArrayInitialize(${1:T array[]}, ${2:T value})$0", 1925 | "description": " initializes a numeric array by a preset value." 1926 | }, 1927 | // Conversion functions 1928 | "CharToString": { 1929 | "prefix": "chartostring", 1930 | "body": "CharToString(${1:uchar char_code})$0", 1931 | "description": " Converting a symbol code into a one-character string." 1932 | }, 1933 | "CharArrayToString": { 1934 | "prefix": "chararraytostring", 1935 | "body": "CharArrayToString(${1:uchar array[]}, ${2:int start}, ${3:int count=1}, ${4:uint code_page=CP_ACP})$0", 1936 | "description": " It copies and converts part of array of uchar type into a returned string.." 1937 | }, 1938 | "ColorToString": { 1939 | "prefix": "colortostring", 1940 | "body": "ColorToString(${1:color color}, ${2:bool show_color_name})$0", 1941 | "description": " It converts color value into string of R,G,B form." 1942 | }, 1943 | "DoubleToString": { 1944 | "prefix": "doubletostring", 1945 | "body": "DoubleToString(${1:double value}, ${2:int digits=8})$0", 1946 | "description": " Converting numeric value into text string." 1947 | }, 1948 | "EnumToString": { 1949 | "prefix": "enumtostring", 1950 | "body": "EnumToString(${1:any_enum value})$0", 1951 | "description": " Converting an enumeration value of any type to a text form." 1952 | }, 1953 | "TimeToString": { 1954 | "prefix": "timetostring", 1955 | "body": "TimeToString(${1:datetime value}, ${2:int mode=TIME_DATE|TIME_MINUTES})$0", 1956 | "description": " Converting a value containing time in seconds elapsed since 01.01.1970 into a string of yyyy.mm.dd hh:mi format." 1957 | }, 1958 | "NormalizeDouble": { 1959 | "prefix": "normalizedouble", 1960 | "body": "NormalizeDouble(${1:double value}, ${2:int digits})$0", 1961 | "description": " Rounding floating point number to a specified accuracy." 1962 | }, 1963 | "StringToCharArray": { 1964 | "prefix": "stringtochararray", 1965 | "body": "StringToCharArray(${1:string text_string}, ${2:uchar& array[]}, ${3:int start=0}, ${4:int count=-1}, ${5:uint codepage=CP_ACP})$0", 1966 | "description": " Symbol-wise copies a string converted from Unicode to ANSI, to a selected place of array of uchar type. It returns the number of copied elements." 1967 | }, 1968 | "StringToTime": { 1969 | "prefix": "stringtitime", 1970 | "body": "StringToTime(${1:string value})$0", 1971 | "description": " converts a string containing time or date in yyyy.mm.dd [hh:mi] format into datetime type." 1972 | }, 1973 | "StringFormat": { 1974 | "prefix": "stringformat", 1975 | "body": "StringFormat(${1:string format}, ${2:params...})$0", 1976 | "description": " The function formats obtained parameters and returns a string." 1977 | }, 1978 | // Math functions 1979 | "MathAbs": { 1980 | "prefix": "math", 1981 | "body": "fabs(${1:double value})$0", 1982 | "description": " The function returns the absolute value (modulus) of the specified numeric value." 1983 | }, 1984 | "MathPow": { 1985 | "prefix": "math", 1986 | "body": "pow(${1:double base}, ${2:double exponent})$0", 1987 | "description": " The function returns the absolute value (modulus) of the specified numeric value." 1988 | }, 1989 | "MathArcsin": { 1990 | "prefix": "math", 1991 | "body": "asin(${1:double value})$0", 1992 | "description": " returns the arc sine of x within the range of -π/2 to π/2 radians." 1993 | }, 1994 | "MathArccos": { 1995 | "prefix": "math", 1996 | "body": "acos(${1:double value})$0", 1997 | "description": " returns the arccosine of x within the range 0 to π in radians." 1998 | }, 1999 | "MathCeil": { 2000 | "prefix": "math", 2001 | "body": "ceil(${1:double value})$0", 2002 | "description": " returns integer numeric value closest from above." 2003 | }, 2004 | "MathFloor": { 2005 | "prefix": "math", 2006 | "body": "floor(${1:double value})$0", 2007 | "description": " returns integer numeric value closest from below." 2008 | }, 2009 | "MathLog": { 2010 | "prefix": "math", 2011 | "body": "log(${1:double value})$0", 2012 | "description": " returns a natural logarithm." 2013 | }, 2014 | "MathLog10": { 2015 | "prefix": "math", 2016 | "body": "log10(${1:double value})$0", 2017 | "description": " Returns the logarithm of a number by base 10." 2018 | }, 2019 | "MathMax": { 2020 | "prefix": "math", 2021 | "body": "fmax(${1:double value1}, ${2:double value2})$0", 2022 | "description": " returns the maximal value of two values." 2023 | }, 2024 | "MathMin": { 2025 | "prefix": "math", 2026 | "body": "fmin(${1:double value1}, ${2:double value2})$0", 2027 | "description": " returns the minimal value of two values." 2028 | }, 2029 | "MathRand": { 2030 | "prefix": "math", 2031 | "body": "rand()$0", 2032 | "description": " Returns a pseudorandom integer within the range of 0 to 32767." 2033 | }, 2034 | "MathSrand": { 2035 | "prefix": "math", 2036 | "body": "srand(${int seed})$0", 2037 | "description": " Sets the starting point for generating a series of pseudorandom integers." 2038 | }, 2039 | "MathRound": { 2040 | "prefix": "math", 2041 | "body": "round(${1:double value})$0", 2042 | "description": " returns a value rounded off to the nearest integer of the specified numeric value." 2043 | }, 2044 | "MathIsValidNumber": { 2045 | "prefix": "math", 2046 | "body": "MathIsValidNumber(${1:double value})$0", 2047 | "description": " checks the correctness of a real number" 2048 | }, 2049 | "MathSqrt": { 2050 | "prefix": "math", 2051 | "body": "sqrt(${1:double value})$0", 2052 | "description": " Returns the square root of a number." 2053 | }, 2054 | // Time functions 2055 | "TimeCurrentStruct": { 2056 | "prefix": "timecurrent", 2057 | "body": "TimeCurrent(${1:MqlDateTime struct})$0", 2058 | "description": " MqlDateTime structure type variable has been passed as a parameter, it is filled accordingly" 2059 | }, 2060 | "TimeCurrent": { 2061 | "prefix": "timecurrent", 2062 | "body": "TimeCurrent()$0", 2063 | "description": " Returns the last known server time" 2064 | }, 2065 | "TimeTradeServer": { 2066 | "prefix": "timetradeserver", 2067 | "body": "TimeTradeServer()$0", 2068 | "description": " Returns the calculated current time of the trade server" 2069 | }, 2070 | "TimeLocal": { 2071 | "prefix": "timelocal", 2072 | "body": "TimeLocal()$0", 2073 | "description": " Returns the local time of a computer" 2074 | }, 2075 | "TimeLocal Struct": { 2076 | "prefix": "timelocal", 2077 | "body": "TimeLocal(${1:MqlDateTime &struct})$0", 2078 | "description": " Returns the local time of a computer; fills struct" 2079 | }, 2080 | "TimeGMT": { 2081 | "prefix": "timegmt", 2082 | "body": "TimeGMT()$0", 2083 | "description": " Returns the GMT, which is calculated taking into account the DST switch by the local time on the computer where the client terminal is running." 2084 | }, 2085 | "TimeGMT Struct": { 2086 | "prefix": "timegmt", 2087 | "body": "TimeGMT(${1:MqlDateTime &struct})$0", 2088 | "description": " Returns the GMT, which is calculated taking into account the DST switch by the local time on the computer where the client terminal is running." 2089 | }, 2090 | "TimeDaylightSavings": { 2091 | "prefix": "timedaylight", 2092 | "body": "TimeDaylightSavings()$0", 2093 | "description": " Returns correction for daylight saving time in seconds, if the switch to summer time has been made." 2094 | }, 2095 | "TimeGMTOffset": { 2096 | "prefix": "timegmtoffest", 2097 | "body": "TimeGMTOffset()$0", 2098 | "description": " Returns the current difference between GMT time and the local computer time in seconds" 2099 | }, 2100 | "TimeToStruct": { 2101 | "prefix": "timetostruct", 2102 | "body": "TimeToStruct(${1:datetime dt}, ${2:MqlDateTime &struct})$0", 2103 | "description": " Converts a value of datetime type (number of seconds since 01.01.1970) into a structure variable MqlDateTime." 2104 | }, 2105 | "StructToTime": { 2106 | "prefix": "structotime", 2107 | "body": "StructToTime(${1:MqlDateTime &struct})$0", 2108 | "description": " Converts a structure variable MqlDateTime into a value of datetime type and returns the resulting value." 2109 | }, 2110 | // String Functions 2111 | "StringAdd": { 2112 | "prefix": "stringadd", 2113 | "body": "StringAdd(${1:string& str_var}, ${2:string add_substring})$0", 2114 | "description": " adds a substring to the end of a string." 2115 | }, 2116 | "StringBufferLen": { 2117 | "prefix": "stringbufferlen", 2118 | "body": "StringBufferLen(${1:string string_var})$0", 2119 | "description": " returns the size of buffer allocated for the string." 2120 | }, 2121 | "StringCompare": { 2122 | "prefix": "stringcompare", 2123 | "body": "StringCompare(${1:string str1}, ${2:string str2},${bool case_sensitive=true})$0", 2124 | "description": " compares two strings and returns the comparison result in form of an integer.Case sensitivity mode selection. If it is true, then A>a. If it is false, then A=a." 2125 | }, 2126 | "StringFill": { 2127 | "prefix": "stringfill", 2128 | "body": "StringFill(${1:string& str_var}, ${2:ushort character})$0", 2129 | "description": " It fills out a selected string by specified symbols" 2130 | }, 2131 | "StringFind": { 2132 | "prefix": "stringfind", 2133 | "body": "StringFind(${1:string value}, ${2:string match_substring},${3:int start_pos=0})$0", 2134 | "description": " Search for a substring in a string." 2135 | }, 2136 | "StringGetCharacter": { 2137 | "prefix": "stringgetchar", 2138 | "body": "StringGetCharacter(${1:string str_var}, ${2:int pos})$0", 2139 | "description": " returns value of a symbol, located in the specified position of a string." 2140 | }, 2141 | "StringLen": { 2142 | "prefix": "stringlen", 2143 | "body": "StringLen(${1:string str_var})$0", 2144 | "description": " Returns the number of symbols in a string" 2145 | }, 2146 | "StringReplace": { 2147 | "prefix": "stringreplace", 2148 | "body": "StringReplace(${1:string& str}, ${2:string find}, ${3:string replace})$0", 2149 | "description": [ 2150 | " replaces all the found substrings of a string by a set sequence of symbols.", 2151 | "The function returns the number of replacements in case of success, otherwise -1. To get an error code call the GetLastError() function." 2152 | ] 2153 | }, 2154 | "StringSplit": { 2155 | "prefix": "stringsplit", 2156 | "body": "StringSplit(${1:string str}, ${2:ushort separator}, ${3:string &result[]})$0", 2157 | "description": " Gets substrings by a specified separator from the specified string, returns the number of substrings obtained." 2158 | }, 2159 | "StringSubstr": { 2160 | "prefix": "stringsub", 2161 | "body": "StringSubstr(${1:string str}, ${2:int start_pos}, ${3:int length=-1)$0", 2162 | "description": " Extracts a substring from a text string starting from the specified position." 2163 | }, 2164 | "StringToLower": { 2165 | "prefix": "stringtolower", 2166 | "body": "StringToLower(${1:string& str})$0", 2167 | "description": " Transforms all symbols of a selected string into lowercase." 2168 | }, 2169 | "StringToUpper": { 2170 | "prefix": "stringtoupper", 2171 | "body": "StringToUpper(${1:string& str})$0", 2172 | "description": " Transforms all symbols of a selected string into capitals." 2173 | }, 2174 | "StringTrimRight": { 2175 | "prefix": "stringtrimright", 2176 | "body": "StringTrimRight(${1:string& str})$0", 2177 | "description": " The function cuts line feed characters, spaces and tabs in the right part of the string after the last meaningful symbol. The string is modified at place." 2178 | }, 2179 | "StringTrimLeft": { 2180 | "prefix": "stringtrimleft", 2181 | "body": "StringTrimLeft(${1:string& str})$0", 2182 | "description": " The function cuts line feed characters, spaces and tabs in the left part of the string till the first meaningful symbol. The string is modified at place." 2183 | }, 2184 | // Account info 2185 | "AccountInfoDouble": { 2186 | "prefix": "accountinfodouble", 2187 | "body": "AccountInfoDouble(${1:ENUM_ACOUNT_INFO_DOUBLE property_id})$0", 2188 | "description": " Returns the value of the corresponding account property." 2189 | }, 2190 | "AccountInfoInteger": { 2191 | "prefix": "accountinfoint", 2192 | "body": "AccountInfoInteger(${1:ENUM_ACOUNT_INFO_INTEGER property_id})$0", 2193 | "description": " Returns the value of the corresponding account property." 2194 | }, 2195 | "AccountInfoString": { 2196 | "prefix": "accountinfostring", 2197 | "body": "AccountInfoString(${1:ENUM_ACOUNT_INFO_STRING property_id})$0", 2198 | "description": " Returns the value of the corresponding account property." 2199 | }, 2200 | // Account int enums 2201 | "ACCOUNT_LOGIN": { 2202 | "prefix": "_account_int", 2203 | "body": "ACCOUNT_LOGIN$0", 2204 | "description": " Account number" 2205 | }, 2206 | "ACCOUNT_TRADE_MODE": { 2207 | "prefix": "_account_int", 2208 | "body": "ACCOUNT_TRADE_MODE$0", 2209 | "description": " Account trade mode" 2210 | }, 2211 | "ACCOUNT_LEVERAGE": { 2212 | "prefix": "_account_int", 2213 | "body": "ACCOUNT_LEVERAGE$0", 2214 | "description": " Account leverage" 2215 | }, 2216 | "ACCOUNT_LIMIT_ORDERS": { 2217 | "prefix": "_account_int", 2218 | "body": "ACCOUNT_LIMIT_ORDERS$0", 2219 | "description": " Maximum allowed number of active pending orders" 2220 | }, 2221 | "ACCOUNT_MARGIN_SO_MODE": { 2222 | "prefix": "_account_int", 2223 | "body": "ACCOUNT_MARGIN_SO_MODE$0", 2224 | "description": " Mode for setting the minimal allowed margin" 2225 | }, 2226 | "ACCOUNT_TRADE_ALLOWED": { 2227 | "prefix": "_account_int", 2228 | "body": "ACCOUNT_TRADE_ALLOWED$0", 2229 | "description": " Allowed trade for the current account" 2230 | }, 2231 | "ACCOUNT_TRADE_EXPERT": { 2232 | "prefix": "_account_int", 2233 | "body": "ACCOUNT_TRADE_EXPERT$0", 2234 | "description": " Allowed trade for an Expert Advisor" 2235 | }, 2236 | "ACCOUNT_MARGIN_MODE": { 2237 | "prefix": "_account_int", 2238 | "body": "ACCOUNT_MARGIN_MODE$0", 2239 | "description": " Margin calculation mode" 2240 | }, 2241 | // Terminal Info 2242 | "GetLastError": { 2243 | "prefix": "getlasterror", 2244 | "body": "GetLastError()$0", 2245 | "description": " Returns the contents of the system variable _LastError" 2246 | }, 2247 | "IsStopped": { 2248 | "prefix": "isstopped", 2249 | "body": "IsStopped()$0", 2250 | "description": " Checks the forced shutdown of an mql5 program" 2251 | }, 2252 | "UninitializeReason": { 2253 | "prefix": "uninitreason", 2254 | "body": "UninitializeReason()$0", 2255 | "description": " Returns the code of a reason for deinitialization." 2256 | }, 2257 | "TerminalInfoInteger": { 2258 | "prefix": "terminalinfoint", 2259 | "body": "TerminalInfoInteger(${1:int property_id})$0", 2260 | "description": " Returns the value of a corresponding property of the mql5 program environment" 2261 | }, 2262 | "TerminalInfoDouble": { 2263 | "prefix": "terminalinfodouble", 2264 | "body": "TerminalInfoDouble(${1:int property_id})$0", 2265 | "description": " Returns the value of a corresponding property of the mql5 program environment" 2266 | }, 2267 | "TerminalInfoString": { 2268 | "prefix": "terminalinfostring", 2269 | "body": "TerminalInfoString(${1:int property_id})$0", 2270 | "description": " Returns the value of a corresponding property of the mql5 program environment" 2271 | }, 2272 | "MQLInfoInteger": { 2273 | "prefix": "mqlinfoint", 2274 | "body": "MQLInfoInteger(${1:int property_id})$0", 2275 | "description": " Returns the value of a corresponding property of a running mql5 program." 2276 | }, 2277 | "MQLInfoString": { 2278 | "prefix": "mqlinfostring", 2279 | "body": "MQLInfoString(${1:int property_id})$0", 2280 | "description": " Returns the value of a corresponding property of a running mql5 program." 2281 | }, 2282 | //Symbol info 2283 | "SymbolsTotal": { 2284 | "prefix": "symbolstotal", 2285 | "body": "SymbolsTotal(${1:bool selected})$0", 2286 | "description": " Returns the number of available (selected in Market Watch or all) symbols." 2287 | }, 2288 | "SymbolName": { 2289 | "prefix": "symbolname", 2290 | "body": "SymbolName(${1:int pos}, ${2:bool selected})$0", 2291 | "description": " returns the name of the symbol from the marketwatch window." 2292 | }, 2293 | "SymbolSelect": { 2294 | "prefix": "symbolselect", 2295 | "body": "SymbolSelect(${1:string name}, ${2:bool select})$0", 2296 | "description": " Selects a symbol in the Market Watch window or removes a symbol from the window." 2297 | }, 2298 | "SymbolIsSynchronized": { 2299 | "prefix": "symbolissync", 2300 | "body": "SymbolIsSynchronized(${1:string name})$0", 2301 | "description": " The function checks whether data of a selected symbol in the terminal are synchronized with data on the trade server." 2302 | }, 2303 | "SymbolInfoTick": { 2304 | "prefix": "symbolinfotick", 2305 | "body": "SymbolInfoTick(${1:string name}, ${2:MqlTick& tick})$0", 2306 | "description": " returns current prices of a specified symbol in a variable of the MqlTick type." 2307 | }, 2308 | "MarketBookAdd": { 2309 | "prefix": "marketbookadd", 2310 | "body": "MarketBookAdd(${1:string name})$0", 2311 | "description": " Provides opening of Depth of Market for a selected symbol, and subscribes for receiving notifications of the DOM changes." 2312 | }, 2313 | "MarketBookRelease": { 2314 | "prefix": "marketbookrelease", 2315 | "body": "MarketBookRelease(${1:string name})$0", 2316 | "description": " Provides closing of Depth of Market for a selected symbol, and cancels the subscription for receiving notifications of the DOM changes." 2317 | }, 2318 | "MarketBookGet": { 2319 | "prefix": "marketbookget", 2320 | "body": "MarketBookGet(${1:string name}, ${2:MqlBookInfo& book[]})$0", 2321 | "description": " Returns a structure array MqlBookInfo containing records of the Depth of Market of a specified symbol." 2322 | }, 2323 | "SymbolInfoInteger": { 2324 | "prefix": "symbolinfoint", 2325 | "body": "SymbolInfoInteger(${1:string name}, ${2:ENUM_SYMBOL_INFO_STRING prop_id})$0", 2326 | "description": " Returns the corresponding property of a specified symbol." 2327 | }, 2328 | "SymbolInfoString": { 2329 | "prefix": "symbolinfostr", 2330 | "body": "SymbolInfoString(${1:string name}, ${2:ENUM_SYMBOL_INFO_INTEGER prop_id})$0", 2331 | "description": " Returns the corresponding property of a specified symbol." 2332 | }, 2333 | "SymbolInfoDouble": { 2334 | "prefix": "symbolinfodouble", 2335 | "body": "SymbolInfoDouble(${1:string name}, ${2:ENUM_SYMBOL_INFO_DOUBLE prop_id})$0", 2336 | "description": " Returns the corresponding property of a specified symbol." 2337 | }, 2338 | // symbol info double enums 2339 | "SYMBOL_BID":{ 2340 | "prefix": "_symbolinfodouble", 2341 | "body": "SYMBOL_BID", 2342 | "description":" Bid" 2343 | }, 2344 | "SYMBOL_ASK":{ 2345 | "prefix": "_symbolinfodouble", 2346 | "body": "SYMBOL_ASK", 2347 | "description":" Ask" 2348 | }, 2349 | "SYMBOL_POINT":{ 2350 | "prefix": "_symbolinfodouble", 2351 | "body": "SYMBOL_POINT", 2352 | "description":" Symbol point value." 2353 | }, 2354 | "SYMBOL_TRADE_TICK_VALUE":{ 2355 | "prefix": "_symbolinfodouble", 2356 | "body": "SYMBOL_TRADE_TICK_VALUE", 2357 | "description":" Value of one tick" 2358 | }, 2359 | "SYMBOL_TRADE_TICK_SIZE":{ 2360 | "prefix": "_symbolinfodouble", 2361 | "body": "SYMBOL_TRADE_TICK_SIZE", 2362 | "description":" Minimal price change" 2363 | }, 2364 | "SYMBOL_VOLUME_MIN":{ 2365 | "prefix": "_symbolinfodouble", 2366 | "body": "SYMBOL_VOLUME_MIN", 2367 | "description":" Minimal volume for a deal" 2368 | }, 2369 | "SYMBOL_VOLUME_MAX":{ 2370 | "prefix": "_symbolinfodouble", 2371 | "body": "SYMBOL_VOLUME_MAX", 2372 | "description":" Maximum volume for a deal." 2373 | }, 2374 | "SYMBOL_VOLUME_STEP":{ 2375 | "prefix": "_symbolinfodouble", 2376 | "body": "SYMBOL_VOLUME_STEP", 2377 | "description":" Minimal volume change step for deal execution" 2378 | }, 2379 | "SYMBOL_MARGIN_INITIAL":{ 2380 | "prefix": "_symbolinfodouble", 2381 | "body": "SYMBOL_MARGIN_INITIAL", 2382 | "description":" Initial margin means the amount in the margin currency required for opening an order with the volume of one lot. It is used for checking a client's assets when he or she enters the market." 2383 | }, 2384 | 2385 | // symbol info string enums 2386 | "SYMBOL_CURRENCY_BASE":{ 2387 | "prefix": "_symbolinfostring", 2388 | "body": "SYMBOL_CURRENCY_BASE", 2389 | "description":" Basic currency of a symbol." 2390 | }, 2391 | 2392 | "SYMBOL_CURRENCY_PROFIT":{ 2393 | "prefix": "_symbolinfostring", 2394 | "body": "SYMBOL_CURRENCY_PROFIT", 2395 | "description":" Profit/counter currency of a symbol." 2396 | }, 2397 | "SYMBOL_CURRENCY_MARGIN":{ 2398 | "prefix": "_symbolinfostring", 2399 | "body": "SYMBOL_CURRENCY_MARGIN", 2400 | "description":" Margin Currency" 2401 | }, 2402 | "SYMBOL_DESCRIPTION":{ 2403 | "prefix": "_symbolinfostring", 2404 | "body": "SYMBOL_DESCRIPTION", 2405 | "description":" Symbol Description." 2406 | }, 2407 | 2408 | // symbol info int enums 2409 | "SYMBOL_SELECT":{ 2410 | "prefix": "_symbolinfoint", 2411 | "body": "SYMBOL_SELECT", 2412 | "description":" Symbol is selected in Market Watch. Some symbols can be hidden in Market Watch, but still they are considered as selected." 2413 | }, 2414 | "SYMBOL_DIGITS":{ 2415 | "prefix": "_symbolinfoint", 2416 | "body": "SYMBOL_DIGITS", 2417 | "description":" Number of decimal places in the symbol quote." 2418 | }, 2419 | "SYMBOL_TIME":{ 2420 | "prefix": "_symbolinfoint", 2421 | "body": "SYMBOL_TIME", 2422 | "description":" Time of the last quote." 2423 | }, 2424 | 2425 | 2426 | // series info integer 2427 | "SeriesInfoInteger": { 2428 | "prefix": "seriesinfoint", 2429 | "body": "SeriesInfoInteger(${1:string name}, ${2:ENUM_TIMEFRAMES timeframe}, ${3:ENUM_SERIES_INFO_INTEGER prop_id})$0", 2430 | "description": " Returns information about the state of historical data." 2431 | }, 2432 | // series info enums 2433 | "SERIES_BARS_COUNT":{ 2434 | "prefix": "_seriesinfoint", 2435 | "body": "SERIES_BARS_COUNT", 2436 | "description":" Bars count for the symbol-period for the current moment" 2437 | }, 2438 | "SERIES_FIRSTDATE":{ 2439 | "prefix": "_seriesinfoint", 2440 | "body": "SERIES_FIRSTDATE", 2441 | "description":" The very first date for the symbol-period for the current moment" 2442 | }, 2443 | "SERIES_LASTBAR_DATE":{ 2444 | "prefix": "_seriesinfoint", 2445 | "body": "SERIES_LASTBAR_DATE", 2446 | "description":" Open time of the last bar of the symbol-period" 2447 | }, 2448 | "SERIES_SERVER_FIRSTDATE":{ 2449 | "prefix": "_seriesinfoint", 2450 | "body": "SERIES_SERVER_FIRSTDATE", 2451 | "description":" The very first date in the history of the symbol on the server regardless of the timeframe" 2452 | }, 2453 | // bars 2454 | "Bars_From_To": { 2455 | "prefix": "bars", 2456 | "body": "Bars(${1:string name}, ${2:ENUM_TIMEFRAMES timeframe}, ${3:datetime start_time}, ${4:datetime stop_time})$0", 2457 | "description": " Returns the number of bars count in the history for a specified symbol and period." 2458 | }, 2459 | "Bars": { 2460 | "prefix": "bars", 2461 | "body": "Bars(${1:string name}, ${2:ENUM_TIMEFRAMES timeframe})$0", 2462 | "description": " Returns the number of bars count in the history for a specified symbol and period." 2463 | }, 2464 | "BarsCalculated": { 2465 | "prefix": "barscalculated", 2466 | "body": "BarsCalculated(${1:int ind_handle})$0", 2467 | "description": " Returns the number of calculated data for the specified indicator" 2468 | }, 2469 | "IndicatorRelease": { 2470 | "prefix": "indicatorrelease", 2471 | "body": "IndicatorRelease(${1:int ind_handle})$0", 2472 | "description": " removes an indicator handle and releases the calculation block of the indicator, if it's not used by anyone else." 2473 | }, 2474 | "CopyTicks": { 2475 | "prefix": "copyticks", 2476 | "body": "CopyTicks(${1:string symbol}, ${2:MqlTick& tickarray[]}, ${3:uint flags=COPY_TICKS_ALL}, ${4:ulong from=0}, ${5:uint count=0})$0", 2477 | "description": " receives ticks in the MqlTick format into ticks_array." 2478 | }, 2479 | "CopyBuffer": { 2480 | "prefix": "copybuffer", 2481 | "body": "CopyBuffer(${1:int handle}, ${2:int buffer_number}, ${3:int start_pos|datetime start_time}, ${4:int count|datetime stop_time}, ${5:double buffer[]})$0", 2482 | "description": " Gets data of a specified buffer of a certain indicator in the necessary quantity." 2483 | }, 2484 | "CopyRates": { 2485 | "prefix": "copyrates", 2486 | "body": "CopyRates(${1:string symbol}, ${2:ENUM_TIMEFRAMES timeframe}, ${3:int start_pos|datetime start_time}, ${4:int count|datetime stop_time}, ${5:MqlRates rates_array[]})$0", 2487 | "description": " Gets history data of MqlRates structure of a specified symbol-period in specified quantity into the rates_array array. The elements ordering of the copied data is from present to the past, i.e., starting position of 0 means the current bar." 2488 | }, 2489 | "EventSetMillisecondTimer": { 2490 | "prefix": "eventsetmillisecond", 2491 | "body": "EventSetMillisecondTimer(${1:int milliseconds})$0", 2492 | "description": " indicates to the client terminal that timer events should be generated at intervals less than one second for this Expert Advisor or indicator." 2493 | }, 2494 | "EventSetTimer": { 2495 | "prefix": "eventsetimer", 2496 | "body": "EventSetTimer(${1:int seconds})$0", 2497 | "description": " indicates to the client terminal, that for this indicator or Expert Advisor, events from the timer must be generated with the specified periodicity." 2498 | }, 2499 | "EventKillTimer": { 2500 | "prefix": "eventkilltimer", 2501 | "body": "EventKillTimer()$0", 2502 | "description": " Specifies the client terminal that is necessary to stop the generation of events from Timer." 2503 | }, 2504 | "EventChartCustom": { 2505 | "prefix": "eventchartcustom", 2506 | "body": "EventChartCustom()$0", 2507 | "description": " The function generates a custom event for the specified chart." 2508 | }, 2509 | // MQL4 order functions 2510 | "OrderClose": { 2511 | "prefix": "orderclose", 2512 | "body": "OrderClose(${1:int ticket}, ${2:double lots}, ${3:double price}, ${4:int slippage}, ${5:color arrow_color=clrNone})$0", 2513 | "description": " Closes opened order." 2514 | }, 2515 | "OrderCloseBy": { 2516 | "prefix": "orderclose", 2517 | "body": "OrderCloseBy(${1:int ticket}, ${2:int opposite}, ${3:color arrow_color=clrNone})$0", 2518 | "description": " Closes an opened order by another opposite opened order." 2519 | }, 2520 | 2521 | "OrderClosePrice": { 2522 | "prefix": "ordercloseprice", 2523 | "body": "OrderClosePrice()$0", 2524 | "description": " Returns close price of the currently selected order. If the order is live this will return the price of which it is to be closed." 2525 | }, 2526 | "OrderCloseTime": { 2527 | "prefix": "orderclosetime", 2528 | "body": "OrderCloseTime(${1:int ticket}, ${2:double lots}, ${3:double price}, ${4:int slippage}, ${5:color arrow_color})$0", 2529 | "description": " Returns close time of the currently selected order." 2530 | }, 2531 | 2532 | "OrderComment": { 2533 | "prefix": "ordercomment", 2534 | "body": "OrderComment()$0", 2535 | "description": " Returns comment of the currently selected order." 2536 | }, 2537 | 2538 | "OrderCommission": { 2539 | "prefix": "ordercommission", 2540 | "body": "OrderCommission()$0", 2541 | "description": " Returns calculated commission of the currently selected order." 2542 | }, 2543 | 2544 | "OrderDelete": { 2545 | "prefix": "orderdelete", 2546 | "body": "OrderDelete(${1:int ticket}, ${5:color arrow_color=clrNone})$0", 2547 | "description": " Deletes previously opened pending order." 2548 | }, 2549 | 2550 | "OrderExpiration": { 2551 | "prefix": "orderexpiration", 2552 | "body": "OrderExpiration()$0", 2553 | "description": " Returns expiration date of the selected pending order." 2554 | }, 2555 | 2556 | "OrderLots": { 2557 | "prefix": "orderlots", 2558 | "body": "OrderLots()$0", 2559 | "description": " Returns amount of lots of the selected order." 2560 | }, 2561 | 2562 | "OrderMagicNumber": { 2563 | "prefix": "ordermagicnumber", 2564 | "body": "OrderMagicNumber()$0", 2565 | "description": " Returns an identifying (magic) number of the currently selected order." 2566 | }, 2567 | "OrderModify": { 2568 | "prefix": "ordermodify", 2569 | "body": "OrderModify(${1:int ticket}, ${2:double price}, ${3:double stoploss}, ${4:double takeprofit}, ${5:datetime expiration}, ${6:color arrow_color=clrNone})$0", 2570 | "description": " Modification of characteristics of the previously opened or pending orders." 2571 | }, 2572 | "OrderOpenPrice": { 2573 | "prefix": "orderopenprice", 2574 | "body": "OrderOpenPrice()$0", 2575 | "description": " Returns open price of the currently selected order." 2576 | }, 2577 | "OrderOpenTime": { 2578 | "prefix": "orderopentime", 2579 | "body": "OrderOpenTime()$0", 2580 | "description": " Returns open time of the currently selected order." 2581 | }, 2582 | "OrderPrint": { 2583 | "prefix": "orderprint", 2584 | "body": "OrderPrint()$0", 2585 | "description": " Prints information about the selected order in the log." 2586 | }, 2587 | "OrderProfit": { 2588 | "prefix": "orderprofit", 2589 | "body": "OrderProfit()$0", 2590 | "description": " Returns profit of the currently selected order." 2591 | }, 2592 | "OrderSelect": { 2593 | "prefix": "orderselect", 2594 | "body": "OrderSelect(${1:int position|int ticket}, ${2:SELECT_BY_POS|SELECT_BY_TICKET}, ${3:int pool=MODE_TRADES|MODE_HISTORY})$0", 2595 | "description": " The function selects an order for further processing." 2596 | }, 2597 | "OrderSend": { 2598 | "prefix": "ordersend", 2599 | "body": "OrderSend(${1:string symbol}, ${2:int cmd}, ${3:double volume}, ${4:double price}, ${5:int slippage}, ${6:double stoploss}, ${7:double takeprofit}, ${8:string comment=NULL}, ${9:int magic=0}, ${10:datetime expiration=0}, ${11:color arrow_color=clrNONE})$0", 2600 | "description": " The main function used to open market or place a pending order. Returns number of the ticket assigned to the order by the trade server or -1 if it fails." 2601 | }, 2602 | "OrdersHistoryTotal": { 2603 | "prefix": "ordershistorytotal", 2604 | "body": "OrdersHistoryTotal)$0", 2605 | "description": " Returns the number of closed orders in the account history loaded into the terminal. " 2606 | }, 2607 | "OrderStopLoss": { 2608 | "prefix": "orderstoploss", 2609 | "body": "OrderStopLoss(${1:int ticket}, ${2:double lots}, ${3:double price}, ${4:int slippage}, ${5:color arrow_color})$0", 2610 | "description": " Returns stoploss of the currently selected order." 2611 | }, 2612 | "OrdersTotal": { 2613 | "prefix": "orderstotal", 2614 | "body": "OrdersTotal()$0", 2615 | "description": " Returns the number of market and pending orders." 2616 | }, 2617 | "OrderSwap": { 2618 | "prefix": "orderswap", 2619 | "body": "OrderSwap()$0", 2620 | "description": " Returns swap value of the currently selected order." 2621 | }, 2622 | "OrderTakeProfit": { 2623 | "prefix": "ordertakeprofit", 2624 | "body": "OrderTakeProfit()$0", 2625 | "description": " Returns take profit value of the currently selected order." 2626 | }, 2627 | "OrderSymbol": { 2628 | "prefix": "ordersymbol", 2629 | "body": "OrderSymbol()$0", 2630 | "description": " Returns symbol of the currently selected order." 2631 | }, 2632 | "OrderTicket": { 2633 | "prefix": "orderticket", 2634 | "body": "OrderTicket()$0", 2635 | "description": " Returns order ticket number of the currently selected order." 2636 | }, 2637 | "OrderType": { 2638 | "prefix": "ordertype", 2639 | "body": "OrderType()$0", 2640 | "description": " Returns order operation type of the currently selected order. OP_BUY=buy-order, OP_SELL=sell-order, OP_BUYLIMIT=buy-limit, OP_BUYSTOP=buy-stop, OP_SELLLIMIT=sell-limit, OP_SELLSTOP=sell-stop." 2641 | }, 2642 | 2643 | // iIndicators 2644 | "iATR":{ 2645 | "prefix":"indicator", 2646 | "body":"iATR(${1:string symbol}, ${2:int timeframe}, ${3:int period}, ${4:int shift})$0", 2647 | "description":" Calculates the Average True Range indicator and returns its value" 2648 | }, 2649 | "iADX":{ 2650 | "prefix":"indicator", 2651 | "body":"iADX(${1:string symbol}, ${2:int timeframe}, ${3:int period}, ${4:int applied_price}, ${5:int mode}, ${6:int shift})$0", 2652 | "description":" Calculates the Average Directional Movement Index indicator and returns its value." 2653 | }, 2654 | "iBands":{ 2655 | "prefix":"indicator", 2656 | "body":"iBands(${1:string symbol}, ${2:int timeframe}, ${3:int period}, ${4:double deviation}, ${5:int bands_shift}, ${6:int applied_price}, ${7:int mode}, ${8:int shift})$0", 2657 | "description":" Calculates the Bollinger Bands® indicator and returns its value." 2658 | }, 2659 | "iCustom":{ 2660 | "prefix":"indicator", 2661 | "body":"iCustom(${1:string symbol}, ${2:int timeframe}, ${3:string name}, ${4: ... }, ${5:int buffer_index}, ${6:int shift})$0", 2662 | "description":" Calculates the specified custom indicator and returns its value. The custom indicator must be compiled (*.EX4 file) and be in the terminal_directory\\MQL4\\Indicators\\ directory." 2663 | }, 2664 | 2665 | "iMA":{ 2666 | "prefix":"indicator", 2667 | "body":"iMA(${1:string symbol}, ${2:int timeframe}, ${3:int ma_period}, ${4:int ma_shift}, ${5:int ma_method}, ${6:int applied_price}, ${7:int shift})$0", 2668 | "description":" Calculates the Moving Average indicator and returns its value. eg. iMA(NULL,0,13,8,MODE_SMMA,PRICE_MEDIAN,i);" 2669 | }, 2670 | 2671 | "iRSI":{ 2672 | "prefix":"indicator", 2673 | "body":"iRSI(${1:string symbol}, ${2:int timeframe}, ${3:int period}, ${4:int applied_price}, ${5:int shift})$0", 2674 | "description":" Calculates the RSI indicator and returns its value." 2675 | }, 2676 | "iStochastic":{ 2677 | "prefix":"indicator", 2678 | "body":"iStochastic(${1:string symbol}, ${2:int timeframe}, ${3:int Kperiod}, ${4:int Dperiod}, ${5:int slowing}, ${5:int method}, ${6:int price_field}, ${7:int mode}, ${8:int shift})$0", 2679 | "description":" Calculates the Moving Average indicator and returns its value. eg. iMA(NULL,0,13,8,MODE_SMMA,PRICE_MEDIAN,i);" 2680 | }, 2681 | // chart event enums 2682 | "ENUM_CHART_EVENT":{ 2683 | "prefix":"enumchartevent", 2684 | "body":"ENUM_CHART_EVENT", 2685 | "description":"There are 9 types of events that can be processed using the predefined function OnChartEvent(). " 2686 | }, 2687 | "CHARTEVENT_KEYDOWN":{ 2688 | "prefix":"_chartevent", 2689 | "body":"CHARTEVENT_KEYDOWN", 2690 | "description":"Keystrokes" 2691 | }, 2692 | "CHARTEVENT_MOUSE_MOVE":{ 2693 | "prefix":"_chartevent", 2694 | "body":"CHARTEVENT_MOUSE_MOVE", 2695 | "description":"Mouse move, mouse clicks (if CHART_EVENT_MOUSE_MOVE=true is set for the chart)" 2696 | }, 2697 | "CHARTEVENT_OBJECT_CREATE":{ 2698 | "prefix":"_chartevent", 2699 | "body":"CHARTEVENT_OBJECT_CREATE", 2700 | "description":"Graphical object created (if CHART_EVENT_OBJECT_CREATE=true is set for the chart)" 2701 | }, 2702 | "CHARTEVENT_OBJECT_DELETE":{ 2703 | "prefix":"_chartevent", 2704 | "body":"CHARTEVENT_OBJECT_DELETE", 2705 | "description":"Graphical object deleted (if CHART_EVENT_OBJECT_DELETE=true is set for the chart)" 2706 | }, 2707 | "CHARTEVENT_OBJECT_CHANGE":{ 2708 | "prefix":"_chartevent", 2709 | "body":"CHARTEVENT_OBJECT_CHANGE", 2710 | "description":"Graphical object property changed via the properties dialog" 2711 | }, 2712 | "CHARTEVENT_CLICK":{ 2713 | "prefix":"_chartevent", 2714 | "body":"CHARTEVENT_CLICK", 2715 | "description":"Clicking on a graphical object" 2716 | }, 2717 | "CHARTEVENT_OBJECT_DRAG":{ 2718 | "prefix":"_chartevent", 2719 | "body":"CHARTEVENT_OBJECT_DRAG", 2720 | "description":"Drag and drop of a graphical object" 2721 | }, 2722 | "CHARTEVENT_OBJECT_ENDEDIT":{ 2723 | "prefix":"_chartevent", 2724 | "body":"CHARTEVENT_OBJECT_ENDEDIT", 2725 | "description":"End of text editing in the graphical object Edit" 2726 | }, 2727 | "CHARTEVENT_CHART_CHANGE":{ 2728 | "prefix":"_chartevent", 2729 | "body":"CHARTEVENT_CHART_CHANGE", 2730 | "description":"Change of the chart size or modification of chart properties through the Properties dialog" 2731 | }, 2732 | "CHARTEVENT_CUSTOM":{ 2733 | "prefix":"_chartevent", 2734 | "body":"CHARTEVENT_CUSTOM", 2735 | "description":"Initial number of an event from a range of custom events" 2736 | }, 2737 | "CHARTEVENT_CUSTOM_LAST":{ 2738 | "prefix":"_chartevent", 2739 | "body":"CHARTEVENT_CUSTOM_LAST", 2740 | "description":"The final number of an event from a range of custom events" 2741 | }, 2742 | 2743 | 2744 | // Common MQL4 code snippets 2745 | "for forward": { 2746 | "prefix": "for", 2747 | "body": [ 2748 | "for(int i=0;i < ${1:int max_iter};i++)", 2749 | "{", 2750 | " $0", 2751 | "}" 2752 | ], 2753 | "description": "mql4 orderselect loop" 2754 | }, 2755 | "for backward": { 2756 | "prefix": "for", 2757 | "body": [ 2758 | "for(int i=${1:int max_iter} - 1;i >= 0 ;i--)", 2759 | "{", 2760 | " $0", 2761 | "}" 2762 | ], 2763 | "description": "mql4 orderselect loop" 2764 | }, 2765 | "for OrdersTotal": { 2766 | "prefix": "for", 2767 | "body": [ 2768 | "for(int i=OrdersTotal()-1;i>=0;i--)", 2769 | "{", 2770 | " if(OrderSelect(i,SELECT_BY_POS) && OrderSymbol() == _Symbol ${1: other conditions})", 2771 | " {", 2772 | " $0", 2773 | " }", 2774 | "}" 2775 | ], 2776 | "description": "mql4 orderselect loop" 2777 | }, 2778 | "for OrdersHistoryTotal": { 2779 | "prefix": "for", 2780 | "body": [ 2781 | "for(int i=OrdersHistoryTotal()-1;i>=0;i--)", 2782 | "{", 2783 | " if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY) && OrderSymbol() == _Symbol ${1: other conditions})", 2784 | " {", 2785 | " $0", 2786 | " }", 2787 | "}" 2788 | ], 2789 | "description": "mql4 orderselect loop" 2790 | }, 2791 | "OnStart": { 2792 | "prefix": "onstart", 2793 | "body": [ 2794 | "void OnStart()", 2795 | "{", 2796 | " $0", 2797 | "}" 2798 | ], 2799 | "description": "Script entry point" 2800 | }, 2801 | "Script_Template": { 2802 | "prefix": "mqltemplate_script", 2803 | "body": [ 2804 | "//+------------------------------------------------------------------+", 2805 | "//| ${1:file_name.mq4}.mq4", 2806 | "//| Copyright 2017, ${2:Author Name}", 2807 | "//| ${3:Link}", 2808 | "//+------------------------------------------------------------------+", 2809 | "#property copyright \"Copyright 2017, ${2:Author Name}\"", 2810 | "#property link \"${3:Link}\"", 2811 | "#property version \"1.00\"", 2812 | "#property strict", 2813 | "$4", 2814 | " ", 2815 | " ", 2816 | "void OnStart()", 2817 | "{", 2818 | " $5", 2819 | "}", 2820 | "$0" 2821 | ] 2822 | }, 2823 | "Expert_Template": { 2824 | "prefix": "mqltemplate_expert", 2825 | "body": [ 2826 | "//+------------------------------------------------------------------+", 2827 | "//| ${1:file_name.mq4}.mq4", 2828 | "//| Copyright 2017, ${2:Author Name}", 2829 | "//| ${3:Link}", 2830 | "//+------------------------------------------------------------------+", 2831 | "#property copyright \"Copyright 2017, ${2:Author Name}\"", 2832 | "#property link \"${3:Link}\"", 2833 | "#property version \"1.00\"", 2834 | "#property strict", 2835 | "$4", 2836 | " ", 2837 | " ", 2838 | "//+------------------------------------------------------------------+", 2839 | "//| Expert initialization function |", 2840 | "//+------------------------------------------------------------------+", 2841 | "int OnInit()", 2842 | "{", 2843 | " EventSetTimer(60);", 2844 | " ", 2845 | " return(INIT_SUCCEEDED);", 2846 | "}", 2847 | "//+------------------------------------------------------------------+", 2848 | "//| Expert deinitialization function |", 2849 | "//+------------------------------------------------------------------+", 2850 | ",void OnDeinit(const int reason)", 2851 | "{", 2852 | " EventKillTimer();", 2853 | " ", 2854 | "}", 2855 | "//+------------------------------------------------------------------+", 2856 | "//| Expert tick function |", 2857 | "//+------------------------------------------------------------------+", 2858 | "void OnTick()", 2859 | "{", 2860 | " ", 2861 | "}", 2862 | "//+------------------------------------------------------------------+", 2863 | "//| Timer function |", 2864 | "//+------------------------------------------------------------------+", 2865 | "void OnTimer()", 2866 | "{", 2867 | " ", 2868 | "}", 2869 | "//+------------------------------------------------------------------+", 2870 | "//| ChartEvent function |", 2871 | "//+------------------------------------------------------------------+", 2872 | "void OnChartEvent(const int id,", 2873 | " const long &lparam,", 2874 | " const double &dparam,", 2875 | " const string &sparam)", 2876 | "{", 2877 | " ", 2878 | "}", 2879 | "//+------------------------------------------------------------------+", 2880 | ], 2881 | "description":"expert advisor template" 2882 | }, 2883 | 2884 | "Function Header": { 2885 | "prefix": "functionheader", 2886 | "body": [ 2887 | "//+------------------------------------------------------------------+", 2888 | "//| ${1:type} ${2:FuntionName} : ${3:description}", 2889 | "//+------------------------------------------------------------------+", 2890 | "${1:type} ${2:FunctionName}($4)", 2891 | "{", 2892 | " $0", 2893 | "}" 2894 | ] 2895 | } 2896 | 2897 | //------------------ Functions to convert time and price ------------------ 2898 | 2899 | "ChartXYToTimePrice":{//(0, posX, posY, window, dt, price)" 2900 | "prefix": "ChartXYToTimePrice(int id, int cordX, int cordY, int window, datetime resTime, double resPrice)", 2901 | "body": "ChartXYToTimePrice(${1:int id}, ${2:int cordX}, ${3:int window}, ${4:datetime resTime}, ${5:double resPrice});", 2902 | "description": "Convert coordenate X|Y to time and price" 2903 | }, 2904 | 2905 | "ChartTimePriceToXY":{//(0, posX, posY, window, dt, price)" 2906 | "prefix": "ChartTimePriceToXY(int id, int window, datetime time1, double price1, int cordX, int cordY)", 2907 | "body": "ChartTimePriceToXY(${1:int id}, ${2:int window}, ${3:datetime time1}, ${4:double price1}, ${5:int cordX}, ${6:int cordY});", 2908 | "description": "Convert time and price to coordenate X|Y" 2909 | }, 2910 | 2911 | "ChartNavigate":{ 2912 | "prefix": "ChartNavigate(int id, ENUM, int shift)", 2913 | "body": "ChartNavigate(${1:int id}, ${2:CHART_BEGIN | CHART_CURRENT_POS | CHART_END}, ${3:int shift});", 2914 | "description": "Shift the chart to specific candle" 2915 | }, 2916 | 2917 | //--------------------------------------------------------------------------------------------------------------------- 2918 | 2919 | //Properties of the object ObjectCreate(0, "DRectV_" + (string)numV, OBJ_TEXT, window, dt, price); 2920 | "ObjectCreate":{ 2921 | "prefix": "ObjectCreate(int idChart, string name, OBJTYPE, int window, datetime date, double price)", 2922 | "body": "ObjectSet(${1:int idChart}, ${2:string name}, ${3:OBJTYPE}, ${4:int window}, ${5:datetime date}, ${6:double price});", 2923 | "description": "Setter for the object" 2924 | }, 2925 | 2926 | "ObjectSet":{ 2927 | "prefix": "objectSet(string name, OBJPROP, value)", 2928 | "body": "ObjectSet(${1:string name}, ${2:OBJPROP}, ${3:VALUE})", 2929 | "description": "Setter for the object" 2930 | }, 2931 | 2932 | 2933 | "OBJPROP_PRICE1":{ 2934 | "prefix": "objprop_price1", 2935 | "body": "OBJPROP_PRICE1", 2936 | "description": "Set the property of price1 of the object" 2937 | }, 2938 | 2939 | "OBJPROP_PRICE2":{ 2940 | "prefix": "objprop_price2", 2941 | "body": "OBJPROP_PRICE2", 2942 | "description": "Set the property of price2 of the object" 2943 | }, 2944 | 2945 | "OBJPROP_PRICE3":{ 2946 | "prefix": "objprop_price3", 2947 | "body": "OBJPROP_PRICE3", 2948 | "description": "Set the property of price3 of the object" 2949 | }, 2950 | 2951 | "OBJPROP_TIME1":{ 2952 | "prefix": "objprop_time1", 2953 | "body": "OBJPROP_TIME1", 2954 | "description": "Set the property of time1 of the object" 2955 | }, 2956 | 2957 | "OBJPROP_TIME2":{ 2958 | "prefix": "objprop_time2", 2959 | "body": "OBJPROP_TIME2", 2960 | "description": "Set the property of time2 of the object" 2961 | }, 2962 | 2963 | "OBJPROP_TIME3":{ 2964 | "prefix": "objprop_time3", 2965 | "body": "OBJPROP_TIME3", 2966 | "description": "Set the property of time3 of the object" 2967 | }, 2968 | 2969 | "OBJPROP_TEXT":{ 2970 | "prefix": "objprop_text", 2971 | "body": "OBJPROP_TEXT", 2972 | "description": "Set the property of text of the object" 2973 | }, 2974 | 2975 | "OBJPROP_SELECTED":{ 2976 | "prefix": "objprop_selected", 2977 | "body": "OBJPROP_SELECTED", 2978 | "description": "Set the property of the object selection" 2979 | }, 2980 | 2981 | "OBJPROP_ANGLE":{ 2982 | "prefix": "objprop_angle", 2983 | "body": "OBJPROP_ANGLE", 2984 | "description": "Set the angle" 2985 | }, 2986 | 2987 | "OBJPROP_COLOR":{ 2988 | "prefix": "objprop_color", 2989 | "body": "OBJPROP_COLOR", 2990 | "description": "Set the color" 2991 | }, 2992 | 2993 | "OBJPROP_XDISTANCE":{ 2994 | "prefix": "objprop_xdistance", 2995 | "body": "OBJPROP_XDISTANCE", 2996 | "description": "Set the x distance in pixels" 2997 | }, 2998 | 2999 | "OBJPROP_YDISTANCE":{ 3000 | "prefix": "objprop_ydistance", 3001 | "body": "OBJPROP_YDISTANCE", 3002 | "description": "Set the y distance in pixels" 3003 | }, 3004 | 3005 | "OBJPROP_CORNER":{ 3006 | "prefix": "objprop_corner", 3007 | "body": "OBJPROP_CORNER", 3008 | "description": "Set the corner of the ancle" 3009 | }, 3010 | 3011 | "OBJPROP_BGCOLOR":{ 3012 | "prefix": "objprop_bgcolor", 3013 | "body": "OBJPROP_BGCOLOR", 3014 | "description": "Set the background color" 3015 | }, 3016 | 3017 | "OBJPROP_FONTSIZE":{ 3018 | "prefix": "objprop_fontsize", 3019 | "body": "OBJPROP_FONTSIZE", 3020 | "description": "Set the size of text" 3021 | }, 3022 | 3023 | "OBJPROP_YSIZE":{ 3024 | "prefix": "objprop_ysize", 3025 | "body": "OBJPROP_YSIZE", 3026 | "description": "Set the y size of the object" 3027 | }, 3028 | 3029 | "OBJPROP_XSIZE":{ 3030 | "prefix": "objprop_xsize", 3031 | "body": "OBJPROP_XSIZE", 3032 | "description": "Set the x size of the object" 3033 | }, 3034 | 3035 | "OBJPROP_LEVELTEXT":{ 3036 | "prefix": "objprop_leveltext", 3037 | "body": "OBJPROP_LEVELTEXT", 3038 | "description": "Set the fibo level" 3039 | }, 3040 | 3041 | "OBJPROP_NAME":{ 3042 | "prefix": "objprop_name", 3043 | "body": "OBJPROP_NAME", 3044 | "description": "Set or get the name of the object" 3045 | }, 3046 | 3047 | "OBJPROP_TIMEFRAMES":{ 3048 | "prefix": "objprop_timeframes", 3049 | "body": "OBJPROP_TIMEFRAMES", 3050 | "description": "Set or get the timeframe of the object" 3051 | }, 3052 | 3053 | "OBJPROP_WITH":{ 3054 | "prefix": "objprop_with", 3055 | "body": "OBJPROP_WITH", 3056 | "description": "Set the with of the object" 3057 | }, 3058 | 3059 | "OBJPROP_FONT":{ 3060 | "prefix": "objprop_font", 3061 | "body": "OBJPROP_FONT", 3062 | "description": "Set the font of the object" 3063 | }, 3064 | 3065 | "OBJPROP_HIDDEN":{ 3066 | "prefix": "objprop_hidden", 3067 | "body": "OBJPROP_HIDDEN", 3068 | "description": "Set the visibility of an object" 3069 | }, 3070 | 3071 | "OBJPROP_SELECTABLE":{ 3072 | "prefix": "objprop_selectable", 3073 | "body": "OBJPROP_SELECTABLE", 3074 | "description": "Set the if the object can be selected" 3075 | }, 3076 | 3077 | "CHART_WIDTH_IN_PIXELS":{ 3078 | "prefix": "chart_with_in_pixels", 3079 | "body": "CHART_WIDTH_IN_PIXELS", 3080 | "description": "Returns the value of the number of pixels in the <--x-->" 3081 | }, 3082 | 3083 | "ObjectsTotal":{ 3084 | "prefix": "Objectstotal", 3085 | "body": "ObjectsTotal()", 3086 | "description": "Returns the number of objects in the chart (all periods)" 3087 | }, 3088 | 3089 | "ObjectName":{ 3090 | "prefix": "ObjectName(object)", 3091 | "body": "ObjectName(${1: object})", 3092 | "description": "Returns the number of objects in the chart (all periods)" 3093 | }, 3094 | 3095 | 3096 | } -------------------------------------------------------------------------------- /vsc-extension-quickstart.md: -------------------------------------------------------------------------------- 1 | # Welcome to your VS Code Extension 2 | 3 | ## What's in the folder 4 | * This folder contains all of the files necessary for your extension. 5 | * `package.json` - this is the manifest file that defines the location of the snippet file 6 | and specifies the language of the snippets. 7 | * `snippets/snippets.json` - the file containing all snippets. 8 | 9 | ## Get up and running straight away 10 | * Press `F5` to open a new window with your extension loaded. 11 | * Create a new file with a file name suffix matching your language. 12 | * Verify that your snippets are proposed on intellisense. 13 | 14 | ## Make changes 15 | * You can relaunch the extension from the debug toolbar after making changes to the files listed above. 16 | * You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes. 17 | 18 | ## Install your extension 19 | * To start using your extension with Visual Studio Code copy it into the `/.vscode/extensions` folder and restart Code. 20 | * To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension. 21 | --------------------------------------------------------------------------------