Building an indicator

 

Hello everyone. I am a newbie in programming mql5 so I am looking for some kind of a big advice how to start. I 'm a little bit familiar with RPA soft so for the more easy explanation of what kind of indicator I would like to build here is a screenshot:

Indicator

It is obviously lots of missing things comparing with mql5 code, but the general idea should be understandable.


Appreciate any advice or code lines.

Reason: