which data structure is flexible for manipulation in mql5?

 

Hello i'm writing an EA so at the formation of each new bar , multiple prices are collected from previous bars representing potential market execution levels. how can i use arrays or other data structures to collect the prices and filter through( mostly finding distance between prices)? 



// array to store prices
slevels[];
//20 represents number of bars loop through backwards to find prices for market execution 
for(int i=0;i<20;i++)
    {
    
    
     // function returns prices
     double levels = xxxxxxx;
        slevels[i]=levels;
     
  }
//is the array good for storing values as they come in and change frequently for each bar?
// how can i prevent out of bounds and do some mathimatics with the array?
//or what other data type can i use for this problem?
 
Mathewstwapalisha Mulwafu: how can i use arrays or other data structures to collect the prices and filter through( mostly finding distance between prices)? 
  1. Create a struct to collect your data. Create an array of that type to store them. What's the problem?
  2. Go through the array and filter. What's the problem?
  3. Until you can state your requirements in concrete terms, it can not be coded.