To MetaQuote "Line Chart"

 
Can you please tell me what is an algorithm to calculate "Line Chart"
 
Reason: