Atom
Work on atom lists, texts whose items are separated by a separator: get an item by position, the first or the last one, find, count, remove duplicates and trim the items. Typical uses: read a field of a delimited line, count distinct values of a list.
atom before_excludatom before_includatom countatom count_distinctatom count_lrtrimatom count_lrtrim_distinctatom distinctatom distinct_lrtrimatom distinct_lrtrim_1sbeforeatom findatom find_lrtrimatom getatom get_firstatom get_first_lrtrimatom get_lastatom get_last_lrtrimatom get_lrtrimatom lrtrimatom positionatom position_lrtrimatom size
atom before_exclud <atomList> <index> <separator>
Description
Get the atom list before the first occurrence of an atom in an atom list (atom excluded).
Get the atom list before the first occurrence of an atom in an atom list (atom excluded).
Parameters
atomList: The atom list (example: A,B,C) - String - required
index: The atom index - Number - required
separator: The list separator (in this example ','), 1 character max - Number - required
atomList: The atom list (example: A,B,C) - String - required
index: The atom index - Number - required
separator: The list separator (in this example ','), 1 character max - Number - required
admin
atom before_exclud " A, B,A ,A ,C, D " "3" ","
mentdb
A, B
Used in use cases (4 recipes)
MQL developer › Breadcrumb links from a page path
Backend & web service developer › Inspect a script and answer with a JSON object
Algorithms in MQL › Stack and queue with atom lists
The MQL language in depth › Atom lists: negotiate the language of a response
MQL developer › Breadcrumb links from a page path
Backend & web service developer › Inspect a script and answer with a JSON object
Algorithms in MQL › Stack and queue with atom lists
The MQL language in depth › Atom lists: negotiate the language of a response
Often used with
atom get_last · atom size · and · atom get · atom before_includ · atom get_first · is empty · atom count
atom get_last · atom size · and · atom get · atom before_includ · atom get_first · is empty · atom count
atom before_includ <atomList> <index> <separator>
Description
Get the atom list before the first occurrence of an atom in an atom list (atom included).
Get the atom list before the first occurrence of an atom in an atom list (atom included).
Parameters
atomList: The atom list (example: A,B,C) - String - required
index: The atom index - Number - required
separator: The list separator (in this example ','), 1 character max - Number - required
atomList: The atom list (example: A,B,C) - String - required
index: The atom index - Number - required
separator: The list separator (in this example ','), 1 character max - Number - required
admin
atom before_includ " A, B,A ,A ,C, D " "3" ","
mentdb
A, B,A
Used in use cases (3 recipes)
MQL developer › Breadcrumb links from a page path
The MQL language in depth › Atom lists: negotiate the language of a response
Web & API developer › Resolve npm semver ranges
MQL developer › Breadcrumb links from a page path
The MQL language in depth › Atom lists: negotiate the language of a response
Web & API developer › Resolve npm semver ranges
Often used with
atom get · and · atom before_exclud · atom get_last · atom size · atom count · atom distinct_lrtrim_1sbefore · atom find
atom get · and · atom before_exclud · atom get_last · atom size · atom count · atom distinct_lrtrim_1sbefore · atom find
atom count <atomList> <atomToCount> <separator>
Description
Count the number of occurrences of an atom in an atom list.
Count the number of occurrences of an atom in an atom list.
Parameters
atomList: The atom list (example: A,B,C) - String - required
atomToCount: The atom to search - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
atomList: The atom list (example: A,B,C) - String - required
atomToCount: The atom to search - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
admin
atom count " A, B,A ,A ,C, D " "A " ","
mentdb
2
Used in use cases (4 recipes)
MQL developer › Clean a list of tags with atom functions
Date & time developer › GDPR retention: keep, anonymise or delete customers
Control flow › Reserve stock without overselling: synchronized
The MQL language in depth › Atom lists: negotiate the language of a response
MQL developer › Clean a list of tags with atom functions
Date & time developer › GDPR retention: keep, anonymise or delete customers
Control flow › Reserve stock without overselling: synchronized
The MQL language in depth › Atom lists: negotiate the language of a response
Often used with
atom distinct_lrtrim_1sbefore · atom find · atom get_first_lrtrim · atom lrtrim · atom position · atom size · and · atom before_exclud
atom distinct_lrtrim_1sbefore · atom find · atom get_first_lrtrim · atom lrtrim · atom position · atom size · and · atom before_exclud
atom count_distinct <atomList> <atomToCount> <separator>
Description
Count the number of distinct occurrences of an atom in an atom list.
Count the number of distinct occurrences of an atom in an atom list.
Parameters
atomList: The atom list (example: A,B,C) - String - required
atomToCount: The atom to search - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
atomList: The atom list (example: A,B,C) - String - required
atomToCount: The atom to search - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
admin
atom count_distinct " A, B,A ,A ,C, D " "A " ","
mentdb
1
Often used with
atom count · atom count_lrtrim · atom count_lrtrim_distinct · atom distinct · atom distinct_lrtrim · atom distinct_lrtrim_1sbefore · atom find · atom find_lrtrim
atom count · atom count_lrtrim · atom count_lrtrim_distinct · atom distinct · atom distinct_lrtrim · atom distinct_lrtrim_1sbefore · atom find · atom find_lrtrim
atom count_lrtrim <atomList> <atomToCount> <separator>
Description
Count the number of occurrences of an atom in an atom list, after lrtrim.
Count the number of occurrences of an atom in an atom list, after lrtrim.
Parameters
atomList: The atom list (example: A,B,C) - String - required
atomToCount: The atom to search - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
atomList: The atom list (example: A,B,C) - String - required
atomToCount: The atom to search - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
admin
atom count_lrtrim " A, B,A ,A ,C, D " "A " ","
mentdb
3
Often used with
atom count · atom count_distinct · atom count_lrtrim_distinct · atom distinct · atom distinct_lrtrim · atom distinct_lrtrim_1sbefore · atom find · atom find_lrtrim
atom count · atom count_distinct · atom count_lrtrim_distinct · atom distinct · atom distinct_lrtrim · atom distinct_lrtrim_1sbefore · atom find · atom find_lrtrim
atom count_lrtrim_distinct <atomList> <atomToCount> <separator>
Description
Count the number of distinct occurrences of an atom in an atom list, after lrtrim.
Count the number of distinct occurrences of an atom in an atom list, after lrtrim.
Parameters
atomList: The atom list (example: A,B,C) - String - required
atomToCount: The atom to search - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
atomList: The atom list (example: A,B,C) - String - required
atomToCount: The atom to search - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
admin
atom count_lrtrim_distinct " A, B,A ,A ,C, D " "A " ","
mentdb
1
Often used with
atom count · atom count_distinct · atom count_lrtrim · atom distinct · atom distinct_lrtrim · atom distinct_lrtrim_1sbefore · atom find · atom find_lrtrim
atom count · atom count_distinct · atom count_lrtrim · atom distinct · atom distinct_lrtrim · atom distinct_lrtrim_1sbefore · atom find · atom find_lrtrim
atom distinct <atomList> <separator>
Description
Get the distinct atoms of a list
Get the distinct atoms of a list
Parameters
atomList: The atom list (example: A,B,C) - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
atomList: The atom list (example: A,B,C) - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
admin
atom distinct "A,B,A,A ,C,D" ","
mentdb
A,B,A ,C,D
Used in use cases (3 recipes)
MQL developer › Clean a list of tags with atom functions
The MQL language in depth › Variables: dynamic names, counters and their traps
MQL developer › Sort CSV columns: text sort versus numeric sorts
MQL developer › Clean a list of tags with atom functions
The MQL language in depth › Variables: dynamic names, counters and their traps
MQL developer › Sort CSV columns: text sort versus numeric sorts
Often used with
atom size · atom count · atom count_distinct · atom count_lrtrim · atom count_lrtrim_distinct · atom distinct_lrtrim · atom distinct_lrtrim_1sbefore · atom find
atom size · atom count · atom count_distinct · atom count_lrtrim · atom count_lrtrim_distinct · atom distinct_lrtrim · atom distinct_lrtrim_1sbefore · atom find
atom distinct_lrtrim <atomList> <separator>
Description
Get the distinct atoms of a list, after lrtrim
Get the distinct atoms of a list, after lrtrim
Parameters
atomList: The atom list (example: A,B,C) - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
atomList: The atom list (example: A,B,C) - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
admin
atom distinct_lrtrim " A, B,A ,A ,C, D " ","
mentdb
A,B,C,D
Often used with
atom count · atom count_distinct · atom count_lrtrim · atom count_lrtrim_distinct · atom distinct · atom distinct_lrtrim_1sbefore · atom find · atom find_lrtrim
atom count · atom count_distinct · atom count_lrtrim · atom count_lrtrim_distinct · atom distinct · atom distinct_lrtrim_1sbefore · atom find · atom find_lrtrim
atom distinct_lrtrim_1sbefore <atomList> <separator>
Description
Get the distinct atoms of a list, after lrtrim, with one space added before every atom except the first.
Get the distinct atoms of a list, after lrtrim, with one space added before every atom except the first.
Parameters
atomList: The atom list (example: A,B,C) - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
atomList: The atom list (example: A,B,C) - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
admin
atom distinct_lrtrim_1sbefore " A, B,A ,A ,C, D " ","
mentdb
A, B, C, D
Used in use cases (2 recipes)
MQL developer › Clean a list of tags with atom functions
The MQL language in depth › Atom lists: negotiate the language of a response
MQL developer › Clean a list of tags with atom functions
The MQL language in depth › Atom lists: negotiate the language of a response
Often used with
atom count · atom find · atom get_first_lrtrim · atom lrtrim · atom position · atom size · and · atom before_exclud
atom count · atom find · atom get_first_lrtrim · atom lrtrim · atom position · atom size · and · atom before_exclud
atom find <atomList> <atomToFind> <separator>
Description
Find the position of an atom in an atom list.
Find the position of an atom in an atom list.
Parameters
atomList: The atom list (example: A,B,C) - String - required
atomToFind: The atom to search - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
atomList: The atom list (example: A,B,C) - String - required
atomToFind: The atom to search - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
admin
atom find " A, B,A ,A ,C, D " "A " ","
mentdb
3
Used in use cases (9 recipes)
MQL developer › Clean a list of tags with atom functions
Date & time developer › French public holidays and a delivery date in working days
Data validation developer › Password policy with an entropy estimate
JSON & document store developer › Merge the pages of a paginated API without duplicates
Algorithms in MQL › Word frequency with an index and json sort
Control flow › First free meeting slot: nested loops, break and continue
and 3 more in the Use cases
MQL developer › Clean a list of tags with atom functions
Date & time developer › French public holidays and a delivery date in working days
Data validation developer › Password policy with an entropy estimate
JSON & document store developer › Merge the pages of a paginated API without duplicates
Algorithms in MQL › Word frequency with an index and json sort
Control flow › First free meeting slot: nested loops, break and continue
and 3 more in the Use cases
Often used with
atom size · atom get · string lower · continue · string regexp_replace · string trim · and · atom count
atom size · atom get · string lower · continue · string regexp_replace · string trim · and · atom count
atom find_lrtrim <atomList> <atomToFind> <separator>
Description
Find the position of an atom in an atom list, after lrtrim on each atom.
Find the position of an atom in an atom list, after lrtrim on each atom.
Parameters
atomList: The atom list (example: A,B,C) - String - required
atomToFind: The atom to search - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
atomList: The atom list (example: A,B,C) - String - required
atomToFind: The atom to search - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
admin
atom find_lrtrim " A, B,A ,A ,C, D " "A " ","
mentdb
1
Often used with
atom count · atom count_distinct · atom count_lrtrim · atom count_lrtrim_distinct · atom distinct · atom distinct_lrtrim · atom distinct_lrtrim_1sbefore · atom find
atom count · atom count_distinct · atom count_lrtrim · atom count_lrtrim_distinct · atom distinct · atom distinct_lrtrim · atom distinct_lrtrim_1sbefore · atom find
atom get <atomList> <index> <separator>
Description
Get the atom at a specific index in an atom list
Get the atom at a specific index in an atom list
Parameters
atomList: The atom list (example: A,B,C) - String - required
index: The position of the atom (starting at 1) - Number - required
separator: The list separator (in this example ','), 1 character max - Number - required
atomList: The atom list (example: A,B,C) - String - required
index: The position of the atom (starting at 1) - Number - required
separator: The list separator (in this example ','), 1 character max - Number - required
admin
atom get "A,B,C,D" 2 ","
mentdb
B
Used in use cases (82 recipes)
MQL beginner › Grade a class: for loop, list and case
MQL developer › Catalogue of math and physics constants with eval
Backend & web service developer › Health check endpoint for the load balancer
Date & time developer › Monthly billing dates and proration of an upgrade
String & encoding developer › SQL table and API names from form labels
Data validation developer › Supplier onboarding validation report
and 76 more in the Use cases
MQL beginner › Grade a class: for loop, list and case
MQL developer › Catalogue of math and physics constants with eval
Backend & web service developer › Health check endpoint for the load balancer
Date & time developer › Monthly billing dates and proration of an upgrade
String & encoding developer › SQL table and API names from form labels
Data validation developer › Supplier onboarding validation report
and 76 more in the Use cases
Often used with
atom size · and · script delete · string replace · script create · json doc · string regexp_extract · not
atom size · and · script delete · string replace · script create · json doc · string regexp_extract · not
atom get_first <atomList> <separator>
Description
Get the first atom of an atom list
Get the first atom of an atom list
Parameters
atomList: The atom list (example: A,B,C) - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
atomList: The atom list (example: A,B,C) - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
admin
atom get_first "A, B ,C,D" ","
mentdb
A
Used in use cases (5 recipes)
MQL developer › Catalogue of math and physics constants with eval
Backend & web service developer › Generate the calls of a service for the team
Script developer › Idempotent deployment with script merge
Algorithms in MQL › Stack and queue with atom lists
The MQL language in depth › Atom lists: negotiate the language of a response
MQL developer › Catalogue of math and physics constants with eval
Backend & web service developer › Generate the calls of a service for the team
Script developer › Idempotent deployment with script merge
Algorithms in MQL › Stack and queue with atom lists
The MQL language in depth › Atom lists: negotiate the language of a response
Often used with
atom get · atom get_last · atom size · and · atom before_exclud · eval · is empty · script generate create
atom get · atom get_last · atom size · and · atom before_exclud · eval · is empty · script generate create
atom get_first_lrtrim <atomList> <separator>
Description
Get the first atom of an atom list, after lrtrim
Get the first atom of an atom list, after lrtrim
Parameters
atomList: The atom list (example: A,B,C) - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
atomList: The atom list (example: A,B,C) - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
admin
atom get_first_lrtrim " A, B ,C,D" ","
mentdb
A
Used in use cases (2 recipes)
MQL developer › Clean a list of tags with atom functions
The MQL language in depth › Atom lists: negotiate the language of a response
MQL developer › Clean a list of tags with atom functions
The MQL language in depth › Atom lists: negotiate the language of a response
Often used with
atom count · atom distinct_lrtrim_1sbefore · atom find · atom lrtrim · atom position · atom size · and · atom before_exclud
atom count · atom distinct_lrtrim_1sbefore · atom find · atom lrtrim · atom position · atom size · and · atom before_exclud
atom get_last <atomList> <separator>
Description
Get the last atom of an atom list
Get the last atom of an atom list
Parameters
atomList: The atom list (example: A,B,C) - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
atomList: The atom list (example: A,B,C) - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
admin
atom get_last "A, B ,C,D" ","
mentdb
D
Used in use cases (12 recipes)
MQL developer › Catalogue of math and physics constants with eval
Backend & web service developer › Inspect a script and answer with a JSON object
String & encoding developer › Write and read a fixed width bank transfer file
Async developer › A dispatcher pushes child runs and you follow the whole tree
Event developer › Run a script when a file arrives in a folder
Algorithms in MQL › Stack and queue with atom lists
and 6 more in the Use cases
MQL developer › Catalogue of math and physics constants with eval
Backend & web service developer › Inspect a script and answer with a JSON object
String & encoding developer › Write and read a fixed width bank transfer file
Async developer › A dispatcher pushes child runs and you follow the whole tree
Event developer › Run a script when a file arrives in a folder
Algorithms in MQL › Stack and queue with atom lists
and 6 more in the Use cases
Often used with
atom get · atom size · and · while · script create · script delete · stack delete_closed_script · stack delete_wait_script
atom get · atom size · and · while · script create · script delete · stack delete_closed_script · stack delete_wait_script
atom get_last_lrtrim <atomList> <separator>
Description
Get the last atom of an atom list, after lrtrim
Get the last atom of an atom list, after lrtrim
Parameters
atomList: The atom list (example: A,B,C) - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
atomList: The atom list (example: A,B,C) - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
admin
atom get_last_lrtrim " A, B ,C, D" ","
mentdb
D
Often used with
atom count · atom count_distinct · atom count_lrtrim · atom count_lrtrim_distinct · atom distinct · atom distinct_lrtrim · atom distinct_lrtrim_1sbefore · atom find
atom count · atom count_distinct · atom count_lrtrim · atom count_lrtrim_distinct · atom distinct · atom distinct_lrtrim · atom distinct_lrtrim_1sbefore · atom find
atom get_lrtrim <atomList> <index> <separator>
Description
Get the atom at a specific index in an atom list, after lrtrim
Get the atom at a specific index in an atom list, after lrtrim
Parameters
atomList: The atom list (example: A,B,C) - String - required
index: The position of the atom (starting at 1) - Number - required
separator: The list separator (in this example ','), 1 character max - Number - required
atomList: The atom list (example: A,B,C) - String - required
index: The position of the atom (starting at 1) - Number - required
separator: The list separator (in this example ','), 1 character max - Number - required
admin
atom get_lrtrim "A, B ,C,D" 2 ","
mentdb
B
Used in use cases (2 recipes)
MQL developer › Clean a list of tags with atom functions
Backend & web service developer › Bulk import endpoint with a line by line report
MQL developer › Clean a list of tags with atom functions
Backend & web service developer › Bulk import endpoint with a line by line report
Often used with
atom size · atom count · atom count_distinct · atom count_lrtrim · atom count_lrtrim_distinct · atom distinct · atom distinct_lrtrim · atom distinct_lrtrim_1sbefore
atom size · atom count · atom count_distinct · atom count_lrtrim · atom count_lrtrim_distinct · atom distinct · atom distinct_lrtrim · atom distinct_lrtrim_1sbefore
atom lrtrim <atomList> <separator>
Description
Apply lrtrim to each atom of a list
Apply lrtrim to each atom of a list
Parameters
atomList: The atom list (example: A,B,C) - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
atomList: The atom list (example: A,B,C) - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
admin
atom lrtrim " A, B,A ,A ,C, D " ","
mentdb
A,B,A,A,C,D
Used in use cases (2 recipes)
MQL developer › Clean a list of tags with atom functions
The MQL language in depth › Atom lists: negotiate the language of a response
MQL developer › Clean a list of tags with atom functions
The MQL language in depth › Atom lists: negotiate the language of a response
Often used with
atom count · atom distinct_lrtrim_1sbefore · atom find · atom get_first_lrtrim · atom position · atom size · and · atom before_exclud
atom count · atom distinct_lrtrim_1sbefore · atom find · atom get_first_lrtrim · atom position · atom size · and · atom before_exclud
atom position <atomList> <atomToFind> <separator>
Description
Find the position of an atom in an atom list.
Find the position of an atom in an atom list.
Parameters
atomList: The atom list (example: A,B,C) - String - required
atomToFind: The atom to search - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
atomList: The atom list (example: A,B,C) - String - required
atomToFind: The atom to search - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
admin
atom position " A, B,A ,A ,C, D " "A " ","
mentdb
3
Used in use cases (2 recipes)
MQL developer › Clean a list of tags with atom functions
The MQL language in depth › Atom lists: negotiate the language of a response
MQL developer › Clean a list of tags with atom functions
The MQL language in depth › Atom lists: negotiate the language of a response
Often used with
atom count · atom distinct_lrtrim_1sbefore · atom find · atom get_first_lrtrim · atom lrtrim · atom size · and · atom before_exclud
atom count · atom distinct_lrtrim_1sbefore · atom find · atom get_first_lrtrim · atom lrtrim · atom size · and · atom before_exclud
atom position_lrtrim <atomList> <atomToFind> <separator>
Description
Find the position of an atom in an atom list, after lrtrim on each atom.
Find the position of an atom in an atom list, after lrtrim on each atom.
Parameters
atomList: The atom list (example: A,B,C) - String - required
atomToFind: The atom to search - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
atomList: The atom list (example: A,B,C) - String - required
atomToFind: The atom to search - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
admin
atom position_lrtrim " A, B,A ,A ,C, D " "A " ","
mentdb
1
Often used with
atom count · atom count_distinct · atom count_lrtrim · atom count_lrtrim_distinct · atom distinct · atom distinct_lrtrim · atom distinct_lrtrim_1sbefore · atom find
atom count · atom count_distinct · atom count_lrtrim · atom count_lrtrim_distinct · atom distinct · atom distinct_lrtrim · atom distinct_lrtrim_1sbefore · atom find
atom size <atomList> <separator>
Description
Get the number of atoms of an atom list (size >= 1)
Get the number of atoms of an atom list (size >= 1)
Parameters
atomList: The atom list (example: A,B,C) - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
atomList: The atom list (example: A,B,C) - String - required
separator: The list separator (in this example ','), 1 character max - Number - required
admin
atom size "A,B,C,D" ","
mentdb
4
Used in use cases (49 recipes)
MQL beginner › Grade a class: for loop, list and case
MQL developer › Clean a list of tags with atom functions
Backend & web service developer › Inspect a script and answer with a JSON object
Date & time developer › French public holidays and a delivery date in working days
String & encoding developer › Write and read a fixed width bank transfer file
Data validation developer › Validate an API payload against its contract
and 43 more in the Use cases
MQL beginner › Grade a class: for loop, list and case
MQL developer › Clean a list of tags with atom functions
Backend & web service developer › Inspect a script and answer with a JSON object
Date & time developer › French public holidays and a delivery date in working days
String & encoding developer › Write and read a fixed width bank transfer file
Data validation developer › Validate an API payload against its contract
and 43 more in the Use cases
Often used with
atom get · and · not · string regexp_extract · json doc · script delete · string replace · atom get_last
atom get · and · not · string regexp_extract · json doc · script delete · string replace · atom get_last
