I want to learn making a simple MT4 indicator

 

Hi,

I want to understand how a simple indicator like a 2 MA cross works and draws arrows in the main chart because I want to make a simple indicator myself.

The indicator I want to make must do some very simple calculations with the values of every bar and it's previous one and based on the outcome, draw an arror or not above or below the bar.

But first things first... Can anyone help me with a simple indicator (MQL4 code) with comments, so that I can learn what it does?


Thank you!

 
There are plenty of example Indicators in the code base: https://www.mql5.com/en/code also there are some custom indicators included with MT4 that you can open in the editor and take a look at. Also you should read the book: https://book.mql4.com// and use the Documentation for reference: https://docs.mql4.com//
Reason: