Discussion of article "Custom Indicators in MQL5 for Newbies" - page 3

 
LRDPRDX #:

I don't understand. Suppose

rates_total == MA_Period - 1

and this is the first call of the function so

prev_calculated == 0

and also begin == 0

then the condition in the first if (rates_total < MA_Period - 1 + begin) evaluates to false

then

first = MA_Period - 1 would be executed

but then NO CALCULATIONS because the condition in the first for loop evaluates to false.

I think the first if condition should be

if( rates_total < MA_Period + begin )

am I missing something here?

 
I'm newbie here so I don't know how to this..and how to start..can you teach me how? And how this will work?

 
nellypingos #:
I'm newbie here so I don't know how to this..and how to start..can you teach me how? And how this will work?

Start by reading the full article. It is intended to help you learn how to program indicators in MT5.

After that copy the example program into your terminal and attach it to a chart. Or use it in your EA. How to do that? There are other articles about it. (Hint: you will need the iCustom() function.)