A programming construct that repeats a block of code until a condition changes. Loops are essential in EAs for iterating over arrays of data (e.g., price history) or continuously checking conditions. Common loops are for
, while
, and do-while
. For instance, an EA may use a for
loop to process each bar in a price series to calculate an indicator.